paper_id
stringlengths
9
16
version
stringclasses
26 values
yymm
stringclasses
311 values
created
timestamp[s]
title
stringlengths
6
335
secondary_subfield
sequencelengths
1
8
abstract
stringlengths
25
3.93k
primary_subfield
stringclasses
124 values
field
stringclasses
20 values
fulltext
stringlengths
0
2.84M
1906.05683
1
1906
2019-06-11T17:56:29
Translating Translationese: A Two-Step Approach to Unsupervised Machine Translation
[ "cs.CL" ]
Given a rough, word-by-word gloss of a source language sentence, target language natives can uncover the latent, fully-fluent rendering of the translation. In this work we explore this intuition by breaking translation into a two step process: generating a rough gloss by means of a dictionary and then `translating' the resulting pseudo-translation, or `Translationese' into a fully fluent translation. We build our Translationese decoder once from a mish-mash of parallel data that has the target language in common and then can build dictionaries on demand using unsupervised techniques, resulting in rapidly generated unsupervised neural MT systems for many source languages. We apply this process to 14 test languages, obtaining better or comparable translation results on high-resource languages than previously published unsupervised MT studies, and obtaining good quality results for low-resource languages that have never been used in an unsupervised MT scenario.
cs.CL
cs
Translating Translationese: A Two-Step Approach to Unsupervised Machine Translation Nima Pourdamghani♣ Nada Aldarrab♠ Marjan Ghazvininejad♦ Kevin Knight♥ Jonathan May♠ ♣ Amazon ♠ USC Information Sciences Institute ♦ Facebook AI Research ♥ DiDi Labs [email protected] [email protected] [email protected] [email protected] [email protected] 9 1 0 2 n u J 1 1 ] L C . s c [ 1 v 3 8 6 5 0 . 6 0 9 1 : v i X r a Abstract Given a rough, word-by-word gloss of a source language sentence, target language natives can uncover the latent, fully-fluent rendering of the translation. In this work we explore this in- tuition by breaking translation into a two step process: generating a rough gloss by means of a dictionary and then 'translating' the resulting pseudo-translation, or 'Translationese' into a fully fluent translation. We build our Trans- lationese decoder once from a mish-mash of parallel data that has the target language in common and then can build dictionaries on de- mand using unsupervised techniques, resulting in rapidly generated unsupervised neural MT systems for many source languages. We ap- ply this process to 14 test languages, obtain- ing better or comparable translation results on high-resource languages than previously pub- lished unsupervised MT studies, and obtain- ing good quality results for low-resource lan- guages that have never been used in an unsu- pervised MT scenario. 1 Introduction Quality of machine translation, especially neu- ral MT, highly depends on the amount of avail- able parallel data. For a handful of languages, where parallel data is abundant, MT quality has reached quite good performance (Wu et al., 2016; Hassan et al., 2018). However, the quality of translation rapidly deteriorates as the amount of parallel data decreases (Koehn and Knowles, 2017). Unfortunately, many languages have close to zero parallel texts. Translating texts from these languages requires new techniques. Hermjakob et al. (2018) presented a hybrid hu- man/machine translation tool that uses lexical translation tables to gloss a translation and relies on human language and world models to propa- gate glosses into fluent translations. Inspired by that work, this work investigates the following question: Can we replace the human in the loop with more technology? We provide the following two-step solution to unsupervised neural machine translation: 1. Use a bilingual dictionary to gloss the input into a pseudo-translation or 'Translationese'. 2. Translate the Translationese into target lan- guage, using a model built in advance from various parallel data, with the source side converted into Translationese using Step 1. The notion of separating adequacy from fluency components into a pipeline of operations dates back to the early days of MT and NLP research, where the inadequacy of word-by-word MT was first observed (Yngve, 1955; Oswald, 1952). A subfield of MT research that seeks to improve flu- ency given disfluent but adequate first-pass trans- lation is automatic post-editing (APE) pioneered by Knight and Chander (1994). Much of the cur- rent APE work targets correction of black-box MT systems, which are presumed to be supervised. include 2013; Ravi and Knight, Early approaches to unsupervised machine decipherment methods translation (Nuhn et al., 2011; Pourdamghani and Knight, 2017), which suffer from a huge hypothesis space. Recent approaches to zero-shot machine translation include pivot- based methods (Chen et al., 2017; Zheng et al., 2017; Cheng et al., 2016) and multi-lingual NMT Johnson et al., methods 2017; Ha et al., 2016, 2017). These systems are zero-shot for a specific source/target language pair, but need parallel data from source to a pivot or multiple other languages. (Firat et al., 2016a,b; More recently, totally unsupervised NMT meth- ods are introduced that use only monolingual data for training a machine translation system. Lample et al. (2018a,c), Artetxe et al. (2018), and Yang et al. (2018) use iterative back-translation to train MT models in both directions simultane- ously. Their training takes place on massive mono- lingual data and requires a long time to train as well as careful tuning of hyperparameters. The closest unsupervised NMT work to ours is by Kim et al. (2018). Similar to us, they break translation into glossing and correction steps. However, their correction step is trained on ar- tificially generated noisy data aimed at simulat- ing glossed source texts. Although this correction method helps, simulating noise caused by natural language phenomena is a hard task and needs to be tuned for every language. Previous zero-shot NMT work compensates for a lack of source/target parallel data by either using source/pivot parallel data, extremely large monolingual data, or artificially generated data. These requirements and techniques limit the meth- ods' applicability to real-world low-resource lan- guages. Instead, in this paper we propose us- ing parallel data from high-resource languages to learn 'how to translate' and apply the trained sys- tem to low resource settings. We use off-the- shelf technologies to build word embeddings from monolingual data (Bojanowski et al., 2017) and learn a source-to-target bilingual dictionary us- ing source and target embeddings (Lample et al., 2018b). Given a target language, we train source- to-target dictionaries for a diverse set of high- resource source languages, and use them to con- vert the source side of the parallel data to Transla- tionese. We combine this parallel data and train a Translationese-to-target translator on it. Later, we can build source-to-target dictionaries on-demand, generate Translationese from source texts, and use the pre-trained system to rapidly produce machine translation for many languages without requiring a single line of source-target parallel data. We introduce the following contributions in this paper: • Following Hermjakob et al. (2018), we pro- pose a two step pipeline for building a rapid neural MT system for many languages. The pipeline does not require parallel data or pa- rameter fine-tuning when adapting to new source languages. • The pipeline only requires a comprehensive source to target dictionary. We show that this dictionary can be easily obtained using off- the shelf tools within a few hours. • We use this system to translate test texts from 14 languages into English. We obtain bet- ter or comparable quality translation results on high-resource languages than previously published unsupervised MT studies, and ob- tain good quality results for low-resource lan- guages that have never been used in an un- supervised MT scenario. To our knowledge, this is the first unsupervised NMT work that shows good translation results on such a large number of languages. 2 Method We introduce a two-step pipeline for unsupervised machine translation. In the first step a source text is glossed into a pseudo-translation or Trans- lationese, while in the second step a pre-trained model translates the Translationese into target. We introduce a fully unsupervised method for convert- ing the source into Translationese, and we show how to train a Translationese to target system in advance and apply it to new source languages. 2.1 Building a Dictionary The first step of our proposed pipeline includes a word-by-word translation of the source texts. This requires a source/target dictionary. Manually constructed dictionaries exist for many language pairs, however cleaning these dictionaries to get a word to word lexicon is not trivial, and these dic- tionaries often cover a small portion of the source vocabulary, focusing on stems and specifically ex- cluding inflected variants. In order to have a com- prehensive, word to word, inflected bi-lingual dic- tionary we look for automatically built ones. Automatic lexical induction is an active field of research (Fung, 1995; Koehn and Knight, 2002; Haghighi et al., 2008; Lample et al., 2018b). A popular method for automatic extraction of bilin- gual dictionaries is through building cross-lingual word embeddings. Finding a shared word rep- resentation space between two languages enables us to calculate the distance between word embed- dings of source and target, which helps us to find translation candidates for each word. We follow this approach for building the bilin- gual dictionaries. For a given source and target language, we start by separately training source and target word embeddings S and T , and use the method introduced by Lample et al. (2018b) to find a linear mapping W that maps the source em- bedding space to the target: SW = T . Lample et al. (2018b) propose an adversarial method for estimating W, where a discriminator is trained to distinguish between elements randomly sampled from W S and T, and W is trained to pre- vent the discriminator from making accurate clas- sifications. Once the initial mapping matrix W is trained, a number of refinement steps is performed to improve performance over less frequent words by changing the metric of the space. We use the trained matrix W to map the source embeddings into the space of the target embed- Then we find the k-nearest neighbors dings. among the target words for each source word, ac- cording to the cosine distance metric. These near- est neighbors represent our translation options for that source word. 2.2 Source to Translationese Once we have the translation options for tokens in the source vocabulary we can perform a word by word translation of the source into Translationese. However, a naive translation of each source token to its top translation option without considering the context is not the best way to go. Given dif- ferent contexts, a word should be translated differ- ently. We use a 5-gram target language model to look at different translation options for a source word and select one based on its context. This language model is trained in advance on large target mono- lingual data. In order to translate a source sentence into Translationese we apply a beam search with a stack size of 100 and assign a score equal to αPLM + βd(s, t) to each translation option t for a source token s, where PLM is the language model score, and d(s, t) is the cosine distance between source and target words. We set α = 0.01 and β = 0.5 2.3 Translationese to Target We train a transformer model (Vaswani et al., 2017) on parallel data from a diverse set of high- resource languages to translate Translationese into a fluent target. For each language we convert the source side of the parallel data to Translationese as described in Section 2.2. Then we combine and shuffle all the Translationese/target parallel data and train the model on the result. Once the model is trained, we can apply it to the Translationese coming from any source language. the of the use tensor2tensor implementa- We tion1 transformer model with the transformer base set hyperparame- ters (6 layers, hidden layer size of 512) as our translation model. of 3 Data and Parameters For all our training and test languages, we use the pre-trained word embeddings2 trained on Wikipedia data using fastText (Bojanowski et al., 2017). These embeddings are used to train bilin- gual dictionaries. We select English as the target language. In or- der to avoid biasing the trained system toward a language or a specific type of parallel data, we use diverse parallel data on a diverse set of languages to train the Translationese to English system. We use Arabic, Czech, Dutch, Finnish, French, Ger- man, Italian, Russian, and Spanish as the set of out training languages. We use roughly 2 million sentence pairs per language and limit the length of the sentences to 100 tokens. For Dutch, Finnish, and Ital- ian we use Europarl (Koehn, 2005) for parallel data. For Arabic we use MultiUN (Tiedemann, 2012). For French we use CommonCrawl. For German we use a mix of CommonCrawl (1.7M), and NewsCommentary (300K). The numbers in parentheses show the number of sentences for each dataset. For Spanish we use CommonCrawl (1.8M), and Europarl (200K). For Russian we use Yandex (1M), CommonCrawl (800K), and News- Commentary (200K), and finally for Czech we use a mix of ParaCrawl (1M), Europarl (640K), News- Commentary (200K), and CommonCrawl (160K). We train one model on these nine languages and apply it to test languages not in this set. Also, to test on each of the training languages, we train a model where the parallel data for that language is excluded from the training data. In each experi- ment we use 3000 blind sentences randomly se- lected out of the combined parallel data as the de- velopment set. We use the default parameters in Lample et al. (2018b) to find the cross-lingual embedding vec- tors. In order to create the dictionary we limit the size of the source and target (English) vocabulary 1https://github.com/tensorflow/ tensor2tensor 2https://github.com/facebookresearch/ fastText/blob/master/pretrained-vectors. md to 100K tokens. For each source token we find 20 nearest neighbors in the target language. We use a 5-gram language model trained on 4 billion tokens of Gigaword to select between the transla- tion options for each token. We use Moses scripts for tokenizing and lowercasing the data. We do not apply BPE (Sennrich et al., 2016) on the data. In order to be comparable to Kim et al. (2018) we split German compound words only for the new- stest2016 test data. We use the CharSplit3 python package for this purpose. We use tensor2tensor's transformer base hyperparameters to train the transformer model on a single gpu for each lan- guage. 4 Experiments We report translation results on newstest2013 for Spanish, newstest2014 for French, and new- stest2016 for Czech, German, Finnish, Roma- nian, and Russian. We also report results on the first 3000 sentences of GlobalVoices20154 for Dutch, Bulgarian, Danish, Indonesian, Pol- ish, Portuguese, and Catalan. In each experiment we report the quality of the intermediate Transla- tionese as well as the scores for our full model. fr-en de-en ru-en ro-en 14.3 13.3 - - 15.6 10.2 15.6 14.6 - - - - 24.2 21.0 9.1 19.4 16.5 17.2 - - Lample et al. (2018a) Artetxe et al. (2018) Yang et al. (2018) Lample et al. (2018c) (trans- former) Kim et al. (2018) Translationese 11.6 13.8 Full Model 21.0 18.7 8.1 5.7 12.0 16.3 Table 1: Comparing translation results on new- stest2014 for French, and newstest2016 for Russian, German, and Romanian with previous unsupervised NMT methods. Kim et al. (2018) is the method clos- est to our work. We report the quality of Translationese as well as the scores for our full model. We compare our results against all the exist- ing fully unsupervised neural machine translation methods in Table 1 and show better results on common test languages compared to all of them except Lample et al. (2018c) where, compared to their transformer model,5 we improve results for Russian, but not for other languages. The first four methods that we compare against are based on back-translation. These methods re- quire huge monolingual data and large training time to train a model per test language. The fifth method, which is most similar to our ap- proach (Kim et al., 2018), can be trained quickly, but still is fine tuned for each test language and performs worse than our method. Unlike the pre- vious works, our model can be trained once and applied to any test language on demand. Besides this, these methods use language-specific tricks and development data for training their models while our system is trained totally independent of the test language. We also show acceptable BLEU scores for ten other languages for which no previous unsuper- vised NMT scores exist, underscoring our ability to produce new systems rapidly (Table 2). cs-en es-en fi-en nl-en bg-en Translationese 7.4 Full Model Translationese 13.6 Full Model 18.5 12.7 3.8 22.2 7.2 16.9 10.0 13.7 22.0 16.8 da-en id-en pl-en pt-en ca-en 7.4 15.2 10.1 13.7 14.8 23.1 19.8 8.3 Table 2: Translation results on ten new languages: Czech, Spanish, Finnish, Dutch, Bulgarian, Danish, In- donesian, Polish, Portuguese, and Catalan 5 Conclusion We propose a two step pipeline for building a rapid unsupervised neural machine translation system for any language. The pipeline does not require re- training the neural translation model when adapt- ing to new source languages, which makes its application to new languages extremely fast and easy. The pipeline only requires a comprehensive source-to-target dictionary. We show how to easily obtain such a dictionary using off-the shelf tools. We use this system to translate test texts from 14 languages into English. We obtain better or com- parable quality translation results on high-resource languages than previously published unsupervised 3https://github.com/dtuggener/ CharSplit 4http://opus.nlpl.eu/GlobalVoices.php 5They present better results when combining their trans- former model with an unsupervised phrase-based translation model. MT studies, and obtain good quality results for ten other languages that have never been used in an unsupervised MT scenario. Thanh-Le Ha, Jan Niehues, and Alexander Waibel. 2017. Effective strategies in zero-shot neural ma- chine translation. arXiv preprint arXiv:1711.07893. Acknowledgements The research is based upon the work that took place in Information Sciences Institute (ISI) which was supported by the Office of the Director of Na- tional Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via AFRL Contract FA8650-17-C-9116 and by the Defense Advanced Research Projects Agency (DARPA) via contract HR0011-15-C-0115. The views and conclusions contained herein are those of the au- thors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the ODNI, IARPA, DARPA, or the U.S. Government. The U.S. Gov- ernment is authorized to reproduce and distribute reprints for Governmental purposes notwithstand- ing any copyright annotation thereon. References Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. 2018. Unsupervised neural ma- chine translation. In Proc. ICLR. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Associa- tion for Computational Linguistics, 5:135 -- 146. Yun Chen, Yang Liu, Yong Cheng, and Victor O.K. Li. 2017. A teacher-student framework for zero- resource neural machine translation. In Proc. ACL. Aria Haghighi, Percy Liang, Taylor Berg-Kirkpatrick, and Dan Klein. 2008. Learning bilingual lexicons from monolingual corpora. In Proc. ACL. Hany Hassan, Anthony Aue, Chang Chen, Vishal Chowdhary, Jonathan Clark, Christian Feder- mann, Xuedong Huang, Marcin Junczys-Dowmunt, William Lewis, Mu Li, et al. 2018. Achieving hu- man parity on automatic Chinese to English news translation. arXiv preprint arXiv:1803.05567. Ulf Hermjakob, Jonathan May, Michael Pust, and Kevin Knight. 2018. Translating a language you don't know in the Chinese room. In Proc. ACL, Sys- tem Demonstrations. Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Vi´egas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2017. Google's multilingual neural machine translation system: En- abling zero-shot translation. Transactions of the As- sociation for Computational Linguistics, 5:339 -- 351. Yunsu Kim, Jiahui Geng, and Hermann Ney. 2018. Improving unsupervised word-by-word translation with language model and denoising autoencoder. In Proc. EMNLP. Kevin Knight and Ishwar Chander. 1994. Automated postediting of documents. In Proc AAAI. Philipp Koehn. 2005. Europarl: A parallel corpus for statistical machine translation. In Proc. MT summit. Philipp Koehn and Kevin Knight. 2002. Learning a translation lexicon from monolingual corpora. In Proc. ACL workshop on Unsupervised lexical acqui- sition. Yong Cheng, Yang Liu, Qian Yang, Maosong Sun, and Wei Xu. 2016. Neural machine translation with pivot languages. arXiv preprint arXiv:1611.04928. Philipp Koehn and Rebecca Knowles. 2017. Six chal- lenges for neural machine translation. In Proc. ACL Workshop on Neural Machine Translation. Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. 2016a. Multi-way, multilingual neural machine translation with a shared attention mechanism. In Proc. NAACL. Guillaume Lample, Alexis Conneau, Ludovic Denoyer, and Marc'Aurelio Ranzato. 2018a. Unsupervised machine translation using monolingual corpora only. In Proc. ICLR. Orhan Firat, Baskaran Sankaran, Yaser Al-Onaizan, Fatos T. Yarman Vural, and Kyunghyun Cho. 2016b. Zero-resource translation with multi-lingual neural machine translation. In Proc. EMNLP. Guillaume Lample, Alexis Conneau, Marc ´Aurelio Ranzato, Ludovic Denoyer, and Herv´e J´egou. 2018b. Word translation without parallel data. In Proc. ICLR. Pascale Fung. 1995. Compiling bilingual lexicon en- tries from a non-parallel English-Chinese corpus. In Workshop on Very Large Corpora. Thanh-Le Ha, Jan Niehues, and Alexander Waibel. 2016. Toward multilingual neural machine trans- lation with universal encoder and decoder. arXiv preprint arXiv:1611.04798. Guillaume Lample, Myle Ott, Alexis Conneau, Lu- dovic Denoyer, and Marc'Aurelio Ranzato. 2018c. Phrase-based & neural unsupervised machine trans- lation. In Proc. EMNLP. Malte Nuhn, Julian Schamper, and Hermann Ney. 2013. Beam search for solving substitution ciphers. In Proc. ACL. Victor Oswald. 1952. Word-by-word translation. In Proc. intervention `a la Conf´erence du MIT. Nima Pourdamghani and Kevin Knight. 2017. Deci- phering related languages. In Proc. EMNLP. Sujith Ravi and Kevin Knight. 2011. Deciphering for- eign language. In Proc. ACL. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proc. ACL. Jorg Tiedemann. 2012. Parallel data, tools and inter- faces in OPUS. In Proc. Lrec. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Proc. NIPS. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google's neural ma- chine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144. Zhen Yang, Wei Chen, Feng Wang, and Bo Xu. 2018. Unsupervised neural machine translation with weight sharing. In Proc. ACL. Victor H. Yngve. 1955. Sentence-for-sentence transla- tion. Mechanical Translation, 2(2):29 -- 37. Hao Zheng, Yong Cheng, and Yang Liu. 2017. Maximum expected likelihood estimation for zero- resource neural machine translation. In Proc. IJCAI.
1708.08615
1
1708
2017-08-29T07:21:39
Comparing Human and Machine Errors in Conversational Speech Transcription
[ "cs.CL" ]
Recent work in automatic recognition of conversational telephone speech (CTS) has achieved accuracy levels comparable to human transcribers, although there is some debate how to precisely quantify human performance on this task, using the NIST 2000 CTS evaluation set. This raises the question what systematic differences, if any, may be found differentiating human from machine transcription errors. In this paper we approach this question by comparing the output of our most accurate CTS recognition system to that of a standard speech transcription vendor pipeline. We find that the most frequent substitution, deletion and insertion error types of both outputs show a high degree of overlap. The only notable exception is that the automatic recognizer tends to confuse filled pauses ("uh") and backchannel acknowledgments ("uhhuh"). Humans tend not to make this error, presumably due to the distinctive and opposing pragmatic functions attached to these words. Furthermore, we quantify the correlation between human and machine errors at the speaker level, and investigate the effect of speaker overlap between training and test data. Finally, we report on an informal "Turing test" asking humans to discriminate between automatic and human transcription error cases.
cs.CL
cs
Comparing Human and Machine Errors in Conversational Speech Transcription Andreas Stolcke Jasha Droppo Microsoft AI and Research, Redmond, WA, USA [email protected], [email protected] 7 1 0 2 g u A 9 2 ] L C . s c [ 1 v 5 1 6 8 0 . 8 0 7 1 : v i X r a Abstract Recent work in automatic recognition of conversational tele- phone speech (CTS) has achieved accuracy levels comparable to human transcribers, although there is some debate how to precisely quantify human performance on this task, using the NIST 2000 CTS evaluation set. This raises the question what systematic differences, if any, may be found differentiating hu- man from machine transcription errors. In this paper we ap- proach this question by comparing the output of our most accu- rate CTS recognition system to that of a standard speech tran- scription vendor pipeline. We find that the most frequent substi- tution, deletion and insertion error types of both outputs show a high degree of overlap. The only notable exception is that the automatic recognizer tends to confuse filled pauses ("uh") and backchannel acknowledgments ("uhhuh"). Humans tend not to make this error, presumably due to the distinctive and opposing pragmatic functions attached to these words. Furthermore, we quantify the correlation between human and machine errors at the speaker level, and investigate the effect of speaker overlap between training and test data. Finally, we report on an informal "Turing test" asking humans to discriminate between automatic and human transcription error cases. Index Terms: speech recognition, conversational speech, hu- man vs. computer performance. 1. Introduction Automatic speech recognition (ASR) systems have seen re- markable advances over the last half-decade from the use of deep, convolutional and recurrent neural network architectures, enabled by a combination of modeling advances, available training data, and increased computational resources. Given these advances, our research group recently embarked on an effort to reach human-level transcription accuracy using state- of-the-art ASR techniques on one of the genres of speech that has historically served as a difficult benchmark task: conver- sational telephone speech (CTS). About a decade ago, CTS recognition had served as an evaluation task for government- sponsored work in speech recognition, predating the take-over of deep learning approaches and still largely in the GMM-HMM modeling framework [1, 2, 3, 4, 5, 6]. It had proven to be a hard problem, due to the variable nature of conversational pronunciations, speaking styles, and regional accents. Seide at al. [7] demonstrated that deep networks as acoustic mod- els could achieve significant improvements over GMM-HMM models on CTS data, and more recently researchers at IBM had achieved results on this task that represented a further signifi- cant advance [8, 9] over those from a decade ago. The goal of reaching "human parity" in automatic CTS transcription raises the question of what should be considered human accuracy on this task. We operationalized the question by submitting the chosen test data to the same vendor-based transcription pipeline that is used at Microsoft for production data (for model training and internal evaluation purposes), and then comparing the results to ASR system output under the NIST scoring protocol. Using this methodology, and incorpo- rating state-of-the-art convolutional and recurrent network ar- chitectures for both acoustic modeling [10, 11, 8, 12, 13, 14, 15] and language modeling [16, 17, 18, 19] with extensive use of model combination, we obtained a machine error rate that was very slightly below that of the human transcription pro- cess (5.8% versus 5.9% on Switchboard data, and 11.0% ver- sus 11.3% on CallHome English data) [20]. Since then, Saon et al. have reported even better results, along with a separate transcription experiment that puts the human error rate, on the same test data, at a lower point than measured by us (5.1% for Switchboard, 6.8% for CallHome) [21]. In this paper, we address the question whether there are ma- jor qualitative differences between the results of human tran- scriptions of conversational speech and those obtained by ASR systems, based on a detailed analysis of the data and system output from our human parity experiment [20]. The question becomes important if ASR is to replace humans as the first step in fully automatic speech understanding systems-if ma- chine transcription errors are qualitatively different from hu- mans then we would have to worry about the possible effects on downstream processing, and mitigation techniques so as to still achieve an overall "natural" user experience (e.g., in real-time conversational speech translation, such as in the Skype applica- tion). We start by discussing why human error rate on this task must themselves be considered a moving target. Next we ask whether speech that is difficult for ASR also tends to be hard for humans to transcribe (and vice-versa), and whether the speaker overlap with the training data that is found in a portion of the test data has a noticeable effect on the result, as was suggested in [21]. We then look at the most frequent word error types exhib- ited by the two transcription systems (human and machine), and finally report on a very preliminary but still informative exper- iment to see if humans could tell apart the transcription source (again, human versus machine), based on the errors they make. 2. Measuring Human Error The assessment of human transcription error on conversational speech has been somewhat murky. A widely cited figure is 4% word error rate (WER), based on [22]. However, the ref- erence therein is only a "personal communication" without fur- ther data. The Linguistics Data Consortium quantified inter- transcriber disagreement for the NIST 2003 CTS evaluation data at between 4.1% and 4.5% with very careful multiple tran- scriptions [23]. For "quick transcription", the disagreement in- creased to 9.6%. The CTS data in the NIST study is from the Switchboard (SWB) and Fisher corpora, and is therefore com- Figure 1: Correlation between machine and human word error rates at speaker level. The solid black circles represent SWB speakers not seen in training. The solid red circles stand for secondary CH speakers that share a conversation side with a dominating primary speaker. parable to the SWB portion of our data, i.e., coming from tele- phone conversations between strangers discussing a general- interest topic. Still, the exact dataset is different, which may account for some of the discrepancy with error rates measured on the NIST 2000 set used by us (5.9%) and IBM (5.1%), al- though the numbers are remarkably close. As briefly described in the introduction, we measured hu- man performance by leveraging an existing pipeline in which Microsoft data is transcribed on a weekly basis. This pipeline uses a large commercial vendor to perform two-pass transcrip- tion. In the first pass, a transcriber works from scratch to tran- scribe the data. In the second pass, a second listener monitors the data to do error correction. Dozens of hours of test data are processed in each batch, with no special instructions to the transcribers. The waveform segments, roughly corresponding to utterances, making up the test set are processed separately. This makes the task easier since the speakers are more clearly separated, but also more difficult since the two sides of the con- versation are not interleaved and context may be missing.1 We performed that text normalization on the human transcripts to remove systematic discrepancies with the NIST scoring refer- ences. (Since this was done with some amount of trial and er- ror it effectively was "cheating" for the benefit of the human transcribers.) We then applied the NIST scoring tools to obtain word error rates of 5.9% on the SWB portion, and 11.3% on the CallHome (CH) portion of the NIST 2000 test set. The latter corpus, unlike Switchboard, consists of conversations between friends and family, without seed topic, which would account for the much higher overall error rate. Clearly our method was not designed to achieve the highest possible human transcrip- tion accuracy; instead, as pointed out in [20], our goal was to establish a benchmark corresponding to industry-standard (i.e. high-volume) professional transcript production. The authors in [21] undertook to measure human error on the same dataset, but using a more involved process. The ma- jor differences were: (1) The transcription vendor was cog- nizant of the experiment and actively involved. (2) Transcribers were chosen based on past performance and familiarized with the conventions used by LDC in generating the reference tran- 1This happens to be the way our ASR system operates since the lan- guage model currently has no context across utterances. Still, we realize this deprives humans of a potential advantage over current technology. scripts. (3) Three independent, parallel transcribers were used, plus a fourth one for 2nd-pass quality control (QC) of the 1st- pass output. All in all, the transcribers performed roughly 12 to 18 listening passes. (4) The final output was obtained by choosing the transcriber (with QC) who had obtained the low- est WER on the test data. As noted earlier, the resulting WERs were 5.1% and 6.8%, respectively. The considerably lower esti- mate for CH could be a result of the transcribers having access to the entire conversation (as per personal communication with the authors). This would be especially helpful in transcribing unfamiliar vocabulary and speaking styles (allowing the tran- scriber to "adapt" to the data more effectively). Clearly the IBM experiment made a much more thorough effort to probe the boundaries of human accuracy, and may in fact have come close to the inter-transcriber agreement previ- ously measured by LDC on a different data set. However, it is important to realize that further improvements on the human side are no doubt achievable. For example, the number of tran- scribers could be scaled up further, or they could be allowed to confer with each other, to resolve disagreements. This raises the question of where to draw the line on human effort. Finally, it is important to realize that conversational speech has a high degree of inherent ambiguity. For example, conver- sational pronunciations are highly variable and often reduced [24]. Another source of ambiguity is the lack of context and knowledge shared by the speakers (especially in the case of CH). In the presence of inherent ambiguity, inter-transcriber agreement can be improved by agreed-upon disambiguation rules, although this would not necessarily reflect true agreement based on speech understanding. 3. Machine Transcription System The details of our conversational speech recognition system are described elsewhere [20], so we only give a brief summary here. The system employs independent decodings by diverse acous- tic models, including convolutional neural net (CNN) and bidi- rectional long short-term memory (BLSTM) models that differ by model architecture, number of senones, amount of training data, and other metaparameters. Decoding uses a pruned 4- gram N-gram language model (LM) to generate lattices, which are then expanded into 500-best lists using a larger N-gram LM. The N-best lists are rescored with multiple LSTM-LMs operating in forward and backward directions. Model scores are combined log-linearly at the utterance level and converted to posterior probabilities represented as word confusion net- works. The various subsystems making up the final system are selected in a greedy search, and their weights are optimized via an expectation-maximization algorithm, on development data. The acoustic training data comprises all the publicly available CTS data (about 2000 hours), while the LMs are additionally trained on Broadcast News and Web data from U. Washington. The individual subsystems (based on different acoustic mod- els) achieve word error rates between 6.4% and 7.7% on the Switchboard evaluation set, and between 12.2% and 17.0% on the CallHome portion. Combined, the system achieves 5.8% and 11.0% WER, respectively. 4. Error Distribution and Correlation We note in passing that machine and human transcription WERs do not differ significantly according the Wilcoxon and Matched Pairs Sentence Segment Word Error tests as applied by NIST, nor do they differ according to a Sign test comparing error counts at the utterance level. A first high-level question regarding the relation between word errors by machine and human transcribers is whether dif- ficulty in one predicts difficulty in the other. Figure 1 shows scatter plots of speaker-level error rates (machine vs. human), separated by corpus. Each corpus subset has 40 conversation sides. Clearly the errors at that level are correlated, with ρ = 0.65 for SWB and ρ = 0.73 for CH. This suggests that properties of the speech, either as a function of the content, the speaker, or the channel (each speaker occurs in exactly one test conversation), cause errors for both machine and human transcription. We observe that the CH data has two speakers with out- lier machine error rates (37.5% and 64.7% WER, solid red dots in Figure 1). These correspond to secondary speakers in their respective conversation sides, each with only a fraction of the speech of the dominant speaker. Note that the ASR system pro- cesses each conversation assuming only a single speaker per side. If we remove these outliers, the machine-human error cor- relation on CH increases to ρ = 0.80. With secondary speakers excluded, we can also observe that the machine error rates clus- ter tighter than the human ones in both corpora (SWB: machine 6.1% ± 2.8 vs. human 6.2% ± 3.4; CH: machine 11.8% ± 6.1 vs. human 12.7% ± 7.0). In [21] it was sugggested that one of the reasons for the much higher error rate on CH compared to SWB was that 36 of the 40 SWB test speakers occur in the portion of the SWB corpus that is used in training (due to what we surmise to be an oversight in the selection of the NIST 2000 test set). To assess this hypothesis we singled out the four speakers in the SWB portion that are not found in the training set; these are shown as solid black circles in Figure 1. At first, it seems that the speaker-averaged WER for the "seen" speakers (machine WER 5.9%) is indeed much lower than for the speakers not found in training (7.5%). However, we can safely attribute this to bad luck and small sample size. The average machine WER of 7.5% for "unseen" speakers is well within one standard de- viation of the "seen" speakers' WER distribution (5.9% ± 2.7), and more tellingly, almost exactly the same relative difference in WERs between "seen" and "unseen" speakers is observed for human transcriptions (6.0% versus 7.7%). Clearly the human transcribers did not have the benefit of training on the "seen" Figure 2: Turing-like test challenging human players to tell ma- chine from human transcripts speakers, so the difference must be due to the intrinsic difficulty of the speakers, which affects both transcription systems. 5. Error types Tables 1–3 show the top ten types of substitutions, deletions and insertions for both ASR and human transcripts. Inspections reveals that the same short function words, discourse markers and filled pauses appear in the top ten errors for both systems. There is one notable exception, however. The top substitu- tion error for the ASR system involves misrecognition of filled pauses ("%hesitation", a word class label covering "uh" and "um" in various spellings) as backchannel acknowledgments ("%bcack", standing for "uhhuh", "mhm", etc.).2 The same substitution error is much less frequent in human transcripts. A possible explanation for this asymmetry lies in the dis- course functions of filled pauses and backchannels. Filled pauses serve to either claim or retain the floor, signaling that the speaker wants to either start or continue speaking. Backchan- nels, on the other hand, acknowledge that the speaker is listen- ing, and that the other speaker should carry on. Since the two classes of words thus have exactly opposite functions in turn management, it stands to reason that humans are keenly aware of their differences and use all available phonetic, prosodic, and contextual cues to distinguish then. Our ASR system, by contrast, uses only its standard acoustic-phonetic and language models. Modeling dialog context in particular would be ex- pected to improve this shortcoming. 6. A Turing-like Experiment Having established that human and machine transcriptions are quite similar in several aspects, including the word token types involved, we were wondering if higher-level error patterns could distinguish the two systems. For example, one might ex- pect that human misrecognitions are guided by a strong "hu- man" language and understanding model, whereas machine er- rors might be more likely to generate syntactic and semantic nonsense. To get at this question we designed a specialized ver- sion of the classic Turing test, in the sense that a human judge is asked to interact with a system with the goal of estimating whether it is underpinned by human or artificial "intelligence." In our case, the task involved inspecting one randomly chosen utterance from the test set at a time, with a side-by-side display of the reference transcript, the human transcript, and the ASR output (after the text normalizations that are part of the scoring protocol). Only utterances having at least one transcription er- 2Note that the reverse substitution cannot occur because we pro- grammatically delete filled pauses from the recognizer output, since they can only increase recognition errors under the NIST scoring proto- col. Table 1: Most common substitutions for ASR system and humans. The number of times each error occurs is followed by the word in the reference, and what appears in the hypothesis instead. CH ASR 45: (%hesitation) / %bcack 12: was / is 9: (%hesitation) / a 8: (%hesitation) / oh 8: a / the 7: and / in 7: it / that 6: in / and 5: a / to 5: aw / oh Human 12: a / the 10: (%hesitation) / a 10: was / is 7: (%hesitation) / hmm 7: bentsy / bensi 7: is / was 6: could / can 6: well / oh 5: (%hesitation) / %bcack 5: (%hesitation) / oh Table 2: Most common deletions for ASR system and humans. ASR 44: i 33: it 29: a 29: and 25: is 19: he 18: are 17: oh 17: that 17: the CH Human 73: i 59: and 48: it 47: is 45: the 41: %bcack 37: a 33: you 31: oh 30: that SWB ASR 31: it 26: i 19: a 17: that 15: you 13: and 12: have 12: oh 11: are 11: is Human 34: i 30: and 29: it 22: a 22: that 22: you 17: the 17: to 15: oh 15: yeah Table 3: Most common insertions for ASR system and humans. CH ASR 15: a 15: is 11: i 11: the 11: you 9: it 7: oh 6: and 6: in 6: know 4: they Human 10: i 9: and 8: a 8: that 8: the 7: have 5: you 4: are 4: is SWB ASR 19: i 9: and 7: of 6: do 6: is 5: but 5: yeah 4: air 4: in 4: you Human 12: i 11: and 9: you 8: is 6: they 5: do 5: have 5: it 5: yeah 4: a ror and a discrepancy between the two versions are presented. Discrepancies between the transcript versions are highlighted, and the error type (substitution, insertion, deletion) is visually coded as well, as shown in Figure 2. We ran this informal experiment during four days on the exhibitor floor of the 2017 IEEE ICASSP conference in New Orleans.3 The players were not formally recruited or charac- terized, but consisted of conference attendees who for the most part had some background or experience in speech processing. Subjects were introduced to the test by explaining the research SWB ASR 29: (%hesitation) / %bcack 9: (%hesitation) / oh 9: was / is 8: and / in 6: (%hesitation) / i 6: in / and 5: (%hesitation) / a 5: (%hesitation) / yeah 5: a / the 5: jeez / jeeze Human 12: (%hesitation) / hmm 10: (%hesitation) / oh 9: was / is 8: (%hesitation) / a 5: in / and 4: (%hesitation) / %bcack 4: and / in 4: is / was 4: that / it 4: the / a background, and were allowed to play as many trials as they wanted. Out of a total of 353 trials, subjects identified the hu- man transcript correctly 188 times, for an overall success rate of 53%. The successes included occasional gimmes like human misspellings or the asymmetry in the filled pause/backchannel substitution (which we pointed out to the subjects). According to a binomial test, this success rate does not differ signficantly from the 50% chance rate (p ≈ 0.12, one-tailed). While this re- sult is obviously quite preliminary, it was a good demonstration that it is not easy distinguishing machine from human errors, even for technically sophisticated observers. 7. Conclusions We have discussed methodological issues and reported first findings when comparing automatic conversational speech tran- scriptions to human performance, using data generated by our recent efforts to reach human parity in CTS recognition. While an exact characterization of the human benchmark remains a moving target that is subject to debate, our results so far have shown that machine transcription errors track those made by humans in several important aspects. At the speaker (as well as corpus) level the two error rates are strongly correlated, sug- gesting that common underlying factors in the speech data de- termine transcription difficulty for both humans and ASR sys- tems. (A detailed characterization of those factors has precedent in ASR research and should be revisited while also considering human performance.) A partial overlap of Switchboard train- ing and test speakers seems to have no major effect on error rates. We also find that the most frequent error patterns involve the same short function words and discourse particles for both humans and machines. The one notable exception is that ASR tends to confuse filled pauses and backchannels, a functional distinction that humans need to be very good at pragmatically. An informal Turing-like test also demonstrated that error pat- terns in the two types of transcriptions are not obviously distin- guishable. Overall, we conclude that recent advances in ASR technology have not only achieved remarkable levels of accu- racy, but also generate results that are qualitatively surprisingly similar to professional human transcriber output. 8. Acknowledgments 3The experimental setup also supports audio playback of the test utterances. However, this function was not used due to technical diffi- culties. We thank our coauthors and collaborators on the Human Parity project: X. Huang, F. Seide, M. Seltzer, W. Xiong, D. Yu, and G. Zweig. Thanks to K. Riedhammer for sharing metadata on train/test speaker overlap. [20] W. Xiong, J. Droppo, X. Huang, F. Seide, M. Seltzer, A. Stolcke, D. Yu, and G. Zweig, "Achieving human parity in conversational speech recognition", Technical Report MSR-TR-2016-71, Mi- crosoft Research, Oct. 2016, https://arxiv.org/abs/1610.05256. [21] G. Saon, G. Kurata, T. Sercu, K. Audhkhasi, S. Thomas, D. Dim- itriadis, X. Cui, B. Ramabhadran, M. Picheny, L.-L. Lim, B. Roomi, and P. Hall, "English conversational telephone speech recognition by humans and machines", arXiv:1703.02136, Mar. 2017. [22] R. P. Lippmann, "Speech recognition by machines and humans", Speech Communication, vol. 22, pp. 1–15, 1997. [23] M. L. Glenn, S. Strassel, H. Lee, K. Maeda, R. Zakhary, and X. Li, "Transcription methods for consistency, volume and efficiency", in LREC, 2010. [24] S. Greenberg, J. Hollenback, and D. Ellis, "Insights into spoken language gleaned from phonetic transcription of the switchboard corpus", in Proc. ICSLP, 1996. 9. References [1] S. F. Chen, B. Kingsbury, L. Mangu, D. Povey, G. Saon, H. Soltau, and G. Zweig, "Advances in speech transcription at IBM under IEEE Trans. Audio, Speech, and the DARPA EARS program", Language Processing, vol. 14, pp. 1596–1608, 2006. [2] S. Matsoukas, J.-L. Gauvain, G. Adda, T. Colthurst, C.-L. Kao, O. Kimball, L. Lamel, F. Lefevre, J. Z. Ma, J. Makhoul, et al., "Advances in transcription of broadcast news and conversational telephone speech within the combined ears bbn/limsi system", IEEE Transactions on Audio, Speech, and Language Processing, vol. 14, pp. 1541–1556, 2006. [3] A. Stolcke, B. Chen, H. Franco, V. R. R. Gadde, M. Graciarena, M.-Y. Hwang, K. Kirchhoff, A. Mandal, N. Morgan, X. Lei, et al., "Recent innovations in speech-to-text transcription at SRI-ICSI- UW", IEEE Transactions on Audio, Speech, and Language Pro- cessing, vol. 14, pp. 1729–1744, 2006. [4] A. Ljolje, "The AT&T 2001 LVCSR system", NIST LVCSR Workshop, 2001. [5] J.-L. Gauvain, L. Lamel, H. Schwenk, G. Adda, L. Chen, and in F. Lefevre, "Conversational telephone speech recognition", Proc. IEEE ICASSP, vol. 1, pp. I–212. IEEE, 2003. [6] G. Evermann, H. Y. Chan, M. J. F. Gales, T. Hain, X. Liu, D. Mrva, L. Wang, and P. C. Woodland, "Development of the 2003 CU-HTK conversational telephone speech transcription sys- tem", in Proc. IEEE ICASSP, vol. 1, pp. I–249. IEEE, 2004. [7] F. Seide, G. Li, and D. Yu, "Conversational speech transcription in Proc. Inter- using context-dependent deep neural networks", speech, pp. 437–440, 2011. [8] G. Saon, H.-K. J. Kuo, S. Rennie, and M. Picheny, "The IBM 2015 English conversational telephone speech recognition sys- tem", in Proc. Interspeech, pp. 3140–3144, 2015. [9] G. Saon, T. Sercu, S. J. Rennie, and H. J. Kuo, "The IBM 2016 English conversational telephone speech recognition system", in Proc. Interspeech, pp. 7–11, Sep. 2016. [10] H. Sak, A. W. Senior, and F. Beaufays, "Long short-term mem- ory recurrent neural network architectures for large scale acoustic modeling", in Proc. Interspeech, pp. 338–342, 2014. [11] H. Sak, A. Senior, K. Rao, and F. Beaufays, "Fast and accurate recurrent neural network acoustic models for speech recognition", in Proc. Interspeech, pp. 1468–1472, 2015. [12] T. Sercu, C. Puhrsch, B. Kingsbury, and Y. LeCun, "Very deep multilingual convolutional neural networks for LVCSR", in Proc. IEEE ICASSP, pp. 4955–4959. IEEE, 2016. [13] M. Bi, Y. Qian, and K. Yu, "Very deep convolutional neural net- works for LVCSR", in Proc. Interspeech, pp. 3259–3263, 2015. [14] Y. Qian, M. Bi, T. Tan, and K. Yu, "Very deep convolutional neu- IEEE/ACM ral networks for noise robust speech recognition", Trans. Audio, Speech, and Language Processing, vol. 24, pp. 2263–2276, Aug. 2016. [15] D. Yu, W. Xiong, J. Droppo, A. Stolcke, G. Ye, J. Li, and G. Zweig, "Deep convolutional neural networks with layer-wise context expansion and attention", in Proc. Interspeech, pp. 17–21, 2016. [16] T. Mikolov, M. Karafi´at, L. Burget, J. Cernock`y, and S. Khudan- pur, "Recurrent neural network based language model", in Proc. Interspeech, pp. 1045–1048, 2010. [17] T. Mikolov and G. Zweig, "Context dependent recurrent neural in Proc. Interspeech, pp. 901–904, network language model", 2012. [18] M. Sundermeyer, R. Schluter, and H. Ney, "LSTM neural net- works for language modeling", in Proc. Interspeech, pp. 194–197, 2012. [19] I. Medennikov, A. Prudnikov, and A. Zatvornitskiy, "Improving in Proc. English conversational telephone speech recognition", Interspeech, pp. 2–6, 2016.
1908.01328
1
1908
2019-08-04T12:40:28
Automatic Fact-Checking Using Context and Discourse Information
[ "cs.CL", "cs.AI" ]
We study the problem of automatic fact-checking, paying special attention to the impact of contextual and discourse information. We address two related tasks: (i) detecting check-worthy claims, and (ii) fact-checking claims. We develop supervised systems based on neural networks, kernel-based support vector machines, and combinations thereof, which make use of rich input representations in terms of discourse cues and contextual features. For the check-worthiness estimation task, we focus on political debates, and we model the target claim in the context of the full intervention of a participant and the previous and the following turns in the debate, taking into account contextual meta information. For the fact-checking task, we focus on answer verification in a community forum, and we model the veracity of the answer with respect to the entire question--answer thread in which it occurs as well as with respect to other related posts from the entire forum. We develop annotated datasets for both tasks and we run extensive experimental evaluation, confirming that both types of information ---but especially contextual features--- play an important role.
cs.CL
cs
Automatic Fact-Checking Using Context and Discourse Information PEPA ATANASOVA, Sofia University "St. Kliment Ohridski", Bulgaria PRESLAV NAKOV, Qatar Computing Research Institute, HBKU, Qatar LLUÍS MÀRQUEZ∗, Amazon, Spain ALBERTO BARRÓN-CEDEÑO, Qatar Computing Research Institute, HBKU, Qatar GEORGI KARADZHOV, Sofia University "St. Kliment Ohridski", Bulgaria TSVETOMILA MIHAYLOVA, Sofia University "St. Kliment Ohridski", Bulgaria MITRA MOHTARAMI, Massachusetts Institute of Technology, USA JAMES GLASS, Massachusetts Institute of Technology, USA We study the problem of automatic fact-checking, paying special attention to the impact of contextual and discourse information. We address two related tasks: (i) detecting check-worthy claims, and (ii) fact-checking claims. We develop supervised systems based on neural networks, kernel-based support vector machines, and combinations thereof, which make use of rich input representations in terms of discourse cues and contextual features. For the check-worthiness estimation task, we focus on political debates, and we model the target claim in the context of the full intervention of a participant and the previous and the following turns in the debate, taking into account contextual meta information. For the fact-checking task, we focus on answer verification in a community forum, and we model the veracity of the answer with respect to the entire question -- answer thread in which it occurs as well as with respect to other related posts from the entire forum. We develop annotated datasets for both tasks and we run extensive experimental evaluation, confirming that both types of information -- but especially contextual features -- play an important role. CCS Concepts: • Computing methodologies → Natural language processing; Discourse, dialogue and pragmatics; Additional Key Words and Phrases: Fact-checking, Discourse, community question-answering ACM Reference Format: Pepa Atanasova, Preslav Nakov, Lluís Màrquez∗, Alberto Barrón-Cedeño, Georgi Karadzhov, Tsvetomila Mihaylova, Mitra Mohtarami, and James Glass. 2019. Automatic Fact-Checking Using Context and Discourse Information. ACM J. Data Inform. Quality 11, 3, Article 12 (May 2019), 25 pages. https://doi.org/3331015.3297722 ∗ Work conducted while this author was at QCRI, HBKU. Authors' addresses: Pepa Atanasova, Sofia University "St. Kliment Ohridski", 5, James Bourchier Blvd., 1164, Sofia, Bulgaria, [email protected]; Preslav Nakov, Qatar Computing Research Institute, HBKU, HBKU Research Complex B1, P.O. Box 5825, Doha, Qatar, [email protected]; Lluís Màrquez∗, Amazon, Barcelona, Spain, [email protected]; Alberto Barrón-Cedeño, Qatar Computing Research Institute, HBKU, HBKU Research Complex B1, P.O. Box 5825, Doha, Qatar, albarron@[hbku.edu.qagmail.com]; Georgi Karadzhov, Sofia University "St. Kliment Ohridski", 5, James Bourchier Blvd., 1164, Sofia, Bulgaria, [email protected]; Tsvetomila Mihaylova, Sofia University "St. Kliment Ohridski", 5, James Bourchier Blvd., 11641, Sofia, Bulgaria, [email protected]; Mitra Mohtarami, Massachusetts Institute of Technology, MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, MA, USA, [email protected]; James Glass, Massachusetts Institute of Technology, MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, MA, USA, [email protected]. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. © 2019 Association for Computing Machinery. Manuscript submitted to ACM Manuscript submitted to ACM 1 2 Atanasova et al. 1 INTRODUCTION Recent years have seen the proliferation of deceptive information online. With the increasing necessity to validate information from the Internet, automatic fact-checking has emerged as an important research topic. Fact-checking is at the core of multiple applications, e.g., discovery of fake news [Lazer et al. 2018], rumor detection in social media [Vosoughi et al. 2018], information verification in question answering systems [Mihaylova et al. 2018], detection of information manipulation agents [Chen et al. 2013; Darwish et al. 2017; Mihaylov et al. 2015b], and assistive technologies for investigative journalism [Hassan et al. 2015]. It touches many aspects, such as credibility of users and sources, information veracity, information verification, and linguistic aspects of deceptive language. There has been work on automatic claim identification [Hassan et al. 2015, 2016], and also on checking the factuality/credibility of a claim, of a news article, or of an information source [Ba et al. 2016; Castillo et al. 2011; Hardalov et al. 2016; Karadzhov et al. 2017a,b; Ma et al. 2016; Nakov et al. 2017b; Rashkin et al. 2017; Zubiaga et al. 2016]. In general, previous work has not paid much attention to explicitly modeling contextual information and linguistic properties of the discourse in order to identify and verify claims, with some rare recent exceptions [Gencheva et al. 2017; Popat et al. 2017]. In this article, we focus on studying the role of contextual information and discourse, which provide important information that is typically not included in the usual feature sets, which are mostly based on properties of the target claim, and its similarity to a set of validation documents or snippets. In particular, we focus on the following tasks: Check-worthy claim identification. We address the automatic identification of claims in political debates which a journalist should fact-check. In this case, the text is dialog-style: with long turns by the candidates and orchestrated by a moderator around particular topics. Journalists had to challenge the veracity of claims in the 2016 US presidential campaign, and this was particularly challenging during the debates as a journalist had to prioritize which claims to fact-check first. Thus, we developed a model that ranks the claims by their check-worthiness. Answers fact-checking. We address the automatic verification of answers in community-driven Web forums (e.g., Quora, StackOverflow). The text is thread-style, but is subject to potential dialogues: a user posts a question and others post po- tential answers. That is, the answers are verified in the context of discussion threads in a forum and are also interpreted in the context of an initial question. Here we deal with social media content. The text is noisier and the information being shared is not always factual; mainly due to misunderstanding, ignorance, or maliciousness of the responder. We run extensive experiments for both tasks by training and applying classifiers based on neural networks, kernel- based support vector machines, and combinations thereof. The results confirm that the contextual and the discourse information are crucial to boost the models and to achieve state-of-the-art results for both tasks.1 In the former task, using context yields 4.2 MAP points of absolute improvement, while using discourse information adds 1.5 MAP absolute points; in the latter task, considering the discourse and the contextual information improves the performance by a total of 4.5 MAP absolute points. The rest of this article is organized as follows: Section 2 describes our supervised approach to predicting the check- worthiness of text fragments with focus on political debates. Section 3 presents our approach to verifying the factuality of the answers in a community question answering forum. Section 4 provides a more qualitative analysis of the outcome of all our experiments. Section 5 discusses related work. Finally, Section 6 presents the conclusions and the lessons learned, and further outlines some possible directions for future research. 1We make available the datasets and source code for both tasks: https://github.com/pgencheva/claim-rank and https://github.com/qcri/QLFactChecking Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 3 Medium ABC News Chicago Tribune CNN FactCheck.org NPR PolitiFact The Guardian The New York Times The Washington Post Total annotations Annotated sentences 1st 35 30 46 15 99 74 27 26 26 378 218 2nd VP 29 31 37 47 91 60 54 46 33 428 183 50 29 30 45 92 62 39 25 19 391 235 3rd Total 142 28 128 38 60 173 167 60 371 89 253 57 192 72 52 149 95 17 1,670 473 244 880 Table 1. Number of annotations in each medium for the 1st, 2nd and 3rd presidential and the vice-presidential debates. The last row shows the number of annotated sentences that become the positive examples in the CW-USPD-2016 dataset. 2 CLAIM IDENTIFICATION In this section, we focus on the problem of automatically identifying which claims in a given document are most check-worthy and thus should be prioritized for fact-checking. We focus on how contextual and discourse information can help in this task. We further study how to learn from multiple sources simultaneously (e.g., PolitiFact, FactCheck, ABC), with the objective of mimicking the selection strategies of one particular target source; we do this in a multi-task learning setup. 2.1 Data We used the CW-USPD-2016 dataset, which is centered around political debates [Gencheva et al. 2017]. It contains four transcripts of the 2016 US Presidential election debates: one vice-presidential and three presidential. Each debate is annotated at the sentence level as check-worthy or not, but the sentences are kept in the context of the full debate, including metadata about the speaker, speaker turns, and system messages about the public reaction. The annotations were derived using publicly-available manual analysis of these debates by nine reputable fact-checking sources, shown in Table 1. This analysis was converted into a binary annotation: whether a particular sentence was annotated for factuality by a given source. Whenever one or more annotations were about part of a sentence, the entire sentence was selected, and when an annotation spanned over multiple sentences, each of them was selected. The dataset with the four debates contains 5,415 sentences, out of which 880 are positive examples (i.e., selected for fact-checking by at least one of the sources). Table 2 presents an excerpt of this corpus. Note that the investigative journalists did not select the check-worthy claims in isolation, ignoring the context. Our analysis shows that these include claims that were highly disputed during the debate, that were relevant to the topic introduced by the moderator, etc. We will make use of these contextual dependencies below. 2.2 Modeling Context and Discourse We developed a rich input representation in order to model and to predict the check-worthiness of a sentence. In particular, we included a variety of contextual and discourse-based features. They characterize the sentence in the context of the full segment by the same speaker, sometimes also looking at the previous and the following segments. We define a segment as a maximal set of consecutive sentences by the same speaker, without intervention by another speaker or the moderator, i.e., a turn. We start by describing these context-based features, which are the focus of attention of this work. Manuscript submitted to ACM 4 Speaker Text Clinton: Clinton: So we're now on the precipice of having a potentially much better economy, but the last thing we need to do is to go back to the policies that failed us in the first place. Independent experts have looked at what I've proposed and looked at what Donald's proposed, and basically they've said this, that if his tax plan, which would blow up the debt by over $5 trillion and would in some in- stances disadvantage middle-class families compared to the wealthy, were to go into effect, we would lose 3.5 million jobs and maybe have another recession. Clinton: They've looked at my plans and they've said, OK, if we can do this, and I intend to get it done, we will have 10 million more new jobs, because we will be making investments where we can grow the economy. Clinton: Take clean energy. Clinton: Some country is going to be the clean- energy super- Clinton: Trump: by the Chinese. I think it's real. I did not. power of the 21st century. Clinton: Donald thinks that climate change is a hoax perpetrated Atanasova et al. Annotation Sources CT ABC CNN WP NPR PF TG NYT FC All Check? 0 No 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 1 1 6 Yes 1 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 Yes 0 0 1 0 0 0 0 6 0 5 No No Yes No Yes Table 2. Excerpt from the transcript of the first US Presidential Debate in 2016, annotated by nine sources: Chicago Tribune (CT), ABC News, CNN, Washington Post (WP), NPR, PolitiFact (PF), The Guardian (TG), The New York Times (NYT) and Factcheck.org (FC). Whether the media fact-checked the claim or not is indicated by a 1 or 0, respectively. The total number of sources that annotated an example is shown in column "All". Column "Check?" indicates the class label, i.e., whether the example is check-worthy or not. The positive examples are also highlighted in blue. 2.2.1 Position ( 3 features). A sentence on the boundaries of a speaker's segment could contain a reaction to another statement or could provoke a reaction, which in turn could signal a check-worthy claim. Thus, we added information about the position of the target sentence in its segment: whether it is first/last, as well as its reciprocal rank in the list of sentences in that segment. 2.2.2 Segment sizes ( 3 features). The size of the segment belonging to one speaker might indicate whether the target sentence is part of a long speech, makes a short comment or is in the middle of a discussion with lots of interruptions. The size of the previous and of the next segments is also important in modeling the dialogue flow. Thus, we include three features with the size of the previous, the current, and the next segments. 2.2.3 Metadata ( 8 features). Check-worthy claims often contain accusations about the opponents, as the example below shows (from the 2nd presidential debate): Trump: Hillary Clinton attacked those same women and attacked them viciously. ... Clinton: They're doing it to try to influence the election for Donald Trump. Thus, we use a feature that indicates whether the target sentence mentions the name of the opponent, whether the speaker is the moderator, and also who is speaking (3 features). We further use three binary features, indicating whether the target sentence is followed by a system message: applause, laugh, or cross-talk. Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 5 2.2.4 Topics ( 303 features). Some topics are more likely to be associated with check-worthy claims, and thus we have features modeling the topics in the target sentence as well as in the surrounding context. We trained a Latent Dirichlet Allocation (LDA) topic model [Blei et al. 2003] on all political speeches and debates in The American Presidency Project2 using all US presidential debates in the 2007 -- 2016 period3. We had 300 topics, and we used the distribution over the topics as a representation for the target sentence. We further modeled the context using cosines with such representations for the previous, the current, and the next segment. 2.2.5 Embeddings ( 303 features). We also modeled semantics using word embeddings. We used the pre-trained 300-dimensional Google News word embeddings by Mikolov et al. [2013a] to compute an average embedding vector for the target sentence, and we used the 300 dimensions of that vector. We also modeled the context as the cosine between that vector and the vectors for three segments: the previous, the current, and the following one. 2.2.6 Contradictions. (5 features) Many claims selected for fact-checking contain contradictions to what has been said earlier, as in the example below (from the 3rd presidential debate): Clinton: Trump: [...] about a potential nuclear competition in Asia, you said, you know, go ahead, enjoy yourselves, folks. I didn't say nuclear. We model this by counting the negations in the target sentence as found in a dictionary of negation cues such as not, didn't, and never. We further model the context as the number of such cues in the two neighboring sentences from the same segment and the two neighboring segments. 2.2.7 Similarity of the sentence to known positive/negative examples ( 3 features). We used three more features that measure the similarity of the target sentence to other known examples. The first one computes the maximum over the training sentences of the number of matching words between the target and the training sentence, which is further multiplied by -1 if the latter was not check-worthy. We also used another version of the feature, where we multiplied it by 0 if the speakers were different. A third version took as a training set all claims checked by PolitiFact4 (excluding the target sentence). 2.2.8 Discourse ( 20 features). We saw above that contradiction can signal the presence of check-worthy claims and contradiction can be expressed by a discourse relation such as Contrast. As other discourse relations such as Background, Cause, and Elaboration can also be useful, we used a discourse parser [Joty et al. 2015] to parse the entire segment. This parser follows the Rhetorical Structure Theory (RST). It produces a hierarchical representation of the discourse by linking first the elementary discourse units with binary discourse relations (indicating also which unit is the nucleus and which is the satellite), and building up the tree by connecting with the same type of discourse relations the more general cross-sentence nodes until a root node covers all the text. From this tree, we focused on the direct relationship between the target sentence and the other sentences in its segment; this gave rise to 18 contextual indicator features. We further analyzed the internal structure of the target sentence -- how many nuclei and how many satellites it contains -- , which gave rise to two sentence-level features. 2http://www.presidency.ucsb.edu/debates.php 3https://github.com/paigecm/2016-campaign 4http://www.politifact.com/ Manuscript submitted to ACM 6 Bias Type Factives Implicatives Assertives Hedges Report-verbs Wiki-bias Sample Cues realize, know, discover, learn cause, manage, hesitate, neglect think, believe, imagine, guarantee approximately, estimate, essentially argue, admit, confirm, express capture, create, demand, follow Bias Type Modals Negations Strong-subj Weak-subj Positives Negatives Atanasova et al. Sample Cues can, must, will, shall neither, without, against, never, none admire, afraid, agreeably, apologist abandon, adaptive, champ, consume accurate, achievements, affirm abnormal, bankrupt, cheat, conflicts Table 3. Some cues for various bias types. 2.3 Other Features 2.3.1 ClaimBuster-based ( 1,045 core features). In order to be able to compare our model and features directly to the previous state of the art, we re-implemented, to the best of our ability, the sentence-level features of ClaimBuster [Hassan et al. 2015], namely TF-IDF-weighted bag of words (998 features), part-of-speech tags (25 features), named entities as recognized by Alchemy API5 (20 features), sentiment score from Alchemy API (1 feature), and number of tokens in the target sentence (1 feature). Apart from providing means of comparison to the state of the art, these features also make a solid contribution to our final system for check-worthiness estimation. However, note that we did not have access to the training data of ClaimBuster, which is not publicly available, and we thus train on our own dataset. 2.3.2 Sentiment ( 2 features). Some sentences are highly negative, which can signal the presence of an interesting claim to check, as the two following example sentences show (from the 1st and the 2nd presidential debates): Trump: Murders are up. Clinton: Bullying is up. We used the NRC sentiment lexicon [Mohammad and Turney 2013] as a source of words and n-grams with posi- tive/negative sentiment, and we counted the number of positive and of negative words in the target sentence. These features are different from those in ClaimBuster, where these lexicons were not used. 2.3.3 Named entities (NE) ( 1 feature). Sentences that contain named entity mentions are more likely to contain a claim that is worth fact-checking as they discuss particular people, organizations, and locations. Thus, we have a feature that counts the number of named entities in the target sentence; we use the NLTK toolkit for named entity recognition [Loper and Bird 2002]. Unlike the ClaimBuster features above, here we only have one feature; we also use a different toolkit for named entity recognition. 2.3.4 Linguistic features (13 features). We use as features the presence and the frequency of occurrence of linguistic markers such as factives and assertives from [Hooper 1974], implicatives from [Karttunen 1971], hedges from [Hyland 2005], Wiki-bias terms from [Recasens et al. 2013], subjectivity cues from [Riloff and Wiebe 2003], and sentiment cues from [Liu et al. 2005].6 We compute a feature vector according to Equation (1) where for each bias type Bi and answer Aj, the frequency of the cues for Bi in Aj is computed and then normalized by the total number of words in Aj: (1)   cue∈Bi wk ∈Aj Bi(Aj) = count(cue, Aj) count(wk , Aj) 5http://www.ibm.com/watson/alchemy-api.html 6Most of these bias cues can be found at http://people.mpi-sws.org/~cristian/Biased_language.html Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 7 Below we describe these cues in more detail. • Factives (1 feature) [Hooper 1974] are verbs that imply the veracity of their complement clause. In E1, know suggests that "they will open a second school ..." and "they provide a qualified french education ..." are factually true statements. E1: know that they will open a second school; and they are a nice french school...I know that they provide a qualified french education and add with that the history and arabic language to be adapted to the qatar. I think that's an interesting addition. • Assertives (1 feature) [Hooper 1974] are verbs that imply the veracity of their complement clause with a level of certainty. E.g., in E1, think indicates some uncertainty, while verbs like claim cast doubt on the certainty of their complement clause. • Implicatives (1 feature) [Karttunen 1971] are verbs that imply the (un)truthfulness of their complement clause, e.g., decline and succeed. • Hedges (1 feature) [Hyland 2005] reduce the person's commitment to the truth, e.g., may and possibly. • Reporting verbs (1 feature) are used to report a statement from a source, e.g., argue and express. • Wiki-bias cues (1 feature) [Recasens et al. 2013] are extracted from the NPOV corpus from Wikipedia and cover bias cues (e.g., provide in E1), and controversial words, such as abortion and execute. These words are not available in neither of the other bias lexicons. • Modals (1 feature) are used to change the certainty of the statement (e.g., will or can), make an offer (e.g., shall), ask permission (e.g., may), or express an obligation or necessity (e.g., must). • Negations (1 feature) are used to deny or make negative statements such as no, never. • Subjectivity cues (2 features) [Riloff and Wiebe 2003] are used when expressing personal opinions and feelings. There are strong and weak cues, e.g., in E1, nice and interesting are strong, while qualified is weak. • Sentiment cues (2 features). We use positive and negatives sentiment cues [Liu et al. 2005] to model the attitude, thought, and emotions of the speaker. In E1, nice, interesting and qualified are positive cues. The above bias and subjectivity cues are mostly single words. Sometimes a multi-word cue (e.g., "we can guarantee") can be a stronger signal for user's certainty/uncertainty in their answers. We thus further generate multi-word cues (1 feature) by combining implicative, assertive, factive and report verbs with first person pronouns (I/we), modals and strong subjective adverbs, e.g., I/we+verb (e.g. "I believe"), I/we+adverb+verb (e.g., "I certainly know"), I/we+modal+verb (e.g., "we could figure out") and I/we+modal+adverb+verb (e.g., "we can obviously see"). 2.3.5 Tense ( 1 feature). Most of the check-worthy claims mention past events. In order to detect when the speaker is making a reference to the past or is talking about his/her future vision and plans, we include a feature with three values -- indicating whether the text is in past, present or future tense. The feature is extracted in a simplified fashion from the verbal expressions, using POS tags and a list of auxiliary phrases. In particular, we consider a sentence to be in the past tense if it contains a past verb (VBD), and in the future tense if it contains will or have to; otherwise, we assume it to be in the present tense. 2.3.6 Length ( 1 feature). Shorter sentences are generally less likely to contain a check-worthy claim.7 Thus, we have a feature for the length of the sentence in terms of characters. Note that this feature was not part of the ClaimBuster features, as there length was modeled in terms of tokens, but here we do so using characters. 7One notable exception are short sentences with negations, e.g., Wrong., Nonsense., etc. Manuscript submitted to ACM 8 Atanasova et al. MAP Our System 0.427 All features All \ discourse 0.412 All \ context 0.385 Only context+discourse 0.317 Reference systems 0.164 Random 0.314 TF-IDF Claimbuster -- Platform 0.317 0.357 Claimbuster -- Features R-Pr 0.432 0.431 0.390 0.404 0.007 0.333 0.349 0.379 P@5 0.800 0.800 0.550 0.725 0.200 0.550 0.500 0.500 P@10 0.725 0.700 0.500 0.563 0.125 0.475 0.550 0.550 P@20 0.713 0.685 0.550 0.465 0.138 0.413 0.488 0.550 P@50 0.600 0.550 0.540 0.465 0.160 0.360 0.405 0.510 Table 4. Overall results for check-worthy claims identification, focusing on the impact of the contextual and discourse features. 2.4 Experiments Learning Algorithm. We used a feed-forward neural network (FNN) with two hidden layers (with 200 and 50 neurons, respectively) and a softmax output unit for the binary classification.8 We used ReLU [Glorot et al. 2011] as the activation function and we trained the network with Stochastic Gradient Descent [LeCun et al. 1998] for 300 epochs with a batch size of 550. We set the L2 regularization to 0.0001, and we kept a constant learning rate of 0.04. We further enhanced the learning process by using a Nesterov's momentum [Sutskever et al. 2013] of 0.9. Setting. We trained the models to classify sentences as positive if one or more media had fact-checked a claim inside the target sentence, and negative otherwise. We then used the classifier scores to rank the sentences with respect to check-worthiness.9 We tuned the parameters and we evaluated the performance using 4-fold cross-validation, using each of the four debates in turn for testing while training on the remaining three. Implementation Details. We used gensim [Řehůřek and Sojka 2010] for LDA and word embeddings, NLTK [Loper and Bird 2002] for NER and POS tagging, and scikit-learn [Buitinck et al. 2013] for deep learning. Evaluation. We use ranking measures such as Precision at k (P@k) and Mean Average Precision (MAP). As Table 1 shows, most media rarely check more than 50 claims per debate, which means that there is no need to fact-check more than 50 sentences. Thus, we report P@k for k ∈ {5, 10, 20, 50}.10 MAP is the mean of the Average Precision across the four debates. Finally, we also measure the recall at the R-th position of returned sentences for each debate, where R is the number of relevant documents for that debate and the metric is known as R-Precision (R-Pr). As with MAP, we provide the average across the 4 debates. Results. Table 4 shows all the results of our claim ranking system with several feature variants. In order to put the numbers in perspective, we also show the results for four increasingly competitive baselines ('Reference Systems'). The first one is a random baseline. It is then followed by an SVM classifier based on a bag-of-words representation with TF- IDF weights estimated on the training data. Then come two versions of the ClaimBuster system: Claimbuster -- Platform refers to the performance of ClaimBuster using the scores obtained from their online demo,11 which we accessed on December 20, 2016, and Claimbuster -- Features is our re-implementations of ClaimBuster using our FNN classifiers trained on our dataset with their features. 8Previous work [Gencheva et al. 2017] showed that the neural network performs better on the task than support vector machine classifiers. 9We also tried using ordinal regression, and SVM-perf (an instantiation of SVM-struct), to directly optimize precision, but they performed worse. 10Note that as far as the difference between the P@k metrics (especially between 5 and 10) is in terms of a few sentences, the deviation between them can seem large, while caused by a few correctly/wrongly classified sentences. 11http://idir-server2.uta.edu/claimbuster/demo Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 9 We can see that our system with all features outperforms all reference systems by a large margin for all metrics. The two versions of ClaimBuster also outperform the TF-IDF baseline on most measures. Moreover, our re-implementation of ClaimBuster is better than the online platform, especially in terms of MAP. This is expected as their system is trained on a different dataset and it may suffer from testing on slightly out-of-domain data. Our advantage with respect to ClaimBuster implies that the extra information coded in our model, mainly more contextual, structural, and linguistic features, has an important contribution to the final performance. Rows 2 -- 4 in Table 4 show the effect of the discourse and of the contextual features implemented in our system. The contextual features have a major impact on performance: excluding them yields major drop for all measures, e.g., MAP drops from 0.427 to 0.385, and P@5 drops from 0.800 to 0.550. The discourse features also have an impact, although it is smaller. The most noticeable difference is in the quality at the lower positions in the rank, e.g., P@5 does not vary when removing discourse features, but P@10, P@20 and P@50 all drop by 2.5 to 5 percent points. Finally, row 4 in the table shows that contextual+discourse features alone already yield a competitive system, performing about the same as Claimbuster -- Platform (which uses no contextual features at all). In Section 4, we will present a further qualitative description of the results including some examples. 2.5 Multi-task Learning Experiments Unlike the above single-source approaches, in this subsection, we explore a multi-source neural network framework, in which we try to predict the selections of each and every fact-checking organization simultaneously. We show that, even when the goal is to mimic the selection strategy of one particular fact-checking organization, it is beneficial to leverage on the selection choices by multiple such organizations. Setting. We approach the task of check-worthiness prediction using the same features, while at the same time modeling the problem as multi-task learning, using different sources of annotation over the same training dataset. As a result, we can learn to mimic the selection strategy of each and every of these individual sources. As we have explained above, in our dataset the individual judgments come from nine independent fact-checking organizations, and we thus predict the selection choices of each of them in isolation plus a collective label ANY, which indicates whether at least one source would judge that claim as check-worthy. Architecture. Figure 1 illustrates the architecture of the full neural multi-source learning model, which predicts the selection choices of each of the nine individual sources (tasks) and of the special cumulative source: task ANY. There is a hidden layer (of size 300) that is shared between all ten tasks. Then, each task has its own task-specific hidden layer (each of size 300). Finally, each task-specific layer is followed by an output layer: a single sigmoid unit that provides the prediction of whether the utterance was fact-checked by the corresponding source. Eventually, we make use of the probability of the prediction to prioritize claims for fact-checking. During training, each task modifies the weights of both its own task-specific layer and of the shared layer. For our neural network architecture, we used ReLU units, Stochastic Gradient Descent with Nesterov momentum of 0.7, iterating for 100 epochs with batches of size 500 and a learning rate of 0.08. This kind of neural network architecture for multi-task learning is known in the literature as hard parameter sharing [Caruana 1993], and it can greatly reduce the risk of overfitting. In particular, it has been shown that the risk of overfitting the shared parameters in the hidden layer is an order n smaller than overfitting the task-specific parameters in the output layers, where n is the number of tasks at hand [Baxter 1997]. The input to our neural network consists of the various domain-specific features that have been previously described. Manuscript submitted to ACM 10 Atanasova et al. Fig. 1. The architecture of the full neural multi-source learning model, predicting the selection choices of each of the nine individual sources (tasks) and of one cumulative source: task ANY. Implementation Details. We implemented the neural network using Keras. We tried adding more shared and task- specific layers as well as having some task-specific layers linked directly to the input, but we eventually settled on the architecture in Figure 1. We also tried to optimize directly for average precision and adding loss weights to task ANY, but using the standard binary cross-entropy loss yielded the best results. Results. As before, we perform 4-fold cross-validation, where each time we leave one debate out for testing. Moreover, in order to stabilize the results, we repeat each experiment three times with different random seeds, and we report the average over these three reruns.12 We should note that in most cases this was not really needed, as the standard deviation for the reruns was generally tiny: 0.001 or less, absolute. Table 5 presents the results, with all evaluation metrics, when predicting each of the nine sources. We experiment with three different configurations of the model described in the previous section. All of them aim at learning to mimic the selection choices by one single fact-checking organization (source). The first one is a single-task baseline singleton where a separate neural network is trained for each source. The other two are multi-task learning configurations: multi trains to predict labels for each of the nine tasks, one for each fact-checker; and multi+any trains to predict labels for each of the nine tasks (one for each fact-checker), and also for task ANY (as shown in Figure 1). We can see in Table 5 that, for most of the sources, multi-task learning improves over the single-source system. The results of the multi-task variations that improve over the single baseline are boldfaced in the table. The improvements are consistent across evaluation metrics and vary largely depending on the source and the metric. One notable exception is NYT, for which the single-task learning shows the highest scores. We hypothesize that the network has found some distinctive features of NYT, which make it easy to predict. These relations are blurred when we try to optimize for multiple tasks at once. However, it is important to state that removing NYT from the learning targets worsens the results for the other sources, i.e., it carries some important relations that are worth modeling. 12Having multiple reruns is a standard procedure to stabilize an optimization algorithm that is sensitive to the random seed, e.g., this strategy has been argued for when using MERT for tuning hyper-parameters in Statistical Machine Translation [Foster and Kuhn 2009]. Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 11 Model MAP R-Pr P@5 P@10 P@20 P@50 Model MAP R-Pr P@5 P@10 P@20 P@50 ABC 0.100 0.097 0.112 0.250 singleton 0.119 0.157 0.333 0.225 0.217 0.122 multi multi+any 0.118 0.160 0.300 0.233 0.229 0.132 0.175 0.162 The Washington Post (WP) 0.110 0.106 0.110 0.150 singleton 0.127 0.127 0.350 0.233 0.162 0.123 multi multi+any 0.130 0.129 0.350 0.250 0.171 0.110 0.100 0.112 CNN 0.090 0.087 0.091 0.250 singleton 0.113 0.132 0.250 0.208 0.183 0.140 multi multi+any 0.109 0.126 0.167 0.200 0.167 0.128 0.150 0.121 FactCheck (FC) 0.084 0.114 0.117 0.100 singleton 0.105 0.136 0.250 0.175 0.146 0.118 multi multi+any 0.117 0.110 0.333 0.242 0.196 0.107 0.125 0.088 NPR singleton multi multi+any 0.180 0.207 0.333 0.283 0.228 0.175 0.195 0.250 0.186 0.210 0.333 0.342 0.300 0.245 0.227 0.250 0.283 0.250 The Guardian (TG) singleton multi multi+any 0.130 0.159 0.217 0.175 0.200 0.178 0.127 0.174 0.200 0.133 0.199 0.183 0.175 0.192 0.193 0.167 0.150 0.196 Chicago Tribune (CT) 0.079 0.110 0.100 0.100 singleton 0.081 0.090 0.100 0.133 multi multi+any 0.087 0.087 0.133 0.100 0.125 0.075 0.104 0.082 0.108 0.093 The New York Times (NYT) 0.187 0.221 0.350 singleton 0.150 0.213 0.233 multi multi+any 0.147 0.197 0.200 0.325 0.200 0.167 0.238 0.196 0.158 0.192 0.180 0.162 PolitiFact 0.201 0.278 0.250 0.262 singleton 0.209 0.258 0.400 0.367 0.317 0.270 multi multi+any 0.210 0.252 0.500 0.350 0.333 0.272 0.250 0.262 Table 5. Evaluation results for each of the nine fact-checking organizations as a target to mimic. Shown are results for single-source baselines and for multi-task learning. The improvements over the corresponding baselines are marked in bold. MAP R-Pr P@5 P@10 P@20 P@50 Model 0.117 0.090 0.138 0.144 CB online 0.120 0.142 0.228 0.137 singletonG 0.153 0.128 0.225 0.194 any 0.072 singleton (embed.) 0.058 0.065 0.055 0.079 0.072 0.077 0.106 singleton CB 0.127 0.156 0.213 0.148 singleton 0.136 0.169 0.270 0.229 0.202 0.164 multi 0.136 0.159 0.281 0.222 0.201 0.155 multi+any 0.125 0.153 0.204 0.153 any 0.130 0.153 0.237 0.220 0.184 0.148 singleton+any 0.143 0.206 0.186 0.055 0.076 0.181 0.121 0.179 0.178 0.068 0.081 0.176 0.175 0.197 Table 6. Evaluation results averaged over nine fact-checking organizations. The improvements over singleton are in bold. The first three rows of Table 6 present the same results but averaged over the nine sources. Again, we can see that multi-task learning yields sizable improvement over the single-task learning baseline for all evaluation measures. Another conclusion that can be drawn is that including the task any does not help to improve the multi-task model. This is probably due to the fact that this information is already contained in the multi-task model with nine distinct sources only. The last two rows in Table 6 present two additional variants of the model: the single-task learning any system, which is trained on the union of the selected sentences by all nine fact-checkers to predict the target fact-checker only; and the system singleton+any that predicts labels for two tasks: (i) for the target fact-checker, and (ii) for task ANY. Manuscript submitted to ACM 12 Atanasova et al. q: If wife is under her husband's sponsorship and is willing to come Qatar on visit, how long she can stay after extending the visa every month? I have heard it's not possible to extend visit visa more than 6 months? ... a1: Maximum period is 9 Months.... a2: 6 months maximum a3: This has been answered in QL so many times. Please do search for information regarding this. BTW answer is 6 months. Fig. 2. Example from the Qatar Living forum. We can see that the model any performs comparably to the singleton baseline, thus being clearly inferior than the multi-task learning variants. Finally, singleton+any is also better than the single-task learning variants, but it falls short compared to the other multi-task learning variants. Including output units for all nine individual media seems crucial for getting advantage of the multi-task learning, i.e., considering only an extra output prediction node for task ANY is not enough. 3 FACT-CHECKING With the ever growing amount of unreliable content online, veracity will almost certainly become an important component of question answering systems in the future. In this section, we focus on fact-checking in the context of community question answering (cQA), i.e., predicting whether an answer to a given question is likely to be true. This aspect has been ignored, e.g., in recent cQA tasks at NTCIR and SemEval [Ishikawa et al. 2010; Nakov et al. 2017a, 2015, 2016], where an answer is considered as Good if it tries to address the question, irrespective of its veracity. Yet, veracity is an important aspect, as high-quality automatic fact-checking can offer a better experience to the users of cQA systems; e.g., a possible application scenario would be that in which the user could be presented with a ranking of all good answers accompanied by veracity scores, where low scores would warn her not to completely trust the answer or to double-check it. Figure 2 presents an excerpt of an example from the Qatar Living forum, with one question (q) and three plausible answers (a1 − a3) selected from a longer thread. According to the SemEval-2016 Task 3 annotation instructions [Nakov et al. 2016], all three answers are considered Good since they address the question. Nevertheless, a1 contains false information, while a2 and a3 are true,13 as can be checked on an official governmental website.14 3.1 Data We use the CQA-QL-FACT dataset, which stresses the difference between (a) distinguishing a good vs. a bad answer, and (b) distinguishing between a factually true vs. a factually false one. We added the factuality annotations on top of the CQA-QL-2016 dataset from the SemEval-2016 Task 3 on community Question Answering [Nakov et al. 2016]. In CQA-QL-2016, the data is organized in question -- answer threads extracted from the Qatar Living forum. Each question has a subject, a body, and metadata: ID, category (e.g., Computers and Internet, Education, and Moving to Qatar), date and time of posting, and user name. 13One could also guess that answers a2 and a3 are more likely to be true from the fact that the 6 months answer fragment appears many times in the current thread (it also happens to appear more often in related threads as well). While these observations serve as the basis for useful features for classification, the real verification for a gold standard annotation requires finding support from a reliable external information source: in this case, an official government information portal. 14https://www.moi.gov.qa/site/english/departments/PassportDept/news/2011/01/03/23385.html Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 13 Example #Questions Label Factual Opinion Socializing Table 7. Distribution of factuality labels in the annotated questions (1,357 in total). 373 What is Ooredoo customer service number? 689 Can anyone recommend a good Vet in Doha? 295 What was your first car? First, we annotated the questions using the following labels: • Factual: The question is asking for factual information, which can be answered by checking various information sources, and it is not ambiguous. • Opinion: The question asks for an opinion or an advice, not for a fact. • Socializing: Not a real question, but rather socializing/chatting. This can also mean expressing an opinion or sharing some information without really asking anything of general interest. We annotated 1,982 questions, with the above factuality labels. We ended up with 625 instances that contain multiple questions, which we excluded from further analysis. Table 7 shows the annotation results for the remaining 1,357 questions, including examples. Next, we annotated for veracity the answers to the factual questions. We only annotated the originally judged as Good answers (ignoring both Bad and Potentially Useful ), and we used the following labels: • Factual - True: The answer is True and this can be verified using an external resource. (q: "I wanted to know if there were any specific shots and vaccinations I should get before coming over [to Doha]."; a: "Yes there are; though it varies depending on which country you come from. In the UK; the doctor has a list of all countries and the vaccinations needed for each.").15 • Factual - False: The answer gives a factual response, but it is false. (q: "Can I bring my pitbulls to Qatar?", a: "Yes you can bring it but be careful this kind of dog is very dangerous.").16 • Factual - Partially True: We could only verify part of the answer. (q: "I will be relocating from the UK to Qatar [. . . ] is there a league or TT clubs / nights in Doha?", a: "Visit Qatar Bowling Center during thursday and friday and you'll find people playing TT there.").17 • Factual - Conditionally True: The answer is True in some cases, and False in others, depending on some conditions that the answer does not mention. (q: "My wife does not have NOC from Qatar Airways; but we are married now so can i bring her legally on my family visa as her husband?", a: "Yes you can.").18 • Factual - Responder Unsure: The person giving the answer is not sure about the veracity of his/her statement. (e.g., "Possible only if government employed. That's what I heard.") • NonFactual: The answer is not factual. It could be an opinion, an advice, etc. that cannot be verified. (e.g., "Its better to buy a new one.") We further discarded items whose factuality was very time-sensitive (e.g., "It is Friday tomorrow.", "It was raining last week.")19, or for which the annotators were unsure. 15This can be verified at https://wwwnc.cdc.gov/travel/destinations/traveler/none/qatar 16The answer is not true because pitbulls are included in the list of banned breeds in Qatar: http://canvethospital.com/pet-relocation/ banned-dog-breed-list-qatar-2015/ 17The place has table tennis, but we do not know on which days: https://www.qatarbowlingfederation.com/bowling-center/ 18This answer can be true, but this depends upon some conditions: http://www.onlineqatar.com/info/dependent-family-visa.aspx 19Arguably, many answers are somewhat time-sensitive, e.g., "There is an IKEA in Doha." is true only after IKEA opened, but not before that. In such cases, we just used the present situation as a point of reference. Manuscript submitted to ACM 14 Atanasova et al. Coarse-Grained Label Answers Fine-Grained Label + Positive − Negative 128 121 + Factual - True − Factual - False − Factual - Partially True − Factual - Conditionally True − Factual - Responder Unsure − NonFactual Answers 128 22 38 16 26 19 Table 8. Distribution of the positive and the negative answers (i.e., the two classes we predict) and of the fine-grained labels. We considered all questions from the Dev and the Test partitions of the CQA-QL-2016 dataset. We targeted very high quality, and thus we did not crowdsource the annotation, as pilot annotations showed that the task was very difficult and that it was not possible to guarantee that Turkers would do all the necessary verification, e.g., gather evidence from trusted sources. Instead, all examples were first annotated independently by four annotators, and then they discussed each example in detail to come up with a final label. We ended up with 249 Good answers20 to 71 different questions, which we annotated for factuality: 128 Positive and 121 Negative examples. See Table 8 for details. 3.2 Modeling Context and Discourse We model the context of an answer with respect to the entire answer thread in which it occurs, and with respect to other high-quality posts from the entire Qatar Living forum. We further use discourse features as in Section 2.2.8. 3.2.1 Support from the current thread ( 5 features). We use the cosine similarity between an answer- and a thread- vector of all Good answers using Qatar Living embeddings. For this purpose, we use 100-dimensional in-domain word embeddings [Mihaylov and Nakov 2016b], which were trained using word2vec [Mikolov et al. 2013b] on a large dump of Qatar Living data (2M answers).21 The idea is that if an answer is similar to other answers in the thread, it is more likely to be true. To this, we add thread-level features related to the rank of the answer in the thread: (i) the reciprocal rank of the answer in the thread and (ii) percentile of answer's rank in the thread. As there are exactly ten answers per thread in the dataset, the first answer gets the score of 1.0, the second one gets 0.9, the next one gets 0.8, and so on. We calculate these two ranking features twice: once for the full list of answers, and once for the list of good answers only. 3.2.2 Support from all of Qatar Living ( 60 features). We further collect supporting evidence from all threads in the Qatar Living forum. To do this, we query a search engine, limiting the search to the forum only. See Section 3.3.3 for more detail about how the search for evidence on the Web is performed and what features are calculated. 3.2.3 Support from high-quality posts in Qatar Living. Among the 60k active users of the Qatar Living forum, there is a community of 38 trusted users, who have written 5.2k high-quality articles on topics that attract a lot of interest, e.g., issues related to visas, work legislation, etc. We try to verify the answers against these high-quality posts. (i) Since an answer can combine both relevant and irrelevant information with respect to its question, we first generate a query against a search engine for each Q&A. (ii) We then compute cosines between the query and the sentences in the high-quality posts, and we select the k-best matches. (iii) Finally, we compute textual entailment scores [Kouylekov and Negri 2010] for the answer given the k-best matches, which we then use as features. An example is shown in Table 9. 3.2.4 Discourse features. We use the same discourse features as for the claim identification task (cf. Section 2.2.8). 20This is comparable in size to other fact-checking datasets, e.g., Ma et al. [2015] used 226 rumors, and Popat et al. [2016] had 100 Wiki hoaxes. 21Available at http://alt.qcri.org/semeval2016/task3/data/uploads/QL-unannotated-data-subtaskA.xml.zip Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 15 Question: does anyone know if there is a french speaking nursery in doha? Answer: Best Matched Sentence for Q&A: there is a french school here. there is a french school here. don't know the ages but my neighbor's 3 yr old goes there... Post Id sNo R1 R2 Sentence 35639076 15 4 32448901 7 31704366 27971261 6 1 2 3 4 10 the pre-school follows the english program but also gives french and arabic lessons. 11 france bought the property in 1952 and since 1981 it has been home to the french institute. 1 they include one indian school, two french, seven following the british curriculum... 4 the new schools include six qatari, four indian, two british, two american and a finnish... Table 9. Sample of sentences from high-quality posts automatically extracted to support the answer A. sNo is the sentence's sequential number in the post, R1 and R2 are the ranks of the target sentences based on entailment and similarity, respectively. Question: Hi; Just wanted to confirm Qatar's National Day. Is it 18th of December? Thanks. Answer: yes; it is 18th Dec. Query generated from Q&A: "National Day" "Qatar" National December Day confirm wanted Qatar- Source related? type Snippet Other Public holidays and national ...the world's source of Public holidays information Yes Reputed culture and more in and around Qatar ...The documentary features human interest pieces that incorporate the day-to-day lives of Qatar residents Forum Qatar National Day - Short Info ...the date of December 18 is celebrated each year as the URL qppstudio.net No dohanews.co iloveqatar.net Yes cnn.com icassociat ion.co.uk No No National Day of Qatar... Reputed The 2022 World Cup final in Qatar will be held on December 18 ...Qatar will be held on Other December 18 -- the Gulf state's national day. Confirm. U.S ... In partnership with ProEvent Qatar, ICA can confirm that the World Stars will be led on the 17 December, World Stars vs. Qatar Stars - Qatar National Day. Table 10. Sample snippets returned by a search engine for a given query generated from a Q&A pair. 3.3 Other Features 3.3.1 Linguistic bias, subjectivity and sentiment. Forum users, consciously or not, often put linguistic markers in their answers, which can signal the degree of the user's certainty in the veracity of what they say. We thus use the linguistic features from the previous task (see above). 3.3.2 Credibility ( 31 features). We use features that have been previously proposed for credibility detection [Castillo et al. 2011]: number of URLs/images/emails/phone numbers; number of tokens/sentences; average number of tokens; number of positive/negative smileys; number of single/double/triple exclamation/interrogation symbols. To this set, we further add number of interrogative sentences; number of nouns/verbs/adjectives/adverbs/pronouns; and number of words that are not in word2vec's Google News vocabulary (such OOV words could signal slang, foreign language, etc.) We also use the number of 1st, 2nd, 3rd person pronouns in the comments: (i) in absolute number, and also (ii) normalized by the total number of pronouns in the comment. The latter is also a feature. 3.3.3 Support from the Web ( 60 features). We tried to verify whether an answer's claim is factually true by searching for supporting information on the Web. We started with the concatenation of an answer to the question that heads the respective thread. Then, following [Potthast et al. 2013], we extracted nouns, verbs and adjectives, sorted by TF-IDF (we computed IDF on the Qatar Living dump). We further extracted and added the named entities from the text and we generated a query of 5-10 words. If we did not obtain ten results, we dropped some terms and we tried again. Manuscript submitted to ACM 16 Atanasova et al. We automatically queried Bing and Google, and we extracted features from the resulting pages, considering Qatar- related websites only. An example is shown in Table 10. Based on the results, we calculated similarities: (i) cosine with TF-IDF vectors, (ii) cosine using Qatar Living embeddings, and (iii) containment [Lyon et al. 2001]. We calculated these similarities between, on the one side, (i) the question or (ii) the answer or (iii) the question -- answer pair, vs. on the other side, (i) the snippets or (ii) the web pages. To calculate the similarity to a webpage, we first converted the page to a list of rolling sentence triplets, then we calculated the score of the Q/A/Q-A vs. this triplet, and finally we took the average and also the maximum similarity over these triplets. Now, as we had up to ten Web results, we further took the maximum and the average over all the above features over the returned Qatar-related pages. We created three copies of each feature, depending on whether it came from a (i) reputed source (e.g., news, government websites, official sites of companies, etc.), from a (ii) forum type site (forums, reviews, social media), or (iii) from some other type of websites. 3.3.4 Embeddings. (260 features) Finally, we used as features the embeddings of the claim (i.e., the answer), of the best-scoring snippet, and of the best-scoring sentence triplet from a webpage. We calculated these embeddings using long short-term memory (LSTM) representations, which we trained for the task as part of a deep neural network (NN). We also used a task-specific embedding of the question and of the answer together with all the above evidence about it, which comes from the last hidden layer of the neural network. 3.4 Classification Model Our model combines an LSTM-based neural network with kernel-based support vector machines. In particular, we use a bi-LSTM recurrent neural network to train abstract feature representations of the examples. We then feed these representations into a kernel-based SVM, together with other features. The architecture is shown in Figure 3a. We have five LSTM sub-networks, one for each of the text sources from two search engines: Claim, Google Web page, Google snippet, Bing Web page, and Bing snippet. We feed the claim (i.e., the answer) into the neural network as-is. As we can have multiple snippets, we only use the best-matching one as described above. Similarly, we only use a single best-matching triple of consecutive sentences from a Web page. We further feed the neural network with the similarity features described above. All these vectors are concatenated and fully connected to a much more compact hidden layer that captures the task-specific embeddings. This layer is connected to a softmax output unit that classifies the claim as true or false. Figure 3b shows the general architecture of each of the LSTM components. The input text is transformed into a sequence of word embeddings, which are then passed to the bidirectional LSTM layer to obtain a representation for the input text. Next, we extract the last three layers of the neural network -- (i) the concatenation layer, (ii) the embedding layer, and (iii) the classification node -- and we feed them into an SVM with a radial basis function kernel (RBF). In this way, we use the neural network to train task-specific embeddings of the input text fragments, and also of the entire input example. Ultimately, this yields a combination of deep learning and task-specific embeddings with RBF kernels. 3.5 Experiments 3.5.1 Question Classification. Table 11 shows the results of our run for classification of the three question categories (Factual, Opinion, Socializing), using an SVM with bag-of-words and some other features. We can see a 10-point absolute improvement over the baseline, which means the task is feasible. This also leaves plenty of space for further improvement, which is beyond the scope of this work. Instead, below we focus on the more interesting task of checking the factuality of Good answers to Factual questions. Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 17 (a) General overview of the architecture. Fig. 3. Our NN architecture for fact-checking in cQA. Each green box in 3a consists of the bi-LSTM structure in 3b. (b) Detailed LSTM representation. System Baseline: All Opinion (majority class) Our pilot: SVM, bag-of-words Our pilot: SVM, text features Accuracy 50.7 62.0 60.3 Table 11. Baseline vs. our pilot SVM, predicting one of three classes of the questions (factual vs. opinion vs. just socializing). 3.5.2 Answer Classification. Setting and Evaluation. We perform leave-one-thread-out cross validation, where each time we exclude and use for testing one of the 71 questions together with all its answers. This is done in order to respect the structure of the threads when splitting the data. We report Accuracy, Precision, Recall, and F1 for the classification setting. We used a bidirectional LSTM with 25 units and a hard-sigmoid activation, which we trained using an RMSprop optimizer with 0.001 initial learning rate, L2 regularization with λ=0.1, and 0.5 dropout after the LSTM layers. The size of the hidden layer was 60 with tanh activations. We used a batch of 32 and we trained for 400 epochs. Similarly to the bi-LSTM layers, we used an l2 regularizer with λ = 0.01 and dropout with a probability of 0.3. For the SVM, we used grid search to find the best parameters for the parameters c and γ. We optimized the SVM for classification Accuracy. Manuscript submitted to ACM 18 Atanasova et al. Our System All information sources All \ discourse All \ context All \ discourse and context Only context+discourse Baseline All positive (majority class) Accuracy Precision Recall F1 0.688 0.690 0.648 0.661 0.602 0.592 0.563 0.558 0.742 0.676 0.683 0.659 0.574 0.542 0.635 0.693 0.675 0.583 0.554 0.621 0.514 0.514 1.000 0.679 Table 12. Fact-checking the answers in a cQA forum, focusing on the impact of the contextual and discourse features. (a) Clinton: They're doing it to try to influence the election for Donald Trump. (b) Clinton: In the days after the first debate, you sent out a series of tweets from 3 a.m. to 5 a.m., including one that told people to check out a sex tape. Clinton: Is that the discipline of a good leader? Trump No, there wasn't check out a sex tape. Fig. 4. Examples of the impact of context in debate instances. Results. Table 12 shows the results from our experiments for several feature combinations and for two baselines. First, we can see that our system with all features performs better than the baseline for Accuracy. The ablation study shows the importance of the context and of the discourse features. When we exclude the discourse and the contextual features, the accuracy drops from 0.683 to 0.659 and 0.574, respectively. When both the context and the discourse features are excluded, the accuracy drops even further, to 0.542. The F1 results are consistent with this trend. This is similar to the trend for check-worthiness estimation (cf. Table 4). Finally, using the discourse and the contextual features, without any other features, yields an accuracy of 0.635, which is quite competitive. Overall, these results show the importance of the contextual and of the discourse features for the fact-checking task, with the former being more important than the latter. 4 DISCUSSION Here we look at some examples that illustrate how context and discourse help for our two tasks. 4.1 Impact of Context First, we give some examples where the use of contextual information yields the correct prediction for the check- worthiness task (Section 2). In each of these examples, there is a particular contextual feature type that turned out to be critical for making the correct prediction, namely that these are check-worthy sentences (they were all misclassified as not check-worthy when excluding that feature type): Metadata - using opponent's name. According to our explanation in Section 2.2, the target sentence in Figure 4(a) mentions the name of the opponent, and this turned out to be the critical feature for correctly predicting that these are check-worthy claims. Contradiction. Sometimes, an important claim contains a contradiction to what has been said earlier, e.g., the bold sentence in Figure 4(b). We model the contradiction as explained in Section 2.2 to extract such check-worthy claims. Similarity of the sentence to known positive/negative examples. The sentence "For the last seven-and-a-half years, we've seen America's place in the world weakened." is similar to the already fact-checked sentence "We've weakened America's place in the world." Thus, the latter is to be classified as check-worthy. Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 19 a1: Call 111 ... and hold the line for at least 30 minutes before being answered. Enjoy Q-tel music. (a) q: what is qtel customer service number? a2: call 111 a3: 111 - Customer service a4: 111 (b) q: I have visiting visa for work; so can I drive? I have egyptian license a: If you are on a visiting Visa and and you have an international driver license you can use it for 6 month I guess. Evidence: [. . . ] A valid international driving license can be used from the day you arrive into the country until six months. [. . . ] (c) q: Smoke after dark during ramadan? a: Yes! You can smoke in public after sunset till dawn. Evidence: Bars and pubs will generally remain open but will only serve alcohol after dark. [. . . ] Don't smoke, drink, chew gum or eat in public during the hours of sunrise to sunset. (d) q: I am in the process of coming over to work in Doha. I wanted to know if their were any specific shots and vaccinations I should get before coming over. I want to try and get these things completed before I leave the US. a: Yes there are; though it varies depending on which country you come from. In the UK; the doctor has a list of all countries and the vaccinations needed for each. I'll imagine they have the same in the US. Fig. 5. Examples of the impact of context and discourse in cQA instances. Following, there are some examples for the cQA fact-checking task, where the use of particular contextual features allowed the system to predict correctly the factuality of the answers (they were all misclassified when the corresponding contextual feature was turned off): Support from the current thread. The example in Figure 5(a) shows how the thread information (e.g., similarity of one answer to the other answers in the thread) helps to predict the answer's factuality. The question has four answers that should all be True, but they had been misclassified without the support from the current thread. Support from high-quality posts in Qatar Living. The example in Figure 5(b) was correctly classified as True when using the high-quality posts, and misclassified as False otherwise. The high-quality posts in the QL forum contain verified information about common topics discussed by people living in Qatar such as visas, driving regulations, customs, etc. The example shows one piece of relevant evidence selected by our method from the high-quality posts, which possibly helps in making the right classification. Support from all of Qatar Living. The example in Figure 5(c) shows the evidence found in the search results in the entire Qatar Living forum. It was classified correctly as True when using the support from all of the Qatar Living forum, and it was misclassified without it. 4.2 Impact of Discourse As the evaluation results have shown, discourse also played an important role. Let us take the check-worthiness task as an example. In the sentence "But what President Clinton did, he was impeached, he lost his license to practice law.", the discourse parser identified the fragment "But what President Clinton did" as Background referring to the text for facilitating understanding; the segment "he was impeached" is Elaboration referring to additional information and ". . . to practice law" is Enablement referring to the action. These relations are associated with factually-true claims. Similarly, for cQA fact-checking using discourse information yielded correct classification as True for the example in Figure 5(d). The question and the answer were parsed together and the segment containing the answer was identified as Elaboration. The answer further contains a Background segment ("In the UK; the doctor has a list of all countries and the vaccinations needed for each.") and an Attribution segment ("they have the same in the US"). These discourse relations are also associated with factually-true answers (as we have seen also in the Figure 5(c)). Manuscript submitted to ACM 20 Atanasova et al. 5 RELATED WORK Journalists, web users, and researchers are aware of the proliferation of false information on the Web, and as a result, topics such as information credibility and fact-checking are becoming increasingly important as research directions [Lazer et al. 2018; Vosoughi et al. 2018]. For instance, there was a recent special issue of the ACM Transactions on Information Systems journal on Trust and Veracity of Information in Social Media [Papadopoulos et al. 2016], there was a SemEval-2017 shared task on Rumor Detection [Derczynski et al. 2017], and there was a lab at CLEF-2018 on Automatic Identification and Verification of Claims in Political Debates [Atanasova et al. 2018; Barrón-Cedeño et al. 2018; Nakov et al. 2018]. 5.1 Detecting Check-Worthy Claims The task of detecting check-worthy claims has received relatively little research attention so far. Hassan et al. [2015] developed ClaimBuster, which assigns each sentence in a document a score, i.e., a number between 0 and 1 showing how worthy it is for fact-checking. The system is trained on their own dataset of about 8,000 debate sentences (1,673 of them check-worthy), annotated by students, university professors, and journalists. Unfortunately, this dataset is not publicly available, and it contains sentences without context as about 60% of the original sentences had to be thrown away due to lack of agreement. In contrast, we developed a new publicly-available dataset based on manual annotations of political debates by nine highly-reputed fact-checking sources, where sentences are annotated in the context of the entire debate. This allows us to explore a novel approach, which focuses on the context. Note also that the ClaimBuster dataset is annotated following guidelines from [Hassan et al. 2015] rather than trying to mimic a real fact-checking website; yet, it was later evaluated against PolitiFact [Hassan et al. 2016]. In contrast, we train and evaluate directly on annotations from fact-checking websites, and thus we learn to fit them better.22 Patwari et al. [2017] also focused on the 2016 US Presidential election campaign and independently obtained their data following a similar approach. Their setup asked to predict whether any of the fact-checking sources would select the target sentence. They used a boosting-like model that takes SVMs focusing on different clusters of the dataset and the final outcome was that coming from the most confident classifier. The features considered go from LDA topic-modeling to POS tuples and bag-of-word representations. Unlike that work, we further mimic the selection strategy of one particular fact-checking organization by learning to jointly predict the selection choices by various such organizations. The above-mentioned lab on fact-checking at CLEF-2018, was partially based on a variant of our data, but it focused on one fact-checking organization only [Atanasova et al. 2018], unlike our multi-source setup here. Beyond the document context, it has been proposed to mine check-worthy claims on the Web. For example, Ennals et al. [2010a] searched for linguistic cues of disagreement between the author of a statement and what is believed, e.g., "falsely claimed that X". The claims matching the patterns go through a statistical classifier, which marks the text of the claim. This procedure can be used to acquire a corpus of disputed claims from the Web. Given a set of disputed claims, Ennals et al. [2010b] approached the task as locating new claims on the Web that entail the ones that have already been collected. Thus, the task can be conformed as recognizing textual entailment, which is analyzed in detail in [Dagan et al. 2009]. Finally, Le et al. [2016] argued that the top terms in claim vs. non-claim sentences are highly overlapping, which is a problem for bag-of-words approaches. Thus, they used a CNN, where each word is represented by its embedding and each named entity is replaced by its tag, e.g., person, organization, location. 22Our model is released as an online demo that supports both English and Arabic [Jaradat et al. 2018]: http://claimrank.qcri.org/ Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 21 5.2 Fact-Checking and Credibility The credibility of contents on the Web has been questioned by researches for a long time. While in the early days the main research focus was on online news portals [Brill 2001; Hardalov et al. 2016], the interest has eventually shifted towards social media [Castillo et al. 2011; Karadzhov et al. 2017a; Popat et al. 2017; Vosoughi et al. 2018; Zubiaga et al. 2016], which are abundant in sophisticated malicious users such as opinion manipulation trolls [Mihaylov et al. 2018] -- paid [Mihaylov et al. 2015b] or just perceived [Mihaylov et al. 2015a; Mihaylov and Nakov 2016a] -- , sockpuppets [Maity et al. 2017], Internet water army [Chen et al. 2013], and seminar users [Darwish et al. 2017]. Most of the efforts on assessing credibility have focused on micro-blogging websites. For instance, Canini et al. [2011] studied the credibility of Twitter accounts (as opposed to tweet posts), and found that both the topical content of information sources and social network structure affect source credibility. Another work, closer to ours, aims at addressing credibility assessment of rumors on Twitter as a problem of finding false information about a newsworthy event [Castillo et al. 2011]. Their model considered a variety of features including user reputation, writing style, and various time-based features, among others. Other efforts have focused on news communities. For example, several truth discovery algorithms were studied and combined in an ensemble method for veracity estimation in the VERA system [Ba et al. 2016]. They proposed a platform for end-to-end truth discovery from the Web: extracting unstructured information from multiple sources, combining information about single claims, running an ensemble of algorithms, and visualizing and explaining the results. They also explored two different real-world application scenarios for their system: fact-checking for crisis situations and evaluation of trustworthiness of a rumor. However, the input to their model is structured data, while here we are interested in unstructured text. Similarly, the task defined in [Mukherjee and Weikum 2015] combines three objectives: assessing the credibility of a set of posted articles, estimating the trustworthiness of sources, and predicting user's expertise. They considered a manifold of features characterizing language, topics and Web-specific statistics (e.g., review ratings) on top of a continuous conditional random fields model. In follow-up work, Popat et al. [2016] proposed a model to support or refute claims from snopes.com and the Wikipedia by considering supporting information gathered from the Web. In another follow-up work, [Popat et al. 2017] proposed a complex model that considers stance, source reliability, language style, and temporal information. Another important research direction is on using tweets and temporal information for checking the factuality of rumors. For example, Ma et al. [2015] used temporal patterns of rumor dynamics to detect false rumors and to predict their frequency. They focused on detecting false rumors in Twitter using time series. They used the change of social context features over a rumor's life cycle in order to detect rumors at an early stage after they were broadcast. A more general approach for detecting rumors is explored in [Ma et al. 2016], who used recurrent neural networks to learn hidden representations that capture the variation of contextual information of relevant posts over time. Unlike this work, we do not use microblogs, but we query the Web directly in search for evidence. In the context of question answering, there has been work on assessing the credibility of an answer, e.g., based on intrinsic information, i.e. without any external resources [Banerjee and Han 2009]. In this case, the reliability of an answer is measured by computing the divergence between language models of the question and of the answer. The spawn of community-based question answering Websites also allowed for the use of other kinds of information. Click counts, link analysis (e.g., PageRank), and user votes have been used to assess the quality of a posted answer [Agichtein et al. 2008; Jeon et al. 2006; Jurczyk and Agichtein 2007]. Nevertheless, these studies address the answers' credibility level just marginally. Manuscript submitted to ACM 22 Atanasova et al. Efforts to estimate the credibility of an answer in order to assess its overall quality required the inclusion of content- based information [Su et al. 2010], e.g., verbs and adjectives such as suppose and probably, which cast doubt on the answer. Similarly, Lita et al. [2005] used source credibility (e.g., does the document come from a government Website?), sentiment analysis, and answer contradiction compared to other related answers. Another way to assess the credibility of an answer is to incorporate textual entailment methods to find out whether a text (question) can be derived from a hypothesis (answer). Overall, the credibility assessment for question answering has been mostly modeled at the feature level, with the goal of assessing the quality of the answers. A notable exception is the work of Nakov et al. [2017b], where credibility is treated as a task of its own right. Yet, credibility is different from factuality (our focus here) as the former is a subjective perception about whether a statement is credible, rather than verifying it as true or false; still, these notions are often wrongly mixed in the literature. To the best of our knowledge, no previous work has targeted fact-checking of answers in the context of community Question Answering by gathering external support. 6 CONCLUSION AND FUTURE WORK We have studied the role of context and discourse information for two factuality tasks: (i) detecting check-worthy claims in political debates, and (ii) fact-checking answers in a community question answering forum. We have developed annotated resources for both tasks, which we have made publicly available, and we have proposed rich input represen- tations -- including discourse and contextual features -- , and also a complementary set of core features to make our systems as strong as possible. The definition of context varies between the two tasks. For check-worthiness estimation, a target sentence occurs in the context of a political debate, where we model the current intervention by a debate participant in relationship to the previous and to the following participants' turns, together with meta information about the participants, about the reaction of the debate's public, etc. In the answer's factuality checking task, the context for the answer involves the full question-answering thread, the related threads in the entire forum, or the set of related high-quality posts in the forum. We trained classifiers for both tasks using neural networks, kernel-based support vector machines, and combinations thereof, and we ran a rigorous evaluation, comparing against alternative systems whenever possible. We also discussed several cases from the test set where the contextual information helped make the right decisions. Overall, our experi- mental results and the posterior manual analysis have shown that discourse cues, and especially modeling the context, play an important role and thus should be taken into account when developing models for these tasks. In future work, we plan to study the role of context and discourse for other related tasks, e.g., for checking the factuality of general claims (not just answers to questions), and for stance classification in the context of factuality. We also plan to experiment with a joint model for check-worthiness estimation, for stance classification, and for fact-checking, which would be useful in an end-to-end system [Baly et al. 2018; Mohtarami et al. 2018]. We would also like to extend our datasets (e.g., with additional debates, but also with interviews and general discussions), thus enabling better exploitation of deep learning. Especially for the answer verification task, we would like to try distant supervision based on known facts, e.g., from high-quality posts, which would allow us to use more training data. We also want to improve user modeling, e.g., by predicting factuality for the user's answers and then building a user profile based on that. Finally, we want to explore the possibility of providing justifications for the verified answers, and ultimately of integrating our system in a real-world application. Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 23 REFERENCES Eugene Agichtein, Carlos Castillo, Debora Donato, Aristides Gionis, and Gilad Mishne. 2008. Finding High-quality Content in Social Media. In Proceedings of the International Conference on Web Search and Data Mining (WSDM '08). Palo Alto, California, USA, 183 -- 194. Pepa Atanasova, Lluís Màrquez, Alberto Barrón-Cedeño, Tamer Elsayed, Reem Suwaileh, Wajdi Zaghouani, Spas Kyuchukov, Giovanni Da San Martino, and Preslav Nakov. 2018. Overview of the CLEF-2018 CheckThat! Lab on Automatic Identification and Verification of Political Claims, Task 1: Check-Worthiness. In CLEF 2018 Working Notes. Avignon, France. Mouhamadou Lamine Ba, Laure Berti-Equille, Kushal Shah, and Hossam M. Hammady. 2016. VERA: A Platform for Veracity Estimation over Web Data. In Proceedings of the 25th International Conference Companion on World Wide Web (WWW '16). Montréal, Québec, Canada, 159 -- 162. Ramy Baly, Mitra Mohtarami, James Glass, Lluís Màrquez, Alessandro Moschitti, and Preslav Nakov. 2018. Integrating Stance Detection and Fact Checking in a Unified Corpus. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT '18). New Orleans, Louisiana, USA, 21 -- 27. Protima Banerjee and Hyoil Han. 2009. Answer Credibility: A Language Modeling Approach to Answer Validation. In Proceedings of the Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT '09). Boulder, Colorado, USA, 157 -- 160. Alberto Barrón-Cedeño, Tamer Elsayed, Reem Suwaileh, Lluís Màrquez, Pepa Atanasova, Wajdi Zaghouani, Spas Kyuchukov, Giovanni Da San Martino, and Preslav Nakov. 2018. Overview of the CLEF-2018 CheckThat! Lab on Automatic Identification and Verification of Political Claims, Task 2: Factuality. In CLEF 2018 Working Notes. Working Notes of CLEF 2018 - Conference and Labs of the Evaluation Forum (CEUR Workshop Proceedings). Avignon, France. Jonathan Baxter. 1997. A Bayesian/Information Theoretic Model of Learning to Learn via Multiple Task Sampling. Machine Learning 28, 1 (1997), 7 -- 39. David M Blei, Andrew Y Ng, and Michael I Jordan. 2003. Latent Dirichlet Allocation. Journal of Machine Learning Research 3, 1 (2003), 993 -- 1022. Ann M Brill. 2001. Online Journalists Embrace New Marketing Function. Newspaper Research Journal 22, 2 (2001), 28. Lars Buitinck, Gilles Louppe, Mathieu Blondel, Fabian Pedregosa, Andreas Mueller, Olivier Grisel, Vlad Niculae, Peter Prettenhofer, Alexandre Gramfort, Jaques Grobler, Robert Layton, Jake VanderPlas, Arnaud Joly, Brian Holt, and Gaël Varoquaux. 2013. API Design for Machine Learning Software: Experiences from the scikit-learn Project. In ECML PKDD Workshop: Languages for Data Mining and Machine Learning. Prague, Czech Republic, 108 -- 122. Kevin R. Canini, Bongwon Suh, and Peter L. Pirolli. 2011. Finding Credible Information Sources in Social Networks Based on Content and Social Structure. In Proceedings of the IEEE International Conference on Privacy, Security, Risk, and Trust, and the IEEE International Conference on Social Computing (SocialCom/PASSAT '11). Boston, Massachusetts, USA, 1 -- 8. Richard Caruana. 1993. Multitask Learning: A Knowledge-Based Source of Inductive Bias. In Proceedings of the Tenth International Conference on Machine Learning (ICML '13). Amherst, Massachusetts, USA, 41 -- 48. Carlos Castillo, Marcelo Mendoza, and Barbara Poblete. 2011. Information Credibility on Twitter. In Proceedings of the 20th International Conference on World Wide Web (WWW '11). Hyderabad, India, 675 -- 684. Cheng Chen, Kui Wu, Venkatesh Srinivasan, and Xudong Zhang. 2013. Battling the Internet Water Army: Detection of Hidden Paid Posters. In Proceedings of the 2013 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM '13). Niagara, Ontario, Canada, 116 -- 120. Ido Dagan, Bill Dolan, Bernardo Magnini, and Dan Roth. 2009. Recognizing Textual Entailment: Rational, Evaluation and Approaches. Natural Language Engineering 15, 4 (2009), i -- xvii. Kareem Darwish, Dimitar Alexandrov, Preslav Nakov, and Yelena Mejova. 2017. Seminar Users in the Arabic Twitter Sphere. In Proceedings of the 9th International Conference on Social Informatics (SocInfo '17). Oxford, UK, 91 -- 108. Leon Derczynski, Kalina Bontcheva, Maria Liakata, Rob Procter, Geraldine Wong Sak Hoi, and Arkaitz Zubiaga. 2017. SemEval-2017 Task 8: RumourEval: Determining Rumour Veracity and Support for Rumours. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval '17). Vancouver, Canada, 60 -- 67. Rob Ennals, Dan Byler, John Mark Agosta, and Barbara Rosario. 2010a. What is Disputed on the Web?. In Proceedings of the 4th Workshop on Information Credibility (WICOW '10). New York, New York, USA, 67 -- 74. Rob Ennals, Beth Trushkowsky, and John Mark Agosta. 2010b. Highlighting Disputed Claims on the Web. In Proceedings of the 19th International Conference on World Wide Web (WWW '10). Raleigh, North Carolina, USA, 341 -- 350. George Foster and Roland Kuhn. 2009. Stabilizing Minimum Error Rate Training. In Proceedings of the Fourth Workshop on Statistical Machine Translation (StatMT '09). Athens, Greece, 242 -- 249. Pepa Gencheva, Preslav Nakov, Lluís Màrquez, Alberto Barrón-Cedeño, and Ivan Koychev. 2017. A Context-Aware Approach for Detecting Worth-Checking Claims in Political Debates. In Proceedings of Recent Advances in Natural Language Processing (RANLP '17). Varna, Bulgaria, 267 -- 276. Xavier Glorot, Antoine Bordes, and Yoshua Bengio. 2011. Deep Sparse Rectifier Neural Networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics (PMLR '11), Vol. 15. Fort Lauderdale, Florida, USA, 315 -- 323. Momchil Hardalov, Ivan Koychev, and Preslav Nakov. 2016. In Search of Credible News. In Proceedings of the 17th International Conference on Artificial Intelligence: Methodology, Systems, and Applications (AIMSA '16). Varna, Bulgaria, 172 -- 180. Naeemul Hassan, Chengkai Li, and Mark Tremayne. 2015. Detecting Check-worthy Factual Claims in Presidential Debates. In Proceedings of the 24th ACM International Conference on Information and Knowledge Management (CIKM '15). 1835 -- 1838. Manuscript submitted to ACM 24 Atanasova et al. Naeemul Hassan, Mark Tremayne, Fatma Arslan, and Chengkai Li. 2016. Comparing Automated Factual Claim Detection Against Judgments of Journalism Organizations. In Computation + Journalism Symposium. Stanford, California, USA. Joan B. Hooper. 1974. On Assertive Predicates. Indiana University Linguistics Club. Ken Hyland. 2005. Metadiscourse: Exploring Interaction in Writing. Bloomsbury Publishing. Daisuke Ishikawa, Tetsuya Sakai, and Noriko Kando. 2010. Overview of the NTCIR-8 Community QA Pilot Task (Part I): The Test Collection and the Task. In Proceedings of NTCIR-8 Workshop Meeting. Tokyo, Japan, 421 -- 432. Israa Jaradat, Pepa Gencheva, Alberto Barrón-Cedeño, Lluís Màrquez, and Preslav Nakov. 2018. ClaimRank: Detecting Check-Worthy Claims in Arabic and English. In Proceedings of the 16th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT '18). New Orleans, Louisiana, USA, 26 -- 30. Jiwoon Jeon, W. Bruce Croft, Joon Ho Lee, and Soyeon Park. 2006. A Framework to Predict the Quality of Answers with Non-textual Features. In Proceedings of the 29th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR '06). Seattle, Washington, USA, 228 -- 235. Shafiq Joty, Giuseppe Carenini, and Raymond T. Ng. 2015. CODRA: A Novel Discriminative Framework for Rhetorical Analysis. Comput. Linguist. 41, 3 (2015), 385 -- 435. Pawel Jurczyk and Eugene Agichtein. 2007. Discovering Authorities in Question Answer Communities by Using Link Analysis. In Proceedings of the 16th ACM Conference on Conference on Information and Knowledge Management (CIKM '07). Lisbon, Portugal, 919 -- 922. Georgi Karadzhov, Pepa Gencheva, Preslav Nakov, and Ivan Koychev. 2017a. We Built a Fake News & Click-bait Filter: What Happened Next Will Blow Your Mind!. In Proceedings of the 2017 International Conference on Recent Advances in Natural Language Processing (RANLP '17). Varna, Bulgaria, 334 -- 343. Georgi Karadzhov, Preslav Nakov, Lluís Màrquez, Alberto Barrón-Cedeño, and Ivan Koychev. 2017b. Fully Automated Fact Checking Using External Sources. In Proceedings of the 2017 International Conference on Recent Advances in Natural Language Processing (RANLP '17). Varna, Bulgaria, 344 -- 353. Lauri Karttunen. 1971. Implicative Verbs. Language 47, 2 (1971), 340 -- 358. Milen Kouylekov and Matteo Negri. 2010. An Open-source Package for Recognizing Textual Entailment. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics: System Demonstrations (ACL '10). Uppsala, Sweden, 42 -- 47. David M. J. Lazer, Matthew A. Baum, Yochai Benkler, Adam J. Berinsky, Kelly M. Greenhill, Filippo Menczer, Miriam J. Metzger, Brendan Nyhan, Gordon Pennycook, David Rothschild, Michael Schudson, Steven A. Sloman, Cass R. Sunstein, Emily A. Thorson, Duncan J. Watts, and Jonathan L. Zittrain. 2018. The Science of Fake News. Science 359, 6380 (2018), 1094 -- 1096. Dieu-Thu Le, Ngoc Thang Vu, and Andre Blessing. 2016. Towards a Text Analysis System for Political Debates. In Proceedings of the 10th SIGHUM Workshop on Language Technology for Cultural Heritage, Social Sciences, and Humanities (LaTeCH '16). Berlin, Germany, 134 -- 139. Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. 1998. Gradient-Based Learning Applied to Document Recognition. Proc. IEEE 86, 11 (1998), 2278 -- 2324. Lucian Vlad Lita, Andrew Hazen Schlaikjer, WeiChang Hong, and Eric Nyberg. 2005. Qualitative Dimensions in Question Answering: Extending the Definitional QA Task. In Proceedings of the 20th National Conference on Artificial Intelligence (AAAI '05). Pittsburgh, Pennsylvania, USA, 1616 -- 1617. Bing Liu, Minqing Hu, and Junsheng Cheng. 2005. Opinion Observer: Analyzing and Comparing Opinions on the Web. In Proceedings of the 14th International Conference on World Wide Web (WWW '05). New York, New York, USA, 342 -- 351. Edward Loper and Steven Bird. 2002. NLTK: The Natural Language Toolkit. In Proceedings of the ACL-02 Workshop on Effective Tools and Methodologies for Teaching Natural Language Processing and Computational Linguistics (ETMTNLP '02). Philadelphia, Pennsylvania, USA, 63 -- 70. Caroline Lyon, James Malcolm, and Bob Dickerson. 2001. Detecting Short Passages of Similar Text in Large Document Collections. In Proceedings of the 2001 Conference on Empirical Methods in Natural Language Processing (EMNLP '01). Pittsburgh, Pennsylvania, USA. Jing Ma, Wei Gao, Prasenjit Mitra, Sejeong Kwon, Bernard J. Jansen, Kam-Fai Wong, and Meeyoung Cha. 2016. Detecting Rumors from Microblogs with Recurrent Neural Networks. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI'16). New York, New York, USA, 3818 -- 3824. Jing Ma, Wei Gao, Zhongyu Wei, Yueming Lu, and Kam-Fai Wong. 2015. Detect Rumors Using Time Series of Social Context Information on Microblogging Websites. In Proceedings of the International on Conference on Information and Knowledge Management (CIKM '15). Melbourne, Australia, 1751 -- 1754. Suman Kalyan Maity, Aishik Chakraborty, Pawan Goyal, and Animesh Mukherjee. 2017. Detection of Sockpuppets in Social Media. In Proceedings of the ACM Conference on Computer Supported Cooperative Work and Social Computing (CSCW '17). Portland, Oregon, USA, 243 -- 246. Todor Mihaylov, Georgi Georgiev, and Preslav Nakov. 2015a. Finding Opinion Manipulation Trolls in News Community Forums. In Proceedings of the Nineteenth Conference on Computational Natural Language Learning (CoNLL '15). Beijing, China, 310 -- 314. Todor Mihaylov, Ivan Koychev, Georgi Georgiev, and Preslav Nakov. 2015b. Exposing Paid Opinion Manipulation Trolls. In Proceedings of the International Conference Recent Advances in Natural Language Processing (RANLP '15). Hissar, Bulgaria, 443 -- 450. Todor Mihaylov, Tsvetomila Mihaylova, Preslav Nakov, Lluís Màrquez, Georgi Georgiev, and Ivan Koychev. 2018. The Dark Side of News Community Forums: Opinion Manipulation Trolls. Internet Research 28, 5 (2018), 1292 -- 1312. Todor Mihaylov and Preslav Nakov. 2016a. Hunting for Troll Comments in News Community Forums. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL '16). Berlin, Germany, 399 -- 405. Todor Mihaylov and Preslav Nakov. 2016b. SemanticZ at SemEval-2016 Task 3: Ranking Relevant Answers in Community Question Answering Using Semantic Similarity Based on Fine-tuned Word Embeddings. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval '16). Manuscript submitted to ACM Automatic Fact-Checking Using Context and Discourse Information 25 San Diego, California, USA, 879 -- 886. Tsvetomila Mihaylova, Preslav Nakov, Lluís Màrquez, Alberto Barrón-Cedeño, Mitra Mohtarami, Georgi Karadjov, and James Glass. 2018. Fact Checking in Community Forums. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI '18). New Orleans, Lousiana, USA, 5309 -- 5316. Tomas Mikolov, Quoc V. Le, and Ilya Sutskever. 2013a. Exploiting Similarities among Languages for Machine Translation. CoRR abs/1309.4168 (2013). Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013b. Linguistic Regularities in Continuous Space Word Representations. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT '13). Atlanta, Georgia, USA, 746 -- 751. Saif M. Mohammad and Peter D. Turney. 2013. Crowdsourcing a Word-Emotion Association Lexicon. 29, 3 (2013), 436 -- 465. Mitra Mohtarami, Ramy Baly, James Glass, Preslav Nakov, Lluís Màrquez, and Alessandro Moschitti. 2018. Automatic Stance Detection Using End-to-End Memory Networks. In Proceedings of the 16th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT '18). New Orleans, Louisiana, USA, 767 -- 776. Subhabrata Mukherjee and Gerhard Weikum. 2015. Leveraging Joint Interactions for Credibility Analysis in News Communities. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management (CIKM '15). Melbourne, Australia, 353 -- 362. Preslav Nakov, Alberto Barrón-Cedeño, Tamer Elsayed, Reem Suwaileh, Lluís Màrquez, Wajdi Zaghouani, Pepa Atanasova, Spas Kyuchukov, and Giovanni Da San Martino. 2018. Overview of the CLEF-2018 CheckThat! Lab on Automatic Identification and Verification of Political Claims. In Proceedings of the Ninth International Conference of the CLEF Association: Experimental IR Meets Multilinguality, Multimodality, and Interaction (Lecture Notes in Computer Science). Springer, Avignon, France, 372 -- 387. Preslav Nakov, Doris Hoogeveen, Lluís Màrquez, Alessandro Moschitti, Hamdy Mubarak, Timothy Baldwin, and Karin Verspoor. 2017a. SemEval-2017 Task 3: Community Question Answering. In Proceedings of the International Workshop on Semantic Evaluation (SemEval '17). Vancouver, Canada, 27 -- 48. Preslav Nakov, Lluís Màrquez, Walid Magdy, Alessandro Moschitti, Jim Glass, and Bilal Randeree. 2015. SemEval-2015 Task 3: Answer Selection in Community Question Answering. In Proceedings of the International Workshop on Semantic Evaluation (SemEval '15). Denver, Colorado, USA, 269 -- 281. Preslav Nakov, Lluís Màrquez, Alessandro Moschitti, Walid Magdy, Hamdy Mubarak, Abed Alhakim Freihat, Jim Glass, and Bilal Randeree. 2016. SemEval-2016 Task 3: Community Question Answering. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval '16). San Diego, California, 525 -- 545. Preslav Nakov, Tsvetomila Mihaylova, Lluís Màrquez, Yashkumar Shiroya, and Ivan Koychev. 2017b. Do Not Trust the Trolls: Predicting Credibility in Community Question Answering Forums. In Proceedings of the 2017 International Conference on Recent Advances in Natural Language Processing (RANLP '17). Varna, Bulgaria, 551 -- 560. Symeon Papadopoulos, Kalina Bontcheva, Eva Jaho, Mihai Lupu, and Carlos Castillo. 2016. Overview of the Special Issue on Trust and Veracity of Information in Social Media. ACM Trans. Inf. Syst. 34, 3 (2016), 14:1 -- 14:5. Ayush Patwari, Dan Goldwasser, and Saurabh Bagchi. 2017. TATHYA: A Multi-Classifier System for Detecting Check-Worthy Statements in Political Debates. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management (CIKM). Singapore, 2259 -- 2262. Kashyap Popat, Subhabrata Mukherjee, Jannik Strötgen, and Gerhard Weikum. 2016. Credibility Assessment of Textual Claims on the Web. In Proceedings of the 25th ACM International on Conference on Information and Knowledge Management (CIKM '16). Indianapolis, Indiana, USA, 2173 -- 2178. Kashyap Popat, Subhabrata Mukherjee, Jannik Strötgen, and Gerhard Weikum. 2017. Where the Truth Lies: Explaining the Credibility of Emerging Claims on the Web and Social Media. In Proceedings of the 26th International Conference on World Wide Web Companion (WWW '17). Perth, Australia, 1003 -- 1012. Martin Potthast, Matthias Hagen, Tim Gollub, Martin Tippmann, Johannes Kiesel, Paolo Rosso, Efstathios Stamatatos, and Benno Stein. 2013. Overview of the 5th International Competition on Plagiarism Detection. In Proceedings of the CLEF Conference on Multilingual and Multimodal Information Access Evaluation. Valencia, Spain, 301 -- 331. Hannah Rashkin, Eunsol Choi, Jin Yea Jang, Svitlana Volkova, and Yejin Choi. 2017. Truth of Varying Shades: Analyzing Language in Fake News and Political Fact-Checking. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP '17). Copenhagen, Denmark, 2931 -- 2937. Marta Recasens, Cristian Danescu-Niculescu-Mizil, and Dan Jurafsky. 2013. Linguistic Models for Analyzing and Detecting Biased Language. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (ACL '13). Sofia, Bulgaria, 1650 -- 1659. Radim Řehůřek and Petr Sojka. 2010. Software Framework for Topic Modelling with Large Corpora. In Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks. Valletta, Malta, 45 -- 50. Ellen Riloff and Janyce Wiebe. 2003. Learning Extraction Patterns for Subjective Expressions. In Proceedings of the 2003 Conference on Empirical Methods in Natural Language Processing (EMNLP '03). Sapporo, Japan, 105 -- 112. Qi Su, Helen Kai-Yun Chen, and Chu-Ren Huang. 2010. Incorporate Credibility into Context for the Best Social Media Answers. In Proceedings of the 24th Pacific Asia Conference on Language, Information and Computation (PACLIC '10). Sendai, Japan, 535 -- 541. Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. 2013. On the Importance of Initialization and Momentum in Deep Learning. In Proceedings of the 30th International Conference on International Conference on Machine Learning (ICML '13), Vol. 28. Atlanta, Georgia, USA, 1139 -- 1147. Soroush Vosoughi, Deb Roy, and Sinan Aral. 2018. The Spread of True and False News Online. Science 359, 6380 (2018), 1146 -- 1151. Arkaitz Zubiaga, Maria Liakata, Rob Procter, Geraldine Wong Sak Hoi, and Peter Tolmie. 2016. Analysing How People Orient to and Spread Rumours in Social Media by Looking at Conversational Threads. PLoS ONE 11, 3 (03 2016), 1 -- 29. Manuscript submitted to ACM
1808.05505
3
1808
2018-10-15T01:21:26
Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition
[ "cs.CL" ]
Sentence embedding is an important research topic in natural language processing. It is essential to generate a good embedding vector that fully reflects the semantic meaning of a sentence in order to achieve an enhanced performance for various natural language processing tasks, such as machine translation and document classification. Thus far, various sentence embedding models have been proposed, and their feasibility has been demonstrated through good performances on tasks following embedding, such as sentiment analysis and sentence classification. However, because the performances of sentence classification and sentiment analysis can be enhanced by using a simple sentence representation method, it is not sufficient to claim that these models fully reflect the meanings of sentences based on good performances for such tasks. In this paper, inspired by human language recognition, we propose the following concept of semantic coherence, which should be satisfied for a good sentence embedding method: similar sentences should be located close to each other in the embedding space. Then, we propose the Paraphrase-Thought (P-thought) model to pursue semantic coherence as much as possible. Experimental results on two paraphrase identification datasets (MS COCO and STS benchmark) show that the P-thought models outperform the benchmarked sentence embedding methods.
cs.CL
cs
Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition Myeongjun Jang 1 Pilsung Kang 1 8 1 0 2 t c O 5 1 ] L C . s c [ 3 v 5 0 5 5 0 . 8 0 8 1 : v i X r a Abstract Sentence embedding is an important research topic in natural language processing. It is es- sential to generate a good embedding vector that fully reflects the semantic meaning of a sentence in order to achieve an enhanced performance for various natural language processing tasks, such as machine trans- lation and document classification. Thus far, various sentence embedding models have been proposed, and their feasibility has been demonstrated through good performances on tasks following embedding, such as sentiment analysis and sentence classification. How- ever, because the performances of sentence classification and sentiment analysis can be enhanced by using a simple sentence repre- sentation method, it is not sufficient to claim that these models fully reflect the meanings of sentences based on good performances for such tasks. In this paper, inspired by human language recognition, we propose the follow- ing concept of semantic coherence, which should be satisfied for a good sentence em- bedding method: similar sentences should be located close to each other in the embedding space. Then, we propose the Paraphrase- Thought (P-thought) model to pursue se- mantic coherence as much as possible. Ex- perimental results on two paraphrase identi- fication datasets (MS COCO and STS bench- mark) show that the P-thought models out- perform the benchmarked sentence embed- ding methods. Keywords: Sentence embedding, Recurrent neural network, Paraphrase, Semantic coher- ence, Natural language processing 1School of Industrial Management Engineering, Ko- rea University, Seoul, South Korea. Correspondence to: Myeongjun Jang <[email protected]>, Pilsung Kang <[email protected]>. 1. Introduction Sentence embedding, which transforms sentences into low-dimensional vector values reflecting their mean- ings, is a highly important task in natural language processing (NLP). By mapping unstructured text data into a certain form of structured representation, the embedding vector can enhance the performances of various NLP tasks, such as machine translation (Artetxe et al., 2017; Lee et al., 2016; Zhao & Zhang, 2016), document classification (Conneau et al., 2017b; Zhou et al., 2016), and sentence matching (Wan et al., 2016). As sentence embedding plays an import role in NLP, various methods (Kiros et al., 2015; Pagliar- dini et al., 2017; Hill et al., 2016; Arora et al., 2017; Conneau et al., 2017a; Chen, 2017) have been pro- posed since the advent of the Doc2vec method (Le & Mikolov, 2014). Typically, these methods exhibit bet- ter performances than benchmarked embedding meth- ods for common NLP tasks, such as document classi- fication or sentiment analysis. However, this is not a direct evaluation of how well semantic meanings are preserved by the proposed embedding method. Indirect methods for evaluating sentence embedding are not sufficient to evaluate the main property of sen- tence embedding techniques, i.e., how well semantic relationships between sentences are preserved. Iyyer et al. (2015) showed that it is possible to achieve a fairly good performance in document classification using a simple document representation vector, i.e., an average of word vectors in the document. Even for classic document representation methods, in which word sequences or semantic relationships between words are not considered, e.g., bag of words (BoW) or term frequency-inverse document frequency (TF-IDF), highly accurate classification results can be achieved using a Naïve Bayesian classifier (Soumya George & Joseph, 2014). This means that a good performance on a classification task can be achieved without the use of embedding vectors. In other words, a good classi- fication performance for common NLP tasks using a certain type of sentence embedding method does not guarantee that the embedding method can successfully Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition preserve the semantic relationship between sentences. In this paper, in order to overcome the limitations of indirect sentence embedding evaluation strategies, we propose the following concept of semantic coher- ence, which should be satisfied by a good sentence em- bedding method: sentences having similar meanings should be placed close to each other in the embed- ding space. Then, we propose a new sentence embed- ding model named Paraphrase-Thought (P-thought), which can maximally pursue semantic coherence dur- ing training. The P-thought model is designed as a dual generation model, which receives a single sen- tence as input and generates both the input sentence and its paraphrase sentence simultaneously. The pro- posed P-thought model is evaluated through a task of measuring the semantic coherence and the STS Bench- mark task. Experimental results show that the pro- posed P-thought model yields a better performance than benchmarked models in both tasks. The remainder of this paper is organized as follows. In Section 2, we briefly review previous research on sen- tence embedding. In Section 3, we propose the concept of semantic coherence and a new metric: paraphrase coherence (P-coherence). In Section 4, we describe the structure of the P-thought model. In Section 5, experi- mental settings are described for each task, followed by results and discussions. In Section 6, we conclude the present work with some discussion of future research directions. 2. Related work Recent work on sentence embedding ranges from sim- ple extensions of the word embedding vector (Le & Mikolov, 2014; Arora et al., 2017; Pagliardini et al., 2017; Chen, 2017; Wieting et al., 2015) to neural net- work models specialized for handling a sequence of words appearing in a sentence (Kiros et al., 2015; Con- neau et al., 2017a). The Distributed Bag of Words version of Paragraph Vector (PV-DBOW) and Dis- tributed Memory Model of Paragraph Vectors (PV- DM) methods, which were proposed in Doc2vec (Le & Mikolov, 2014), learn sentence vectors based on the same principle: maximizing the probability to predict words in the same sentence. Arora et al. (2017) pro- posed a model that computes the sentence embedding vector as a weighted average of word embedding vec- tors in a sentence. By re-weighting the weights of words in a sentence, the authors achieved an improved performance in textual similarity tasks, and outper- formed a complex model based on recurrent neural network (RNN). Unlike in Doc2vec (Le & Mikolov, 2014), in Doc2vecC (Chen, 2017), the sentence embed- ding vector is defined as a simple average of word em- bedding vectors. The idea behind doc2vecC, i.e., using an average of word embedding vectors to represent the global context of the sentence, had already been pro- posed by Huang et al. (2012). In addition, doc2vecC applies a corruption mechanism that randomly re- moves words from a sentence and generates a sentence embedding vector with the remaining words. This simple idea significantly reduced the total amount of training time. Similar to previous methods, Sent2vec (Pagliardini et al., 2017) defines the sentence vector as an average of word embedding vectors. However, unlike other models using word embedding vectors of single words (i.e., uni-gram), it considers n-gram vec- tors in addition to uni-gram vectors when training the sentence embedding model. The Skip-thought model (Kiros et al., 2015), which has a sequence to sequence (Seq2Seq) structure, is an ex- tension of the Skip-gram (Mikolov et al., 2013b) model, where the basic unit for network learning is a sentence instead of a word. Similar to the Skip-gram model, which learns word embedding vectors by training the network to predict the surrounding words when the center word is given, Skip-thought is trained to en- code the input sentence and generate its preceding and following sentences. By using the generated sen- tence vectors as the input of a simple linear model, Skip-thought exhibited an improved performance for document classification and sentiment analysis. In- spired by previous results in computer vision, where many models are pretrained based on ImageNet (Deng et al., 2009), Conneau et al. (2017a) conducted re- search on whether supervised learning tasks are help- ful for learning sentence embedding vectors. Through experiments, Conneau et al. (2017a) claimed that sen- tence embedding vectors generated from a model that is trained based on a natural language inference (NLI) task yield a state-of-the-art performance when lever- aged in other NLP tasks. In particular, they found that a model with a bi-directional Long-short term memory (LSTM) structure and max pooling trained on the Stanford Natural Language Inference (SNLI) dataset (Bowman et al., 2015), named InferSent, ex- hibited the best performance. 3. Semantic coherence 3.1. Defining semantic coherence Although two sentences may employ different words or different structures, people will recognize them as the same sentence as long as the implied semantic mean- ings are highly similar. Consider the following two sentences: Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition • Sentence 1: Jang was caught by professor Kang while playing the computer game in the lab. • Sentence 2: Professor Kang came to the lab and witnessed Jang playing the computer game. Although these two sentences exhibit a clear difference with respect to both the sentence structure and word usage, people can immediately perceive that they convey the same meaning. Hence, a good sentence embedding approach should satisfy the property that if two sentences have different structures but convey the same meaning (i.e., paraphrase sentences), then they should have the same, or at least similar, embedding vectors. Based on this, we define semantic coherence as follows. Definition 1. The degree of semantic coherence of a sentence embedding model is proportional to the similarity between the representation vectors of paraphrase sentences generated by the model. If the representation vectors of paraphrase sentences are located close to each other in the embedding space, this implies that there is little difference between their vector values. Thus, when the representation vector value of a sentence is given, it should be possible to generate the given sentence and its paraphrase sentences. Consequently, we can derive the following hypothesis. Hypothesis 1. If it is possible to generate an input sentence and its paraphrase sentence simultaneously from the vector value of the input sentence, then the sentence embedding model can enhance the semantic coherence. In this study, we propose a new sentence embedding model to satisfy the above hypothesis. 3.2. Evaluating semantic coherence: paraphrase coherence To evaluate semantic coherence, we should measure the densities of paraphrase sentences. This requires multiple pairs of paraphrase sentences that share the same meaning. Thus, previous metrics that simply calculate the matching degree of two sentences are in- sufficient. In this study, inspired by topic coherence, which is used to determine the optimal number of topics in topic modeling, we propose a new evaluation metric (cid:88) called paraphrase coherence (P-coherence) to measure the semantic coherence. Topic coherence measures how effectively the highly weighted top k words of a topic satisfy coherence (Newman et al., 2010); topic coherence is computed as follows: T opic − coherence = Score(wi, wj), (1) i<j where wi and wj are the top ith and jth words of the same topic, respectively. Although various methods exist to define the score between two words (Röder et al., 2015), we adopted the idea of the pointwise mutual information (PMI) measure (Newman et al., 2010), defined as follows: ScoreP M I (wi, wj) = log p(wi, wj) p(wi)p(wj) , (2) where p(wi, wj) is the probability of words wi and wj appearing together in a randomly selected document, and p(wi) and p(wj) are the marginal probabilities that the words wi and wj appear in the randomly se- lected document, respectively. Unlike in topic coherence, which defines the probabil- ity of two words appearing together based on a simple word count, we should consider the relationship be- tween two sentences by leveraging their representation vector values. Hence, we replace the co-occurrence probability p(wi, wj) in topic coherence with the dot product of two sentence representation vectors because the dot product of two vectors is widely used as an unnormalized probability in many studies (Karpathy et al., 2014; Karpathy & Fei-Fei, 2015). Next, we re- place the marginal probability for word occurrence in topic coherence with the L2-norm of the sentence vec- tor, derived from the dot product. As a result, the score between two sentences takes a value between 0 and 1: the higher the score value, the stronger is the relationship between the two sentences. The equation representing the proposed score is as follows: Score(svi, svj) = (3) svi · svj ∥svi∥∥svj∥ , where svi and svj are the representation vectors of the sentences i and j, respectively. Finally, P-coherence is defined as the average score of all pairs of paraphrase sentences: P − coherence(Uk) = Average( svi, svj ∈ Uk, k = 1, ..., N, svi · svj ∥svi∥∥svj∥ ), (4) where Uk is the kth set of paraphrase sentences, and N is the number of paraphrase sets. For instance, if there Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition are four paraphrase sentences for each paraphrase set, then the P-coherence for each paraphrase set is calcu- lated as the average score of 4C2 = 6 sentence pairs. The total P-coherence is the average P-coherence for each paraphrase set: P − coherenceT otal = 1 N P − coherence(Uk). k=1 (5) N(cid:88) 4. Paraphrase thought 4.1. Model structure Assume that a sentence tuple (s, p) is given, where p is the paraphrase sentence of the sentence s. Let xt be the tth word of the sentence s and yt be the tth word of the sentence p. To maximize the semantic coherence defined above, it should be possible to generate both the sentence itself and its paraphrase sentence from the representation vector of an input sentence. There- fore, the proposed P-thought model is designed as a dual generation model, which generates both s and p simultaneously when the sentence tuple (s, p) is given. We employed an Seq2Seq structure with a gated re- current unit (GRU) (Cho et al., 2014) cell for the P- thought model. The encoder transforms the sequence of words of an input sentence into a fixed-sized rep- resentation vector, whereas the decoder generates the target sentence based on the given sentence represen- tation vector. The proposed P-thought model has two decoders. When the input sentence is given, the first decoder, named auto − decoder, generates the input sentence as it is. The second decoder, named paraphrase − decoder, generates the paraphrase sen- tence of the input sentence. 4.2. Objective Similar to other sequence learning tasks in NLP, the purpose of the P-thought model is to minimize the negative log likelihoods of the two decoders. Further- more, according to Hypothesis 1, the P-thought model should satisfy the condition that it can encode the sen- tence s and generate the sentences s and p simulta- neously when the sentence pair (s, p) is given. This condition can be written as follows: P (s)P (ss; θss) = P (s)P (ps; θsp), (6) where P (s) is the marginal probability of the input sentence s, and θss and θsp are the parameters of auto−decoder and paraphrase−decoder, respectively. Thus, similarly to the work of Xia et al. (2017), the problem can be formulated as the following multi- objective optimization problem: lA(f (s; θss), s), Objective 1 : min θss Objective 2 : min lP (f (s; θsp), p), θsp s.t P (s)P (ss; θss) = P (s)P (ps; θsp), (7) where lA and lP are the negative log likelihoods of auto−decoder and paraphrase−decoder, respectively. In this case, the constraint term can be rewritten as follows: − log P (ss; θss) = − log P (ps; θsp), (8) The left and right terms of transformed equation rep- resent the negative log likelihoods of auto − decoder and paraphrase − decoder, respectively. Hence, the constraint term can be written as follows: lA(f (s; θss), s) = lP (f (s; θsp), p). (9) By introducing the Lagrange multiplier, the multi- objective optimization problem is transformed into the following minimization problem: min L =lA(f (s; θss), s) + lP (f (s; θsp), p) − λ(lA(f (s; θss), s) − lP (f (s; θsp), p)) =(1 − λ)lA(f (s; θss), s) + (1 + λ)lP (f (s; θsp), p)), where λ = 0. (10) In this case, a value of λ > 1 or λ < −1 leads to max- imizing the negative log likelihood of auto − decoder and that of paraphrase − decoder, respectively. To avoid this problem, the allowable range for λ is set to −1 < λ < 0 or 0 < λ < 1. Under this condition, minimizing L is equivalent to minimizing L′: min L′ = lA(f (s; θss), s) + αlP (f (s; θsp), p), where α = 1 + λ 1 − λ , (11) where α is the hyperparameter of the P-thought model. This should be greater than 1 or be the value between 0 and 1, because −1 < λ < 0 and 0 < λ < 1. However, it is desirable to set the ap- propriate α-value to greater than 1, considering that auto decoding is trivial copying task which is much easier than paraphrase generation. Experimental re- sults also demonstrated that the performance is de- graded for small α value. Thus, the objective of the P- thought model is the sum of the negative log likelihood of auto − decoder with that of paraphrase − decoder with a higher weight: Loss = lauto(f (s; θss), s) + αlpara(f (s; θsp), p), where α > 1. (12) Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition (a) One-layer Bi-RNN encoder (b) Two-layer forward RNN (c) Two-layer BiRNN Figure 1. Three encoder structures of the P-thought model 4.3. Vocabulary expansion The number of unique words appearing in our train- ing dataset is only about 35,000, which is considerably fewer than the number of words in the English lan- guage. This may be problematic, in that many words are treated as out of vocabulary after model train- ing. To solve this problem, motivated by the idea of cross-lingual embedding (Mikolov et al., 2013a), Skip- thought attempts to learn a matrix that maps the words of a pretrained word2vec model (Mikolov et al., 2013b) to one of 20,000 words in their training dataset. However, this approach suffers from the problem that a word can be mapped to another word whose actual meaning is significantly different, only because it has a high similarity with the original word in the embed- ding space. For example, the word 'endogenous' was mapped to the word 'neuronal,' despite the semantic differences. We extracted the vector values of words that appear in our training dataset from the pretrained Glove vector (Pennington et al., 2014) to resolve the problem de- scribed above. In the pretrained Glove vectors, the se- mantic relationships between words are reflected in the geometrical structures between word vectors. There- fore, even when vector values of words that are un- Figure 2. P-thought model structure Table 1. Training data description 2014-Validation 2017-Training 118,284 591,753 Total 123,287 593,968 2,368,926 2,467,293 - 34,826 No. of unique images No. of unique captions No. of unique sentence pairs No. of unique words 40,504 202,654 811,426 - used during training occur, the information loss can be reduced because the geometric relationships between word vectors are well preserved if the model is suffi- ciently trained. By using this method, we are able to handle 2.1 million words without the effort of training an extra mapping matrix. 5. Experiments 5.1. Experimental settings We used the captions of the MS-COCO dataset (Lin et al., 2014) to train the P-thought model. This dataset has been employed in various paraphrase gen- eration studies (Prakash et al., 2016; Gupta et al., 2017). The MS-COCO dataset has more than five cap- tions for each image, which allows us to generate more than 5P2 = 20 unique sentence pairs. For training, we used the 2014-Validation and 2017-Training datasets. Descriptions of these datasets are provided in Table 1. Simple tokenizing was performed as text preprocessing for the captions. We employed three different encoder structures, as shown in Figure 1, to investigate the model perfor- ശ𝐡𝑻Ԧ𝐡𝑻𝐱1𝐱𝑇−1𝐱𝑇Encoder Bi-RNN……ForwardEncoder 1BackwardEncoder 1𝒉𝒆𝒏𝒄Concat…𝐱1𝐱𝑇−1𝐱𝑇Encoder RNNForwardEncoder 1…ForwardEncoder 2𝒉𝒆𝒏𝒄ConcatԦ𝐡𝑻,𝟏Ԧ𝐡𝑻,𝟐……ശ𝐡𝑻Ԧ𝐡𝑻𝐱1𝐱𝑇−1𝐱𝑇Encoder Bi-RNNForwardEncoder 1BackwardEncoder 1……ForwardEncoder 2BackwardEncoder 2𝒉𝒆𝒏𝒄Concat…<EOS>𝐱𝑇−1𝐱𝑇Auto Decoder𝐱1𝐱1𝐱T<EOS>𝐱2…Softmax……<EOS>𝐲𝑇−1𝐲𝑇Paraphrase Decoder𝒚1𝐲1𝐲𝑇<EOS>𝐲2…Softmax…Level 1Level 2Level 3One layer Bi-RNN EncoderTwo layer Forward-RNN EncoderTwo layerBi-RNN Encoder Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition Table 2. 2017-Validation dataset description No. of unique No. of unique images 5,000 captions 25,014 No. of unique sentence pair 100,142 No. of unique words 8,641 Table 3. Experimental coherence results for evaluating the P- Model PV-DBOW (Le & Mikolov, 2014) (Kiros et al., 2015) Uni-skip Bi-skip (Kiros et al., 2015) Combine-skip (Kiros et al., 2015) SIF (Arora et al., 2017) Sent2vec Wiki-uni (Pagliardini et al., 2017) Sent2vec Wiki-bi (Pagliardini et al., 2017) InferSent (Conneau et al., 2017a) P-thought (one layer-Bi RNN) P-thought (two layers-Forward RNN) P-thought (two layers-Bi RNN) P-coherence 0.0099 0.5328 0.5155 0.5209 0.4205 0.4279 0.4553 0.7454 0.7432 0.7899 0.9725 mances according to different levels of model complex- ity. The first encoder structure has one layer with a bi-directional RNN (Bi-RNN). The sentence embed- ding vector of this encoder structure consists of the concatenated values of the final state values of the for- ward and backward RNN. The second encoder struc- ture contains two layers, with only a forward RNN. The sentence embedding vector is generated by con- catenating the final states of both layers. The third encoder structure contains two layers of Bi-RNN. The sentence embedding vector is generated from the con- catenated values of the final states of the second layer's forward and backward RNNs. The overall structure of the P-thought model, including the decoder part, is illustrated in Figure 2. These three models were trained under the same conditions. The number of hidden units is set to 1,200, which results in 2,400- dimensional sentence embedding vectors after concate- nation. We employed Xavier initialization (Glorot & Bengio, 2010), and gradient computations and weight updates were performed with a mini-batch size of 128. All models were trained for four epochs using the Adam optimizer (Kingma & Ba, 2014). Table 4. Extracted sentences for visualization Group 1 (▲) 1) Bedroom scene with a bookcase, blue comforter and window. 2) A bedroom with a bookshelf full of books. 3) This room has a bed with blue sheets and a large book- case. 4) A bed and a mirror in a small room. 5) A bed room with a neatly made bed a window and a book shelf Group 2 (♦) 1) A male tennis player in white shorts is playing tennis. 2) This woman has just returned a volley in tennis. 3) A man holding a tennis racket playing tennis. 4) The man balances on one leg after serving a tennis ball. 5) Someone playing in a tennis tournament with a crowd looking on. Group 3 (■) 1) A woman holding a Hello Kitty phone on her hand. 2) A woman holds up her phone in front of her face. 3) A woman in white shirt holding up a cellphone. 4) A woman checking her cell phone with a hello kitty case. 5) The Asian girl is holding her Miss Kitty phone. Group 4 (×) 1) A plate of food which includes onions, tomato, lettuce, sauce, fries, and a sandwich. 2) A sandwich, french fries, bowl of ketchup, onion slice, lettuce slice, tomato slice, and knife sit on the white plate. 3) Partially eaten hamburger on a plate with fries and condiments. 4) A grilled chicken sandwich sits beside french fries made with real potatoes. 5) A sandwich on a sesame seed bun next to a pile of french fries and a cup of ketchup Group 5 (▼) 1) Decorated coffee cup and knife sitting on a patterned surface. 2) A large knife is sitting in front of a mug has a skull and crossbones. 3) A white mug showing pirate skull and bones and a large knife on a counter top. 4) There is a white coffee cup with a skull and bones on it next to a knife. 5) A close up of a knife and a cup on a surface 5.2. P-coherence To measure the P-coherence, we used the 2017- Validation dataset from the MS-COCO caption dataset, which has no overlap with the training dataset. A description of the dataset used for eval- uating the P-coherence is provided in Table 2. We se- lected PV-DBOW, Skip-thought, SIF, Sent2vec, and InferSent as benchmark models. In the case of PV- DBOW, we employed the datasets used for both train- ing P-thought and evaluating the P-coherence to learn the sentence vectors. For the remaining models, we used the publicly available pretrained models. Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition (a) Uni-skip (b) SIF (c) Sent2vec (Wiki-uni) (d) Sent2vec (Wiki-bi) (e) InferSent (f) P-thought (One-Bi) (g) P-thought (Two-Forward) (h) P-thought (Two-Bi) Figure 3. Scatter plots of the five paraphrase sentence groups represented by each sentence embedding method The experimental results are summarized in Table 3. It can be observed that the P-thought models with relatively complex encoder structures outperformed other benchmarked models. In the case of P-thought with a one-layer Bi-RNN, the P-coherence value is comparable to that of InferSent, and superior to the other benchmarked models. Among the benchmarked models, InferSent yielded a significantly higher P- coherence value than the other models, which implies that InferSent preserved the semantic coherence when learning the sentence representation vectors. In addition to the quantitative evaluation provided in Table 3, we reduced the generated sentence vectors to two-dimensional vectors using t-SNE (Maaten & Hin- ton, 2008) and created scatter plots to qualitatively investigate how effectively the paraphrase sentences satisfied coherence. For the sake of visualization, we extracted the paraphrase sentences for five images and marked them with different colors and shapes. The ex- tracted paraphrase sentences are presented in Table 4, and the scatter plots are given in Figure 3. It can easily be observed that paraphrase sentence vectors learned by the models with high P-coherence values (P-thought and InferSent) are more concentrated than those of the other models. 5.3. STS Benchmark task We also carried out the STS Benchmark task (Cer et al., 2017) to evaluate how well the models preserve the meanings of sentences through a more generally conducted task. The dataset for this task consists of Table 5. STS Benchmark task dataset description Total 8,628 Train 5,749 Dev 1,500 - # of data Test 1,379 8,628 sentence pairs and corresponding human rated similarity scores valued between 0 and 5. The purpose of this task is to approximate the similarity scores be- tween sentences based on the embedded vectors. A description of the dataset is summarized in Table 5. We conducted the experiment in the same manner as for InferSent. For two sentence vectors u and v, the component-wise product u · v and the absolute differ- ence u−v are computed and concatenated to be used as an input. As the target, the human rated similarity score y is transformed as follows. Let rT = [1, ..., 5] denote a vector that takes integer values between 1 and 5. The target y is transformed to the distribution d using the equation below: y − ⌊y⌋, ⌊y⌋ + 1, 0 di = if i = ⌊y⌋ + 1, if i = ⌊y⌋, otherwise. (13) Finally, we trained a logistic regression model that pre- dicts the transformed target d from the sentence pair representations of the training dataset. The results for the STS Benchmark test dataset are summarized in Table 6. Figure 4 presents a scatter plot of the results for the proposed models and the target y. The experimental results show that the P-thought models of all three levels outperformed the bench- Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition Table 6. Experimental results for the STS Benchmark task Model PV-DBOW Pearson correlation (Le & Mikolov, 2014) (Lau & Baldwin, 2016) SipThought (Kiros et al., 2015) (Arora et al., 2017) SIF Sent2vec InferSent (Pagliardini et al., 2017) (Conneau et al., 2017a) P-thought (one layer-Bi RNN) P-thought (two layers-Forward RNN) P-thought (two layers-Bi RNN) 0.649 0.721 0.720 0.755 0.758 0.812 0.797 0.764 marked models. An interesting observation is that the performances of the P-thought models for the STS benchmark task are inversely proportional to the model complexity: the simplest model (one-layer Bi RNN) yielded the highest correlation value, while the most complex model (two-layers Bi RNN) resulted in the lowest correlation value among the three P- thought models. This observation is exactly the op- posite of the result for the MS-COCO dataset, where the more complex the P-thought model, the higher is the P-coherence score. One possible reason for this reversed performances is that the MS-COCO cap- tion dataset used for the model training only con- tains around 600,000 sentences, which is far fewer than training datasets for general sequence learning tasks in the NLP field. Hence, it is more likely to overfit the training dataset for a more complex structure. This problem can be alleviated by obtaining more of para- phrase sentence pairs. 6. Conclusion Sentence embedding is one of the most important text processing techniques in NLP. To date, various sen- tence embedding models have been proposed and have yielded good performances in document classification and sentiment analysis tasks. However, the fundamen- tal ability of sentence embedding methods, i.e., how effectively the meanings of the original sentences are preserved in the embedded vectors, cannot be fully evaluated through such indirect methods. In this study, under the proposition that a good sen- tence embedding method should act similar to human language recognition, we suggested the concept of se- (a) One-layer BiRNN (b) Two-layer forward RNN (c) Two-layer BiRNN Figure 4. Scatter plot for the STS Benchmark task result mantic coherence and proposed a model named P- thought that aims to maximize the semantic coherence by designing a model to have a dual generation struc- ture. The proposed model was evaluated based on the MS-COCO caption and STS Benchmark datasets. Experimental results showed that the P-thought mod- els yielded better performances than the benchmarked models for both tasks. Based on the scatter plots in the two-dimensional space reduced by t-SNE, it can clearly be observed that the paraphrase sentences are more concentrated for the P-thought models than those us- ing other sentence embedding methods. The main limitation of the current work is that there are insufficient paraphrase sentences for training the models. P-thought models with more complex encoder structures tend to overfit the MS-COCO datasets. Al- though this problem can be resolved by acquiring more paraphrase sentences, it is not easy in practice to ob- tain a large number of paraphrase sentences. There- fore, similar to the approaches that have achieved good performances in machine translation by employ- ing semi-supervised learning or unsupervised learning (Cheng et al., 2016; Artetxe et al., 2017; Lample et al., 2017), an approach to improve the performances of the proposed models using only minimal paraphrase data should be developed. References Arora, Sanjeev, Liang, Yingyu, and Ma, Tengyu. A simple but tough-to-beat baseline for sentence embeddings. International conference on Learning Representations, 2017. Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition Artetxe, Mikel, Labaka, Gorka, Agirre, Eneko, and Cho, Kyunghyun. Unsupervised neural machine translation. arXiv preprint arXiv:1710.11041, 2017. Bowman, Samuel R, Angeli, Gabor, Potts, Christo- pher, and Manning, Christopher D. A large anno- tated corpus for learning natural language inference. arXiv preprint arXiv:1508.05326, 2015. Cer, Daniel, Diab, Mona, Agirre, Eneko, Lopez- Gazpio, Inigo, and Specia, Lucia. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual arXiv preprint arXiv:1708.00055, 2017. focused evaluation. Chen, Minmin. Efficient vector representation for arXiv preprint documents through corruption. arXiv:1707.02377, 2017. Cheng, Yong, Xu, Wei, He, Zhongjun, He, Wei, Wu, Hua, Sun, Maosong, and Liu, Yang. Semi- supervised learning for neural machine translation. arXiv preprint arXiv:1606.04596, 2016. Cho, Kyunghyun, Van Merriënboer, Bart, Gul- cehre, Caglar, Bahdanau, Dzmitry, Bougares, Fethi, Schwenk, Holger, and Bengio, Yoshua. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014. Conneau, Alexis, Kiela, Douwe, Schwenk, Holger, Barrault, Loic, and Bordes, Antoine. Supervised learning of universal sentence representations from natural arXiv preprint arXiv:1705.02364, 2017a. language inference data. Conneau, Alexis, Schwenk, Holger, Barrault, Loïc, and Lecun, Yann. Very deep convolutional networks for text classification. In Proceedings of the 15th Con- ference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Pa- pers, volume 1, pp. 1107 -- 1116, 2017b. Deng, Jia, Dong, Wei, Socher, Richard, Li, Li-Jia, Li, Kai, and Fei-Fei, Li. Imagenet: A large-scale hier- archical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Con- ference on, pp. 248 -- 255. IEEE, 2009. Glorot, Xavier and Bengio, Yoshua. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth Inter- national Conference on Artificial Intelligence and Statistics, pp. 249 -- 256, 2010. Gupta, Ankush, Agarwal, Arvind, Singh, Prawaan, A deep generative frame- arXiv preprint and Rai, Piyush. work for paraphrase generation. arXiv:1709.05074, 2017. Hill, Felix, Cho, Kyunghyun, and Korhonen, Learning distributed representations of arXiv preprint Anna. sentences from unlabelled data. arXiv:1602.03483, 2016. Huang, Eric H, Socher, Richard, Manning, Christo- pher D, and Ng, Andrew Y. Improving word rep- resentations via global context and multiple word prototypes. In Proceedings of the 50th Annual Meet- ing of the Association for Computational Linguis- tics: Long Papers-Volume 1, pp. 873 -- 882. Associa- tion for Computational Linguistics, 2012. Iyyer, Mohit, Manjunatha, Varun, Boyd-Graber, Jor- dan, and Daumé III, Hal. Deep unordered composi- tion rivals syntactic methods for text classification. In Proceedings of the 53rd Annual Meeting of the As- sociation for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pp. 1681 -- 1691, 2015. Karpathy, Andrej and Fei-Fei, Li. Deep visual- semantic alignments for generating image descrip- tions. the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3128 -- 3137, 2015. In Proceedings of Karpathy, Andrej, Joulin, Armand, and Fei-Fei, Li F. Deep fragment embeddings for bidirectional image sentence mapping. In Advances in neural informa- tion processing systems, pp. 1889 -- 1897, 2014. Kingma, Diederik and Ba, Jimmy. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Kiros, Ryan, Zhu, Yukun, Salakhutdinov, Ruslan R, Zemel, Richard, Urtasun, Raquel, Torralba, Anto- nio, and Fidler, Sanja. Skip-thought vectors. In Advances in neural information processing systems, pp. 3294 -- 3302, 2015. Lample, Guillaume, Denoyer, Ludovic, and Ranzato, Marc'Aurelio. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043, 2017. Lau, Jey Han and Baldwin, Timothy. An empirical evaluation of doc2vec with practical insights into document embedding generation. arXiv preprint arXiv:1607.05368, 2016. Paraphrase Thought: Sentence Embedding Module Imitating Human Language Recognition measures. In Proceedings of the eighth ACM inter- national conference on Web search and data mining, pp. 399 -- 408. ACM, 2015. Soumya George, K and Joseph, Shibily. Text classifi- cation by augmenting bag of words (bow) represen- tation with co-occurrence feature. IOSR Journal of Computer Engineering (IOSR-JCE) e-ISSN: 2278- 0661, p-ISSN: 2278-8727Volume, 16:34 -- 38, 2014. Wan, Shengxian, Lan, Yanyan, Guo, Jiafeng, Xu, Jun, Pang, Liang, and Cheng, Xueqi. A deep architec- ture for semantic matching with multiple positional sentence representations. In AAAI, volume 16, pp. 2835 -- 2841, 2016. Wieting, John, Bansal, Mohit, Gimpel, Kevin, Towards universal para- arXiv preprint and Livescu, Karen. phrastic sentence embeddings. arXiv:1511.08198, 2015. Xia, Yingce, Qin, Tao, Chen, Wei, Bian, Jiang, Yu, Nenghai, and Liu, Tie-Yan. Dual supervised learn- ing. arXiv preprint arXiv:1707.00415, 2017. Zhao, Shenjian and Zhang, Zhihua. Deep character- level neural machine translation by learning mor- phology. 2016. Zhou, Peng, Qi, Zhenyu, Zheng, Suncong, Xu, Ji- aming, Bao, Hongyun, and Xu, Bo. Text classi- fication improved by integrating bidirectional lstm with two-dimensional max pooling. arXiv preprint arXiv:1611.06639, 2016. Le, Quoc and Mikolov, Tomas. Distributed representa- tions of sentences and documents. In International Conference on Machine Learning, pp. 1188 -- 1196, 2014. Lee, Jason, Cho, Kyunghyun, and Hofmann, Thomas. Fully character-level neural machine translation without explicit segmentation. arXiv preprint arXiv:1610.03017, 2016. Lin, Tsung-Yi, Maire, Michael, Belongie, Serge, Hays, James, Perona, Pietro, Ramanan, Deva, Dollár, Pi- otr, and Zitnick, C Lawrence. Microsoft coco: Com- mon objects in context. In European conference on computer vision, pp. 740 -- 755. Springer, 2014. Maaten, Laurens van der and Hinton, Geoffrey. Visu- alizing data using t-sne. Journal of machine learning research, 9(Nov):2579 -- 2605, 2008. Mikolov, Tomas, Le, Quoc V, and Sutskever, Ilya. Ex- ploiting similarities among languages for machine translation. arXiv preprint arXiv:1309.4168, 2013a. Mikolov, Tomas, Sutskever, Ilya, Chen, Kai, Corrado, Greg S, and Dean, Jeff. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111 -- 3119, 2013b. Newman, David, Lau, Jey Han, Grieser, Karl, and Baldwin, Timothy. Automatic evaluation of topic coherence. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Lin- guistics, pp. 100 -- 108. Association for Computa- tional Linguistics, 2010. Pagliardini, Matteo, Gupta, Prakhar, and Jaggi, Mar- tin. Unsupervised learning of sentence embeddings using compositional n-gram features. arXiv preprint arXiv:1703.02507, 2017. Pennington, Jeffrey, Socher, Richard, and Manning, Christopher. Glove: Global vectors for word rep- resentation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532 -- 1543, 2014. Prakash, Aaditya, Hasan, Sadid A, Lee, Kathy, Datla, Vivek, Qadir, Ashequl, Liu, Joey, and Farri, Oladimeji. Neural paraphrase generation with stacked residual lstm networks. arXiv preprint arXiv:1610.03098, 2016. Röder, Michael, Both, Andreas, and Hinneburg, Alexander. Exploring the space of topic coherence
1609.09315
1
1609
2016-09-29T12:20:13
Semantic Parsing with Semi-Supervised Sequential Autoencoders
[ "cs.CL", "cs.AI", "cs.NE" ]
We present a novel semi-supervised approach for sequence transduction and apply it to semantic parsing. The unsupervised component is based on a generative model in which latent sentences generate the unpaired logical forms. We apply this method to a number of semantic parsing tasks focusing on domains with limited access to labelled training data and extend those datasets with synthetically generated logical forms.
cs.CL
cs
Semantic Parsing with Semi-Supervised Sequential Autoencoders Tom´as Kocisk´y†‡ G´abor Melis† Edward Grefenstette† Chris Dyer† Wang Ling† Phil Blunsom†‡ Karl Moritz Hermann† {tkocisky,melisgl,etg,cdyer,lingwang,pblunsom,kmh}@google.com †Google DeepMind ‡University of Oxford 6 1 0 2 p e S 9 2 ] L C . s c [ 1 v 5 1 3 9 0 . 9 0 6 1 : v i X r a Abstract We present a novel semi-supervised approach for sequence transduction and apply it to se- mantic parsing. The unsupervised component is based on a generative model in which latent sentences generate the unpaired logical forms. We apply this method to a number of semantic parsing tasks focusing on domains with lim- ited access to labelled training data and ex- tend those datasets with synthetically gener- ated logical forms. 1 Introduction Neural approaches, in particular attention-based sequence-to-sequence models, have shown great promise and obtained state-of-the-art performance for sequence transduction tasks including machine translation (Bahdanau et al., 2015), syntactic con- stituency parsing (Vinyals et al., 2015), and seman- tic role labelling (Zhou and Xu, 2015). A key re- quirement for effectively training such models is an abundance of supervised data. In this paper we focus on learning mappings from input sequences x to output sequences y in domains where the latter are easily obtained, but annotation in the form of (x, y) pairs is sparse or expensive to produce, and propose a novel architecture that ac- commodates semi-supervised training on sequence transduction tasks. To this end, we augment the transduction objective (x (cid:55)→ y) with an autoencod- ing objective where the input sequence is treated as a latent variable (y (cid:55)→ x (cid:55)→ y), enabling training from both labelled pairs and unpaired output sequences. This is common in situations where we encode nat- ural language into a logical form governed by some grammar or database. While such an autoencoder could in principle be constructed by stacking two sequence transduc- ers, modelling the latent variable as a series of dis- crete symbols drawn from multinomial distributions creates serious computational challenges, as it re- quires marginalising over the space of latent se- quences Σ∗ x. To avoid this intractable marginalisa- tion, we introduce a novel differentiable alternative for draws from a softmax which can be used with the reparametrisation trick of Kingma and Welling (2014). Rather than drawing a discrete symbol in Σx from a softmax, we draw a distribution over sym- bols from a logistic-normal distribution at each time step. These serve as continuous relaxations of dis- crete samples, providing a differentiable estimator of the expected reconstruction log likelihood. We demonstrate the effectiveness of our proposed model on three semantic parsing tasks: the GEO- QUERY benchmark (Zelle and Mooney, 1996; Wong and Mooney, 2006), the SAIL maze navigation task (MacMahon et al., 2006) and the Natural Language Querying corpus (Haas and Riezler, 2016) on Open- StreetMap. As part of our evaluation, we introduce simple mechanisms for generating large amounts of unsupervised training data for two of these tasks. In most settings, the semi-supervised model out- performs the supervised model, both when trained on additional generated data as well as on subsets of the existing data. Dataset GEO Example what are the high points of states surrounding mississippi answer(high point 1(state(next to 2(stateid('mississippi'))))) NLMAPS Where are kindergartens in Hamburg? query(area(keyval('name','Hamburg')),nwr(keyval('amenity','kindergarten')),qtype(latlong)) SAIL turn right at the bench into the yellow tiled hall (1, 6, 90) FORWARD - FORWARD - RIGHT - STOP (3, 6, 180) Table 1: Examples of natural language x and logical form y from the three corpora and tasks used in this paper. Note that the SAIL corpus requires additional information in order to map from the instruction to the action sequence. Figure 1: SEQ4 model with attention-sequence-to-sequence encoder and decoder. Circle nodes represent random variables. 2 Model Our sequential autoencoder is shown in Figure 1. At a high level, it can be seen as two sequence- to-sequence models with attention (Bahdanau et al., 2015) chained together. More precisely, the model consists of four LSTMs (Hochreiter and Schmid- huber, 1997), hence the name SEQ4. The first, a bidirectional LSTM, encodes the sequence y; next, an LSTM with stochastic output, described below, draws a sequence of distributions x over words in vocabulary Σx. The third LSTM encodes these dis- tributions for the last one to attend over and recon- struct y as y. We now give the details of these parts. 2.1 Encoding y The first LSTM of the encoder half of the model reads the sequence y, represented as a sequence of one-hot vectors over the vocabulary Σy, using a bidirectional RNN into a sequence of vectors hy where Ly is the sequence length of y, 1:Ly t =(cid:0)f hy y (yt, hy,→ → t−1 ); f y (yt, hy,← ← t+1 )(cid:1) , (1) y , f← where f→ are non-linear functions applied at each time step to the current token yt and their re- t−1 , hy,← current states hy,→ t+1 , respectively. y Both the forward and backward functions project the one-hot vector into a dense vector via an embed- ding matrix, which serves as input to an LSTM. 2.2 Predicting a Latent Sequence x Subsequently, we wish to predict x. Predicting a discrete sequence of symbols through draws from multinomial distributions over a vocabulary is not an option, as we would not be able to backpropa- gate through this discrete choice. Marginalising over the possible latent strings or estimating the gradient through naıve Monte Carlo methods would be a pro- hibitively high variance process because the num- ber of strings is exponential in the maximum length (which we would have to manually specify) with the vocabulary size as base. To allow backpropaga- tion, we instead predict a sequence of distributions x over the symbols of Σx with an RNN attending over y1y2y3y4<s><s>x1x2x3hy1hy2hy3hy4hx1hx2hx3hx1hx2hx3hy1hy2hy3hy4y1y2y3y4y1y2y3 2.3 Encoding x Moving on to the decoder part of our model, in the third LSTM, we embed2 and encode x: x (xt, hx,→ → t−1 ); f x (xt, hx,← ← (8) t =(cid:0)f hx t+1 )(cid:1) When x is observed, during supervised training and also when making predictions, instead of the distri- bution x we feed the one-hot encoded x to this part of the model. 2.4 Reconstructing y In the final LSTM, we decode into y: Ly(cid:89) p(yx) = p(yt{y1,··· , yt−1}, hx) (9) t=1 Equation 9 is implemented as an LSTM attending over hx producing a sequence of symbols y based on recurrent states hy, aiming to reproduce input y: t = fy(yt−1, hy hy t−1, hx) yt ∼ softmax(l (cid:48) (hy t )) (10) (11) where fy is the non-linear function, and the actual probabilities are given by a softmax function after a linear transformation l(cid:48) of hy. At training time, rather than yt−1 we feed the ground truth yt−1. 2.5 Loss function The complete model described in this section gives a reconstruction function y (cid:55)→ y. We define a loss on this reconstruction which accommodates the unsu- pervised case, where x is not observed in the train- ing data, and the supervised case, where (x, y) pairs are available. Together, these allow us to train the SEQ4 model in a semi-supervised setting, which ex- periments will show provides some benefits over a purely supervised training regime. Unsupervised case When x isn't observed, the loss we minimise during training is the recon- struction loss on y, expressed as the negative log- likelihood N LL(y, y) of the true labels y relative to the predictions y. To this, we add as a regularising 2Multiplying the distribution over words and an embedding matrix averages the word embedding of the entire vocabulary weighted by their probabilities. Figure 2: Unsupervised case of the SEQ4 model. Lx(cid:89) hy = hy 1:Ly , which will later serve to reconstruct y: x = q(xy) = q(xt{x1,··· , xt−1}, hy) (2) t=1 where q(xy) models the mapping y (cid:55)→ x. We define q(xt{x1,··· , xt−1}, hy) in the following way: Let the vector xt be a distribution over the vocabu- lary Σx drawn from a logistic-normal distribution1, the parameters of which, µt, log(σ2)t ∈ RΣx, are predicted by attending by an LSTM attending over the outputs of the encoder (Equation 2), where Σx is the size of the vocabulary Σx. The use of a logis- tic normal distribution serves to regularise the model in the semi-supervised learning regime, which is de- scribed at the end of this section. Formally, this pro- cess, depicted in Figure 2, is as follows: t−1, hy) hx t = fx(xt−1, hx t ) = l(hx µt, log(σ2 t )  ∼ N (0, I) γt = µt + σt xt = softmax(γt) (3) (4) (5) (6) (7) where the fx function is an LSTM and l a linear transformation to R2Σx. We use the reparametrisa- tion trick from Kingma and Welling (2014) to draw from the logistic normal, allowing us to backpropa- gate through the sampling process. 1The logistic-normal distribution is the exponentiated and normalised (i.e. taking softmax) normal distribution. y1y2y3y4<s>x1x2µ2,log(2)2µ1,log(2)1x3µ3,log(2)3✏1✏2✏3hx1hx2hx3hx1hx2hx3hy1hy2hy3hy4hy1hy2hy3hy4<s>y1y2y3y4y1y2y3 term the KL divergence KL[q(γy)(cid:107)p(γ)] which ef- fectively penalises the mean and variance of q(γy) from diverging from those of a prior p(γ), which we model as a diagonal Gaussian N (0, I). This has the effect of smoothing the logistic normal distribu- tion from which we draw the distributions over sym- bols of x, guarding against overfitting of the latent distributions over x to symbols seen in the super- vised case discussed below. The unsupervised loss is therefore formalised as Lunsup = N LL(y, y) + αKL[q(γy)(cid:107)p(γ)] with regularising factor α is tuned on validation, and (12) Lx(cid:88) KL[q(γy)(cid:107)p(γ)] = KL[q(γiy)(cid:107)p(γ)] (13) i=1 We use a closed form of these individual KL diver- gences, described by Kingma and Welling (2014). Supervised case When x is observed, we addi- tionally minimise the prediction loss on x, expressed as the negative log-likelihood N LL(x, x) of the true labels x relative to the predictions x, and do not im- pose the KL loss. The supervised loss is thus Lsup = N LL(x, x) + N LL(y, y) (14) In both the supervised and unsupervised case, be- cause of the continuous relaxation on generating x and the reparameterisation trick, the gradient of the losses with regard to the model parameters is well defined throughout SEQ4. Semi-supervised training and inference We train with a weighted combination of the supervised and unsupervised losses described above. Once trained, we simply use the x (cid:55)→ y decoder segment of the model to predict y from sequences of sym- bols x represented as one-hot vectors. When the de- coder is trained without the encoder in a fully super- vised manner, it serves as our supervised sequence- to-sequence baseline model under the name S2S. 3 Tasks and Data Generation We apply our model to three tasks outlined in this section. Moreover, we explain how we generated ad- ditional unsupervised training data for two of these tasks. Examples from all datasets are in Table 1. 3.1 GeoQuery The first task we consider is the prediction of a query on the GEO corpus which is a frequently used bench- mark for semantic parsing. The corpus contains 880 questions about US geography together with exe- cutable queries representing those questions. We follow the approach established by Zettlemoyer and Collins (2005) and split the corpus into 600 training and 280 test cases. Following common practice, we augment the dataset by referring to the database dur- ing training and test time. In particular, we use the database to identify and anonymise variables (cities, states, countries and rivers) following the method described in Dong and Lapata (2016). Most prior work on the GEO corpus relies on stan- dard semantic parsing methods together with custom heuristics or pipelines for this corpus. The recent pa- per by Dong and Lapata (2016) is of note, as it uses a sequence-to-sequence model for training which is the unidirectional equivalent to S2S, and also to the decoder part of our SEQ4 network. 3.2 Open Street Maps The second task we tackle with our model is the NLMAPS dataset by Haas and Riezler (2016). The dataset contains 1,500 training and 880 testing in- stances of natural language questions with corre- sponding machine readable queries over the geo- graphical OpenStreetMap database. The dataset contains natural language question in both English and German but we focus only on single language semantic parsing, similar to the first task in Haas and Riezler (2016). We use the data as it is, with the only pre-processing step being the tokenization of both natural language and query form3. 3.3 Navigational Instructions to Actions The SAIL corpus and task were developed to train agents to follow free-form navigational route in- structions in a maze environment (MacMahon et al., 2006; Chen and Mooney, 2011). It consists of a small number of mazes containing features such as objects, wall and floor types. These mazes come to- gether with a large number of human instructions paired with the required actions4 to reach the goal 3We removed quotes, added spaces around (), and sepa- rated the question mark from the last word in each question. 4There are four actions: LEFT, RIGHT, GO, STOP. state described in those instructions. We use the sentence-aligned version of the SAIL route instruction dataset containing 3,236 sentences (Chen and Mooney, 2011). Following previous work, we accept an action sequence as correct if and only if the final position and orientation exactly match those of the gold data. We do not perform any pre-processing on this dataset. 3.4 Data Generation As argued earlier, we are focusing on tasks where aligned data is sparse and expensive to obtain, while it should be cheap to get unsupervised, monomodal data. Albeit that is a reasonable assumption for real world data, the datasets considered have no such component, thus the approach taken here is to gen- erate random database queries or maze paths, i.e. the machine readable side of the data, and train a semi-supervised model. The alternative not ex- plored here would be to generate natural language questions or instructions instead, but that is more difficult to achieve without human intervention. For this reason, we generate the machine readable side of the data for GEOQUERY and SAIL tasks5. For GEOQUERY, we fit a 3-gram Kneser-Ney (Chen and Goodman, 1999) model to the queries in the training set and sample about 7 million queries from it. We ensure that the sampled queries are dif- ferent from the training queries, but do not enforce validity. This intentionally simplistic approach is to demonstrate the applicability of our model. The SAIL dataset has only three mazes. We added a fourth one and over 150k random paths, in- cluding duplicates. The new maze is larger (21 × 21 grid) than the existing ones, and seeks to approxi- mately replicate the key statistics of the other three mazes (maximum corridor length, distribution of ob- jects, etc). Paths within that maze are created by randomly sampling start and end positions. 4 Experiments We evaluate our model on the three tasks in multiple settings. First, we establish a supervised baseline to compare the S2S model with prior work. Next, we 5Our be can publications randomly downloaded generated datasets from http://deepmind.com/ unsupervised Model Zettlemoyer and Collins (2005) Zettlemoyer and Collins (2007) Liang et al. (2013) Kwiatkowski et al. (2011) Zhao and Huang (2014) Kwiatkowski et al. (2013) Dong and Lapata (2016) Jia and Liang (2016)6 S2S SEQ4 Accuracy 79.3 86.1 87.9 88.6 88.9 89.0 84.6 89.3 86.5 87.3 Table 2: Non-neural and neural model results on GEOQUERY using the train/test split from (Zettlemoyer and Collins, 2005). train our SEQ4 model in a semi-supervised setting on the entire dataset with the additional monomodal training data described in the previous section. Finally, we perform an "ablation" study where we discard some of the training data and compare S2S to SEQ4. S2S is trained solely on the reduced data in a supervised manner, while SEQ4 is once again trained semi-supervised on the same reduced data plus the machine readable part of the discarded data (SEQ4-) or on the extra generated data (SEQ4+). Training We train the model using standard gra- dient descent methods. As none of the datasets used here contain development sets, we tune hyperparam- eters by cross-validating on the training data. In the case of the SAIL corpus we train on three folds (two mazes for training and validation, one for test each) and report weighted results across the folds follow- ing prior work (Mei et al., 2016). 4.1 GeoQuery The evaluation metric for GEOQUERY is the ac- curacy of exactly predicting the machine readable query. As results in Table 2 show, our supervised S2S baseline model performs slightly better than the comparable model by Dong and Lapata (2016). The semi-supervised SEQ4 model with the addi- tional generated queries improves on it further. The ablation study in Table 3 demonstrates a widening gap between supervised and semi- 6Jia and Liang (2016) used hand crafted grammars to gener- ate additional supervised training data. Sup. data 5% 10% 25% 50% 75% 100% S2S 21.9 39.7 62.4 80.3 85.3 86.5 SEQ4- 30.1 42.1 70.4 81.2 84.1 86.5 SEQ4+ 26.2 42.1 67.1 80.4 85.1 87.3 Sup. data 5% 10% 25% 50% 75% 100% S2S 3.22 17.61 33.74 49.52 66.93 78.03 SEQ4- 3.74 17.12 33.50 53.72 66.45 78.03 Table 3: Results of the GEOQUERY ablation study. Table 5: Results of the NLMAPS ablation study. Accuracy Model 68.30 Haas and Riezler (2016) S2S 78.03 Table 4: Results on the NLMAPS corpus. supervised as the amount of labelled training data gets smaller. This suggests that our model can lever- age unlabelled data even when only small amount of labelled data is available. 4.2 Open Street Maps We report results for the NLMAPS corpus in Table 4, comparing the supervised S2S model to the results posted by Haas and Riezler (2016). While their model used a semantic parsing pipeline including alignment, stemming, language modelling and CFG inference, the strong performance of the S2S model demonstrates the strength of fairly vanilla attention- based sequence-to-sequence models. It should be pointed out that the previous work reports the num- ber of correct answers when queries were executed against the dataset, while we evaluate on the strict accuracy of the generated queries. While we expect these numbers to be nearly equivalent, our evalua- tion is strictly harder as it does not allow for reorder- ing of query arguments and similar relaxations. We investigate the SEQ4 model only via the abla- tion study in Table 5 and find little gain through the semi-supervised objective. Our attempt at cheaply generating unsupervised data for this task was not successful, likely due to the complexity of the un- derlying database. 4.3 Navigational Instructions to Actions Model extension The experiments for the SAIL task differ slightly from the other two tasks in that the language input does not suffice for choosing an action. While a simple instruction such as 'turn left' can easily be translated into the action sequence LEFT-STOP, more complex instructions such as 'Walk forward until you see a lamp' require knowl- edge of the agent's position in the maze. To accomplish this we modify the model as fol- lows. First, when encoding action sequences, we concatenate each action with a representation of the maze at the given position, representing the maze- state akin to Mei et al. (2016) with a bag-of-features vector. Second, when decoding action sequences, the RNN outputs an action which is used to update the agent's position and the representation of that new position is fed into the RNN as its next input. Training regime We cross-validate over the three mazes in the dataset and report overall results weighted by test size (cf. Mei et al. (2016)). Both our supervised and semi-supervised model perform worse than the state-of-the-art (see Table 6), but the latter enjoys a comfortable margin over the former. As the S2S model broadly reimplements the work of Mei et al. (2016), we put the discrepancy in per- formance down to the particular design choices that we did not follow in order to keep the model here as general as possible and comparable across tasks. The ablation studies (Table 7) show little gain for the semi-supervised approach when only using data from the original training set, but substantial im- provement with the additional unsupervised data. 5 Discussion Supervised training The prediction accuracies of our supervised baseline S2S model are mixed with respect to prior results on their respective tasks. For GEOQUERY, S2S performs significantly better than the most similar model from the literature (Dong and Lapata, 2016), mostly due to the fact that y and x are Input from unsupervised data (y) answer smallest city loc 2 state stateid STATE answer city loc 2 state next to 2 stateid STATE Generated latent representation (x) what is the smallest city in the state of STATE </S> what are the cities in states which border STATE </S> answer mountain loc 2 countryid COUNTRY answer state next to 2 state all what is the lakes in COUNTRY </S> which states longer states show peak states to </S> Table 8: Positive and negative examples of latent language together with the randomly generated logical form from the unsupervised part of the GEOQUERY training. Note that the natural language (x) does not occur anywhere in the training data in this form. Model Chen and Mooney (2011) Kim and Mooney (2012) Andreas and Klein (2015) Kim and Mooney (2013) Artzi et al. (2014) Artzi and Zettlemoyer (2013) Mei et al. (2016) S2S SEQ4 Accuracy 54.40 57.22 59.60 62.81 64.36 65.28 69.98 58.60 63.25 Table 6: Results on the SAIL corpus. Sup. data 5% 10% 25% 50% 75% 100% S2S 37.79 40.77 43.76 48.01 48.99 49.49 SEQ4- 41.48 41.26 43.95 49.42 49.20 49.49 SEQ4+ 43.44 48.67 51.19 55.97 57.40 58.28 Table 7: Results of the SAIL ablation study. Results are from models trained on L and Jelly maps, tested on Grid only, hence the discrepancy between the 100% result and S2S in Table 6. encoded with bidirectional LSTMs. With a unidirec- tional LSTM we get similar results to theirs. On the SAIL corpus, S2S performs worse than the state of the art. As the models are broadly equiv- alent we attribute this difference to a number of task- specific choices and optimisations7 made in Mei et al. (2016) which we did not reimplement for the sake of using a common model across all three tasks. For NLMAPS, S2S performs much better than the state-of-the-art, exceeding the previous best result by 11% despite a very simple tokenization method 7In particular we don't use beam search and ensembling. and a lack of any form of entity anonymisation. Semi-supervised training In both the case of GEOQUERY and the SAIL task we found the semi- supervised model to convincingly outperform the fully supervised model. The effect was particu- larly notable in the case of the SAIL corpus, where performance increased from 58.60% accuracy to 63.25% (see Table 6). It is worth remembering that the supervised training regime consists of three folds of tuning on two maps with subsequent testing on the third map, which carries a risk of overfitting to the training maps. The introduction of the fourth unsupervised map clearly mitigates this effect. Ta- ble 8 shows some examples of unsupervised logi- cal forms being transformed into natural language, which demonstrate how the model can learn to sen- sibly ground unsupervised data. Ablation performance The experiments with ad- ditional unsupervised data prove the feasibility of our approach and clearly demonstrate the useful- ness of the SEQ4 model for the general class of sequence-to-sequence tasks where supervised data is hard to come by. To analyse the model fur- ther, we also look at the performance of both S2S and SEQ4 when reducing the amount of supervised training data available to the model. We compare three settings: the supervised S2S model with re- duced training data, SEQ4- which uses the removed training data in an unsupervised fashion (throwing away the natural language) and SEQ4+ which uses the randomly generated unsupervised data described in Section 3. The S2S model behaves as expected on all three tasks, its performance dropping with the size of the training data. The performance of SEQ4- and SEQ4+ requires more analysis. In the case of GEOQUERY, having unlabelled data from the true distribution (SEQ4-) is a good thing when there is enough of it, as clearly seen when only 5% of the original dataset is used for supervised training and the remaining 95% is used for unsuper- vised training. The gap shrinks as the amount of supervised data is increased, which is as expected. On the other hand, using a large amount of extra, generated data from an approximating distribution (SEQ4+) does not help as much initially when com- pared with the unsupervised data from the true dis- tribution. However, as the size of the unsupervised dataset in SEQ4- becomes the bottleneck this gap closes and eventually the model trained on the ex- tra data achieves higher accuracy. For the SAIL task the semi-supervised models do better than the supervised results throughout, with the model trained on randomly generated additional data consistently outperforming the model trained only on the original data. This gives further credence to the risk of overfitting to the training mazes already mentioned above. Finally, in the case of the NLMAPS corpus, the semi-supervised approach does not appear to help much at any point during the ablation. These indis- tinguishable results are likely due to the task's com- plexity, causing the ablation experiments to either have to little supervised data to sufficiently ground the latent space to make use of the unsupervised data, or in the higher percentages then too little un- supervised data to meaningfully improve the model. 6 Related Work Semantic parsing The tasks in this paper all broadly belong to the domain of semantic parsing, which describes the process of mapping natural lan- guage to a formal representation of its meaning. This is extended in the SAIL navigation task, where the formal representation is a function of both the language instruction and a given environment. Semantic parsing is a well-studied problem with numerous approaches including inductive logic programming (Zelle and Mooney, 1996), string- to-tree (Galley et al., 2004) and string-to-graph (Jones et al., 2012) transducers, grammar induction (Kwiatkowski et al., 2011; Artzi and Zettlemoyer, 2013; Reddy et al., 2014) or machine translation (Wong and Mooney, 2006; Andreas et al., 2013). While a large number of relevant literature fo- cuses on defining the grammar of the logical forms (Zettlemoyer and Collins, 2005), other models learn purely from aligned pairs of text and logical form (Berant and Liang, 2014), or from more weakly su- pervised signals such as question-answer pairs to- gether with a database (Liang et al., 2011). Recent work of Jia and Liang (2016) induces a synchronous context-free grammar and generates additional train- ing examples (x, y), which is one way to address data scarcity issues. The semi-supervised setup pro- posed here offers an alternative solution to this issue. Discrete autoencoders Very recently there has been some related work on discrete autoencoders for natural language processing (Suster et al., 2016; i.a.) This work Marcheggiani and Titov, 2016, presents a first approach to using effectively dis- cretised sequential information as the latent rep- resentation without resorting to draconian assump- tions (Ammar et al., 2014) to make marginalisation tractable. While our model is not exactly marginalis- able either, the continuous relaxation makes training far more tractable. A related idea was recently pre- sented in Gulc¸ehre et al. (2015), who use monolin- gual data to improve machine translation by fusing a sequence-to-sequence model and a language model. 7 Conclusion We described a method for augmenting a supervised sequence transduction objective with an autoen- coding objective, thereby enabling semi-supervised training where previously a scarcity of aligned data might have held back model performance. Across multiple semantic parsing tasks we demonstrated the effectiveness of this approach, improving model per- formance by training on randomly generated unsu- pervised data in addition to the original data. Going forward it would be interesting to fur- ther analyse the effects of sampling from a logistic- normal distribution as opposed to a softmax in or- der to better understand how this impacts the dis- tribution in the latent space. While we focused on tasks with little supervised data and additional un- supervised data in y, it would be straightforward to reverse the model to train it with additional labelled data in x, i.e. on the natural language side. A natural extension would also be a formulation where semi- supervised training was performed in both x and y. For instance, machine translation lends itself to such a formulation where for many language pairs paral- lel data may be scarce while there is an abundance of monolingual data. References Waleed Ammar, Chris Dyer, and Noah A. Smith. 2014. Conditional Random Field Autoencoders for Unsuper- vised Structured Prediction. In Proceedings of NIPS. Jacob Andreas and Dan Klein. 2015. Alignment-based Compositional Semantics for Instruction Following. In Proceedings of EMNLP, September. Jacob Andreas, Andreas Vlachos, and Stephen Clark. In 2013. Semantic Parsing as Machine Translation. Proceedings of ACL, August. Yoav Artzi and Luke Zettlemoyer. 2013. Weakly Super- vised Learning of Semantic Parsers for Mapping In- structions to Actions. Transactions of the Association for Computational Linguistics, 1(1):49–62. Yoav Artzi, Dipanjan Das, and Slav Petrov. 2014. Learn- ing Compact Lexicons for CCG Semantic Parsing. In Proceedings of EMNLP, October. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural Machine Translation by Jointly In Proceedings of Learning to Align and Translate. ICLR. Jonathan Berant and Percy Liang. 2014. Semantic Pars- ing via Paraphrasing. In Proceedings of ACL, June. Stanley F Chen and Joshua Goodman. 1999. An empir- ical study of smoothing techniques for language mod- eling. Computer Speech & Language, 13(4):359–393. David L. Chen and Raymond J. Mooney. 2011. Learning to Interpret Natural Language Navigation Instructions from Observations. In Proceedings of AAAI, August. Language to Logical Form with Neural Attention. arXiv preprint arXiv:1601.01280. Li Dong and Mirella Lapata. 2016. Michel Galley, Mark Hopkins, Kevin Knight, and Daniel Marcu. 2004. What's in a translation rule? In Pro- ceedings of HLT-NAACL, May. C¸ aglar Gulc¸ehre, Orhan Firat, Kelvin Xu, Kyunghyun Cho, Loıc Barrault, Huei-Chi Lin, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2015. On Us- ing Monolingual Corpora in Neural Machine Transla- tion. arXiv preprint arXiv:1503.03535. Carolin Haas and Stefan Riezler. 2016. A corpus and se- mantic parser for multilingual natural language query- ing of openstreetmap. In Proceedings of NAACL, June. 1997. Neural Computation, Sepp Hochreiter and Jurgen Schmidhuber. Long Short-Term Memory. 9(8):1735–1780, November. Robin Jia and Percy Liang. 2016. Data recombination for neural semantic parsing. In Association for Com- putational Linguistics (ACL). Bevan Jones, Jacob Andreas, Daniel Bauer, Karl Moritz Semantics- Hermann, and Kevin Knight. Based Machine Translation with Hyperedge Replace- In Proceedings of COLING 2012, ment Grammars. December. 2012. Joohyun Kim and Raymond J. Mooney. 2012. Unsuper- vised PCFG Induction for Grounded Language Learn- ing with Highly Ambiguous Supervision. In Proceed- ings of EMNLP-CoNLL, July. Joohyun Kim and Raymond Mooney. 2013. Adapt- ing Discriminative Reranking to Grounded Language Learning. In Proceedings of ACL, August. Diederik P. Kingma and Max Welling. 2014. Auto- Encoding Variational Bayes. In Proceedings of ICLR. Tom Kwiatkowski, Luke Zettlemoyer, Sharon Goldwater, and Mark Steedman. 2011. Lexical Generalization in CCG Grammar Induction for Semantic Parsing. In Proceedings of EMNLP. Tom Kwiatkowski, Eunsol Choi, Yoav Artzi, and Luke Zettlemoyer. 2013. Scaling semantic parsers with In In Proceedings of on-the-fly ontology matching. EMNLP. Citeseer. Percy Liang, Michael I. Jordan, and Dan Klein. 2011. Learning Dependency-based Compositional Seman- tics. In Proceedings of the ACL-HLT. Percy Liang, Michael I Jordan, and Dan Klein. 2013. Learning dependency-based compositional semantics. Computational Linguistics, 39(2):389–446. Matt MacMahon, Brian Stankiewicz, and Benjamin Kuipers. 2006. Walk the Talk: Connecting Language, Knowledge, and Action in Route Instructions. In Pro- ceedings of AAAI. Diego Marcheggiani and Ivan Titov. 2016. Discrete-state variational autoencoders for joint discovery and factor- ization of relations. Transactions of ACL. Hongyuan Mei, Mohit Bansal, and Matthew R. Walter. 2016. Listen, Attend, and Walk: Neural Mapping of Navigational Instructions to Action Sequences. In Proceedings of AAAI. Siva Reddy, Mirella Lapata, and Mark Steedman. 2014. Large-scale Semantic Parsing without Question- Answer Pairs. Transactions of the Association for Computational Linguistics, 2:377–392. Simon Suster, Ivan Titov, and Gertjan van Noord. 2016. Bilingual Learning of Multi-sense Embeddings with Discrete Autoencoders. CoRR, abs/1603.09128. Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. 2015. Grammar as a Foreign Language. In Proceedings of NIPS. Yuk Wah Wong and Raymond J. Mooney. 2006. Learn- ing for Semantic Parsing with Statistical Machine Translation. In Proceedings of NAACL. John M. Zelle and Raymond J. Mooney. 1996. Learning to Parse Database Queries using Inductive Logic Pro- gramming. In Proceedings of AAAI/IAAI, pages 1050– 1055, August. Luke S. Zettlemoyer and Michael Collins. 2005. Learn- ing to Map Sentences to Logical Form: Structured Classification with Probabilistic Categorial Grammars. In UAI, pages 658–666. AUAI Press. Luke Zettlemoyer and Michael Collins. 2007. Online Learning of Relaxed CCG Grammars for Parsing to In Proceedings of EMNLP-CoNLL, Logical Form. June. Kai Zhao and Liang Huang. 2014. Type-driven incre- mental semantic parsing with polymorphism. arXiv preprint arXiv:1411.5379. Jie Zhou and Wei Xu. 2015. End-to-end Learning of Semantic Role Labeling Using Recurrent Neural Net- works. In Proceedings of ACL.
1606.07046
2
1606
2016-09-24T00:37:43
Semantic Parsing to Probabilistic Programs for Situated Question Answering
[ "cs.CL" ]
Situated question answering is the problem of answering questions about an environment such as an image or diagram. This problem requires jointly interpreting a question and an environment using background knowledge to select the correct answer. We present Parsing to Probabilistic Programs (P3), a novel situated question answering model that can use background knowledge and global features of the question/environment interpretation while retaining efficient approximate inference. Our key insight is to treat semantic parses as probabilistic programs that execute nondeterministically and whose possible executions represent environmental uncertainty. We evaluate our approach on a new, publicly-released data set of 5000 science diagram questions, outperforming several competitive classical and neural baselines.
cs.CL
cs
Semantic Parsing to Probabilistic Programs for Situated Question Answering Jayant Krishnamurthy and Oyvind Tafjord and Aniruddha Kembhavi Allen Institute for Artificial Intelligence jayantk,oyvindt,[email protected] 6 1 0 2 p e S 4 2 ] L C . s c [ 2 v 6 4 0 7 0 . 6 0 6 1 : v i X r a Abstract Situated question answering is the problem of answering questions about an environment such as an image or diagram. This problem requires jointly interpreting a question and an environment using background knowledge to select the correct answer. We present Parsing to Probabilistic Programs (P 3), a novel situ- ated question answering model that can use background knowledge and global features of the question/environment interpretation while retaining efficient approximate inference. Our key insight is to treat semantic parses as prob- abilistic programs that execute nondetermin- istically and whose possible executions repre- sent environmental uncertainty. We evaluate our approach on a new, publicly-released data set of 5000 science diagram questions, outper- forming several competitive classical and neu- ral baselines. Introduction 1 Situated question answering is a challenging prob- lem that requires reasoning about uncertain inter- pretations of both a question and an environment together with background knowledge to determine the answer. To illustrate these challenges, consider the 8th grade science diagram questions in Figure 1, which are motivated by the Aristo project (Clark and Etzioni, 2016). These questions require both com- puter vision to interpret the diagram and composi- tional question understanding. These components, being imperfect, introduce uncertainty that must be jointly reasoned about to avoid implausible interpre- tations. These uncertain interpretations must further 1. According to the given food chain, what is the num- ber of organisms that eat deer? (A) 3 (B) 2 (C) 4 (D) 1 2. Which organism is both predator and prey? (A) Bark Beetles (B) Insect-eating birds (C) Deer (D) Hawks 3. Based on the given food web, what would happen if there were no insect-eating birds? (A) The grasshop- per population would increase. (B) The grasshop- per population would decrease. (C) There would be no change in grasshopper number. Figure 1: Example food web questions. A food web depicts a collection of organisms in an ecosystem with an arrow from organism x to y indicating that y eats x. Questions may require counting (1), knowing animal roles (2) and reasoning about population changes (3). be combined with background knowledge, such as the definition of a "predator," to determine the cor- rect answer. The challenges of situated question answering have not been completely addressed by prior work. Early "possible worlds" models (Matuszek et al., 2012; Krishnamurthy and Kollar, 2013; Mali- nowski and Fritz, 2014) were capable of composi- tional question understanding and using background knowledge, but did not jointly reason about environ- ment/question uncertainty. These models also used unscalable inference algorithms for reasoning about the environment, despite the lack of joint reasoning. More recent neural models (Antol et al., 2015; Mali- nowski et al., 2015; Yang et al., 2015) are incapable of using background knowledge and it remains un- clear to what extent these models can represent com- positionality in language. We present Parsing to Probabilistic Programs (P 3), a novel approach to situated question answer- ing that addresses these challenges. It is motivated by two observations: (1) situated question answer- ing can be formulated as semantic parsing with an execution model that is a learned function of the environment, and (2) probabilistic programming is a natural and powerful method for specifying the space of permissible execution models and learning over it. In P 3, we define a domain theory for the task as a probabilistic program, then train a joint loglin- ear model to semantically parse questions to logi- cal forms in this theory and execute them in an en- vironment. Importantly, the model includes global features over parsing and execution that enable it to avoid unlikely joint configurations. P 3 lever- ages semantic parsing to represent compositionality in language and probabilistic programming to spec- ify background knowledge and perform linear-time approximate inference over the environment. We present an experimental evaluation of P 3 on a new data set of 5000 food web diagram questions (Figure 1). We compare our approach to several baselines, including possible worlds and neural net- work approaches, finding that P 3 outperforms both. An ablation study demonstrates that global features help the model achieve high accuracy. We also demonstrate that P 3 improves accuracy on a previ- ously published data set. Finally, we have released our data and code to facilitate further research. 2 Prior Work Situated question answering is often formulated in terms of parsing both the question and environment into a common meaning representation where they can be combined to select the answer. This gen- eral approach has been implemented using different meaning representations: Possible world models use a logical meaning representation defined by a knowledge base schema. These models train a semantic parser to map ques- tions to queries and an environment model to map environments to knowledge bases in this schema. Executing the queries against the knowledge bases produces answers. These models assume that the parser and environment model are independent and furthermore that the knowledge base consists of independent predicate instances (Matuszek et al., 2012; Krishnamurthy and Kollar, 2013; Malinowski and Fritz, 2014). Despite these strong independence assumptions, these models have intractable infer- ence. An exception is Seo et al., (2015) who in- corporate hard constraints on the joint question/envi- ronment interpretation; however, this approach does not generalize to soft constraints or arbitrary logical forms. In some work only the environment model is learned (Kollar et al., 2010; Tellex et al., 2011; Howard et al., 2014b; Howard et al., 2014a; Berant et al., 2014; Krishnamurthy and Mitchell, 2015). Neural networks use a vector meaning repre- sentation that encodes both the question and envi- ronment as vectors. These networks have mostly been applied to visual question answering (Antol et al., 2015), where many architectures have been pro- posed (Malinowski et al., 2015; Yang et al., 2015; Fukui et al., 2016). It is unclear to what extent these networks can represent compositionality in language using their vector encodings. Dynamic Neural Mod- ule Networks (Andreas et al., 2016a; Andreas et al., 2016b) are the exception to the above generaliza- tion. This approach constructs a neural network to represent the meaning of the question via semantic parsing, then executes this network against the im- age to produce an answer. Our approach is similar except that we construct and execute a probabilistic program. Advantages of our approach are that it nat- urally represents the discrete structure of food webs and can use background knowledge. Preliminaries for our work are semantic pars- ing and probabilistic programming. Semantic pars- ing translates natural language questions into exe- cutable logical forms and has been used in applica- tions such as question answering against a knowl- edge base (Zelle and Mooney, 1993; Zettlemoyer and Collins, 2005; Liang et al., 2011; Kwiatkowski et al., 2013; Berant et al., 2013; Reddy et al., 2014; Yih et al., 2015; Xu et al., 2016), direction following (Chen and Mooney, 2011; Artzi and Zettlemoyer, 2013), and information extraction (Krishnamurthy and Mitchell, 2012; Choi et al., 2015). Semantic parsing alone is insufficient for situated question an- swering because it does not interpret the environ- ment; many of the above approaches use semantic parsing as a component in a larger model. Probabilistic programming languages extend pro- gramming languages with primitives for nondeter- ministic choice (McCarthy, 1963; Goodman and Stuhlmuller, 2014). We express logical forms in a probabilistic variant of Scheme similar to Church (Goodman et al., 2008); however, this paper uses Python-like pseudocode for clarity. The lan- guage has a single choice primitive called choose that nondeterministically returns one of its argu- ments. For example choose(1,2,3) can execute three ways, returning either 1, 2, or 3. Multiple calls to choose can be combined. For example, choose(1,2)+choose(1,2) adds two nondeter- ministically chosen values, and therefore has four executions that return 2, 3, 3 and 4. Each execution also has a probability; in our case, these probabili- ties are assigned by a trained model given the envi- ronment and not explicitly specified in the program. 3 Parsing to Probabilistic Programs (P 3) The P 3 model is motivated by two observations. The first is that situated question answering can be formulated as semantic parsing with an execution model that is a learned function of the environment. Consider the first question in Figure 1. The meaning of this question could be represented by a logical form such as COUNT(λx.EATS(x, DEER)), which we could train a semantic parser to predict given a suitable domain theory of functions such as COUNT and EATS. However, the information required to execute this logical form and answer the question must be extracted from the diagram. Specifically, EATS(x, y) depends on whether an arrow is present between x and y, which we must train a vision model to determine. Thus, EATS should be a learned function of the environment. This first observation suggests a need for a for- malism for representing uncertainty and performing learning over the domain theory's functions. Our second observation is that probabilistic program- ming is a natural fit for this task. In this paradigm, the domain theory is a probabilistic program that de- fines the information to be extracted from the envi- ronment by using choose. To a first approximation, the diagram question theory includes: def eats(x, y) choose(true, false) Logical forms are then probabilistic programs, each of whose possible executions represents a dif- ferent interpretation of the environment. For exam- ple, executing EATS(LION, DEER) hits the choose in the above definition, resulting in two executions where the lion either eats or does not eat the deer. In the COUNT example above, each execution rep- resents a different set of animals that eat the deer. To learn the correct environment interpretation, we train an execution model to assign a probability to each execution given features of the environment. Using probabilistic programming enables us to com- bine learned functions, such as EATS, with back- ground knowledge functions, such as COUNT, and also facilitates inference. According to these observations, applying P 3 has two steps. The first step is to define an appropriate domain theory. This theory is the main design de- cision in instantiating P 3 and provides a powerful way to encode domain knowledge. The second step is to train a loglinear model consisting of a semantic parser and an execution model. This model learns to semantically parse questions into logical forms in the theory and execute them in the environment to answer questions correctly. We defer discussion of the diagram question domain theory to Section 4 and focus on the loglinear model in this section. 3.1 Model Overview The input to the P 3 model is a question and an en- vironment and its output is a denotation, which is a formal answer to the question. P 3 is a loglinear model with two factors: a semantic parser and an ex- ecution model. The semantic parser scores syntac- tic parses and logical forms for the question. These logical forms are probabilistic programs with mul- tiple possible executions (specified by the domain theory), each of which may return a different denota- tion. The execution model assigns a score to each of these executions given the environment. Formally, the model predicts a denotation γ for a question q in if S/N/S : λx.λy.λf. mice N : MICE die S\N : snakes N : will ? skip λx.DECREASE(x) SNAKES CAUSE(x, f (y)) S : DECREASE(MICE) S/N : λy.λf.CAUSE(DECREASE(MICE), f (y)) S : λf.CAUSE(DECREASE(MICE), f (SNAKES)) Figure 2: Example CCG parse of a question as predicted by the semantic parser fp. The logical form (cid:96) for the question is shown on the bottom line. an environment v using three latent variables: P (γv, q; θ) = P (e, (cid:96), tv, q; θ) = P (e, (cid:96), tv, q; θ)1(ret(e) = γ) fex(e, (cid:96), v; θex)fp((cid:96), t, q; θp) (cid:88) e,(cid:96),t 1 Zq,v The model is composed of two factors. fp repre- sents the semantic parser that scores logical forms (cid:96) and syntactic parse trees t given question q and parameters θp. fex represents the execution model. Given parameters θex, this factor assigns a score to a logical form (cid:96) and its execution e in environment v. The denotation γ, i.e., the formal answer to the ques- tion, is simply the value returned by e. Zq,v repre- sents the model's partition function. The following sections describe these factors in more detail. 3.2 Semantic Parser The factor fp represents a Combinatory Categorial Grammar (CCG) semantic parser (Zettlemoyer and Collins, 2005) that scores logical forms for a ques- tion. Given a lexicon1 mapping words to syntactic categories and logical forms, CCG defines a set of possible syntactic parses t and logical forms (cid:96) for a question q. Figure 3.2 shows an example CCG parse. fp is a loglinear model over parses ((cid:96), t): fp((cid:96), t, q; θp) = exp{θT p φ((cid:96), t, q)} The function φ maps parses to feature vectors. We use a rich set of features similar to those for syn- tactic CCG parsing (Clark and Curran, 2007); a full description is provided in an online appendix. 3.3 Execution Model The factor fex is a loglinear model over the execu- tions of a logical form given an environment. Log- ical forms in P 3 are probabilistic programs with a 1In our experiments, we automatically learn the lexicon in a preprocessing step. See Section 5.2 for details. n(cid:89) set of possible executions, where each execution e is a sequence, e = [e0, e1, e2, ..., en]. e0 is the pro- gram's starting state, ei represents the state immedi- ately after the ith call to choose, and en is the state at termination. The score of an execution is: fex(e, (cid:96), v; θex) = exp{θT exφ(ei−1, ei, (cid:96), v)} i=1 In the above equation, θex represents the model's parameters and φ represents a feature function that produces a feature vector for the difference between sequential program states ei−1 and ei given environ- ment v and logical form (cid:96). φ can include arbitrary features of the execution, logical form and environ- ment, which is important, for example, to detect cy- cles in a food web (Section 4.3). 3.4 Inference P 3 is designed to rely on approximate inference: our goal is to use rich features to accurately make local decisions, as in linear-time parsers (Nivre et al., 2006). We perform approximate inference us- ing a two-stage beam search. Given a question q, the first stage performs a beam search over CCG parses to produce a list of logical forms scored by fp. This step is performed by using a CKY-style chart parsing algorithm then marginalizing out the syntactic parses. The second stage performs a beam search over executions of each logical form. The space of possible executions of a logical form is a tree (Figure 4.2) where each internal node rep- resents a partial execution up to a choose call. The search maintains a beam of partial executions at the same depth, and each iteration advances the beam to the next depth, discarding the lowest- scoring executions according to fex to maintain a fixed size beam. This procedure runs in time linear to the number of choose calls. We implement the search by rewriting the probabilistic program into continuation-passing style, which allows choose to be implemented as a function that adds multiple con- tinuations to the search queue; we refer the reader to Goodman and Stuhlmuller (2014) for details. Our experiments use a beam size of 100 in the seman- tic parser, executing each of the 10 highest-scoring logical forms with a beam of 100 executions. 3.5 Training P 3 is trained by maximizing loglikelihood with stochastic gradient ascent. The training data {(qi, vi, ci)}n i=1 is a collection of questions qi and environments vi paired with supervision oracles ci. ci(e) = 1 for a correct execution e and ci(e) = 0 otherwise. The oracle ci can implement various kinds of supervision, including: (1) labeled denota- tions, by verifying the value returned by e and (2) la- beled environments, by verifying each choice made by e. The oracle for diagram question answering combines both forms of supervision (Section 4.5). The objective function O is the loglikelihood of predicting a correct execution: n(cid:88) (cid:88) O(θ) = log ci(e)P (e, (cid:96), tqi, vi; θ) i=1 e,l,t We optimize this objective function using stochastic gradient ascent, using the approximate in- ference algorithm from Section 3.4 to estimate the necessary marginals. When computing the marginal distribution over correct executions, we filter each step of the beam search using the supervision oracle ci to improve the approximation. 4 Diagram Question Answering with P 3 As a case study, we apply P 3 to the task of answer- ing food web diagram questions from an 8th grade science domain. A few steps are required to apply P 3. First, we create a domain theory of food webs that represents extracted information from the dia- gram and background knowledge for the domain. Second, we define the features of the execution model that are used to learn how programs in the domain theory execute given a diagram. Third, we define a component to select a multiple-choice an- swer given a denotation. Finally, we define the su- pervision oracle used for training. 4.1 Food Web Diagram Questions We consider the task of answering food web diagram questions. The input consists of a diagram depicting a food web, a natural language question and a list of natural language answer options (Figure 1). The goal is to select the correct answer option. This task has many regularities that require global features: for example, food webs are usually acyclic and cer- tain animals usually have certain roles (e.g., mice are herbivores). We have collected and released a data set for this task (Section 5.1). We preprocess the diagrams in the data set us- ing a computer vision system that identifies can- didate diagram elements (Kembhavi et al., 2016). This system extracts a collection of text labels (via OCR), arrows, arrowheads and objects, each with corresponding scores. It also extracts a collection of scored linkages between these elements. These ex- tractions are noisy and contain many discrepancies such as overlapping text labels and spurious link- ages. We use these extractions to define a set of can- didate organisms (using the text labels), and also to define features of the execution model. 4.2 Domain Theory The domain theory is a probabilistic program encod- ing the information to extract from the environment as well as background knowledge about food webs. It represents the structure of a food web using two functions. These functions are predicates that invoke choose to return either true or false. The execution model learns to predict which of these values is cor- rect for each set of arguments given the diagram. It furthermore has a collection of deterministic func- tions that encode domain knowledge, including def- initions of animal roles such as HERBIVORE and a model of population change causation. Figure 4.2 shows pseudocode for a portion of Food webs are represented the domain theory. using two functions over the extracted text la- bels: ORGANISM(x) indicates whether the label x is an organism (as opposed to, e.g., the dia- gram title); and EATS(x, y). The definitions of these functions invoke choose while remembering previously chosen values to avoid double counting probabilities when executing logical forms such as ORGANISM(DEER) ∧ ORGANISM(DEER). The re- membered values are stored in a global variable that is also used to implement the supervision oracle. Deterministic functions such as CAUSE are defined in terms of these learned functions. The uses of choose in the domain theory create a tree of possible executions for every logical form. Figure 4.2 illustrates this tree for the logical form λf.CAUSE(DECREASE(MICE), f (SNAKES)), which # initialize predicate instance variables # from text labels in environment world = {"mice": undef, ("mice", "snakes"): undef, ...} def organism(name) if (world[name] == undef) world[name] = choose(true, false) return world[name] def eats(x, y) # same as organism but with pairs. # entities referenced in the logical form # must be organisms. choose() represents # failure; it returns no values. def getOrganism(x) if (organism(x)) return x else choose() # change events are direction/ # text label tuples def decrease(x) return ("decrease", x) def cause(e1, e2) e12 = eats(e1[1], e2[1]) e21 = eats(e2[1], e1[1]) # deterministic model with cases. e.g. # if eats(y, x) then (cause (decrease x) # (decrease y)) -> true return doCause(e1[0], e2[0], e12, e21) Figure 3: Domain theory pseudocode for diagram question an- swering. corresponds to the question "what happens to the snakes when the mice decrease?" This logical form is shorthand for the following program: filter(lambda f.cause( decrease(getOrganism("mice")), f(getOrganism("snakes"))), set(decrease, increase, unchanged)) Specifically, entities such as MICE are created by calling getOrganism and logical forms with func- tional types implicitly represent filters over the ap- propriate argument type. Executing this program first applies the filter predicate to decrease. Next, it evaluates getOrganism("mice"), which calls organism and encounters the first call to choose. This call is shown as the first branch of the tree in Figure 4.2. The successful branch proceeds to eval- uate getOrganism("snakes"), shown as the sec- ond branch. Finally, the successful branch evaluates cause, which calls eats twice, resulting in the final two branches. The value returned by each branch is determined by the causation model which performs organism(mice) true false fail organism(snakes) false fail true eats(mice,snakes) true false eats(snakes,mice) eats(snakes,mice) false {unch.} true {dec.} false {inc.} true {} Figure 4: Tree of possible executions for the logical form λf.CAUSE(DECREASE(MICE), f (SNAKES)). Each path from root to leaf represents a single execution that returns the indi- cated denotation or fails, and each internal node represents a nondeterministic choice made with choose. some deterministic logic on the truth values of the two eats relations. 4.3 Execution Features The execution model uses three sets of features: in- stance features, predicate features, and denotation features. Instance features treat each predicate in- stance independently, while the remainder are global features of multiple predicate instances and the log- ical form. We provide a complete listing of features in an online appendix. Instance features fire whenever an execution chooses a truth value for a predicate instance. These features are similar to the per-predicate-instance fea- tures used in prior work to produce a distribution over possible worlds. For ORGANISM(x), our fea- tures are the vision model's extraction score for x and indicator features for the number of tokens in x. For EATS(x, y), our features are various combi- nations of the vision model's scores for arrows that may connect the text labels x and y. Predicate features fire based on the global as- signment of truth values to all instances of a single predicate. The features for ORGANISM count oc- currences of overlapping text labels among true in- stances. The features for EATS include cycle count features for various cycle lengths and arrow reuse features. The cycle count features help the model learn that food webs are typically, but not always, acyclic and the arrow reuse features aim to prevent the model from predicting two different EATS in- stances on the basis of a single arrow. Denotation features fire on the return value of an execution. There are two kinds of denotation fea- tures: size features that count the number of entities in denotations of various types and denotation ele- ment features for specific logical forms. The sec- ond kind of feature can be used to learn that the de- notation of λx.HERBIVORE(x) is likely to contain MOUSE, but unlikely to contain WOLF. 4.4 Answer Selection P 3 predicts a distribution over denotations for each question, which for our problem must be mapped to a distribution over multiple choice answers. An- swer selection performs this task using string match heuristics and an LSTM (Hochreiter and Schmidhu- ber, 1997). The string match heuristics score each answer option given a denotation then select the highest scoring answer, abstaining in the case of a tie. The score computation depends on the denota- tion's type. If the denotation is a set of entities, the score is an approximate count of the number of enti- ties in the denotation mentioned in the answer using a fuzzy string match. If the denotation is a set of change events, the score is a fuzzy match of both the change direction and the animal name. If the denota- tion is a number, string matching is straightforward. Applying these heuristics and marginalizing out de- notations yields a distribution over answer options. A limitation of the above approach is that it does not directly incorporate linguistic prior knowledge about likely answers. For example, "snake" is usu- ally a good answer to "what eats mice?" regardless of the diagram. Such knowledge is known to be es- sential for visual question answering (Antol et al., 2015; Andreas et al., 2016b) and important in our task as well. We incorporate this knowledge in a standard way, by training a neural network on ques- tion/answer pairs (without the diagram) and combin- ing its predictions with the string match heuristics above. The network is a sequence LSTM that is ap- plied to the question concatenated with each answer option a to produce a 50-dimensional vector va for each answer. The distribution over answers is the softmax of the inner product of these vectors with a learned parameter vector w. For simplicity, we combine these two components using a 50/50 mix of their answer distributions. 4.5 Supervision Oracle The supervision oracle for diagram question answer- ing combines supervision of both answers and envi- ronment interpretations. We assume that each dia- gram has been labeled with a food web. An exe- cution is correct if and only if (1) all of the chosen values in the global variable encoding the food web are consistent with the labeled food web, and (2) string match answer selection applied to its denota- tion chooses the correct answer. The first constraint guarantees that every logical form has at most one correct execution for any given diagram. 5 Evaluation Our evaluation compares P 3 to both possible worlds and neural network approaches on our data set of food web diagram questions. An ablation study demonstrates that both sets of global features im- prove accuracy. Finally, we demonstrate P 3's gen- erality by applying it to a previously-published data set, obtaining state-of-the-art results. Code, data and supplementary material for this paper are available at: http://www.allenai. org/paper-appendix/emnlp2016-p3 FOODWEBS Data Set 5.1 FOODWEBS consists of ∼500 food web diagrams and ∼5000 questions designed to imitate actual questions encountered on 8th grade science exams. The train/validation/test sets contain ∼300/100/100 diagrams and their corresponding questions. The data set has three kinds of annotations in addition to the correct answer for each question. First, each di- agram is annotated with the food web that it depicts using ORGANISM and EATS. Second, each diagram has predictions from a vision system for various dia- gram elements such as arrows and text labels (Kem- bhavi et al., 2016). These are noisy predictions, not ground truth. Finally, each question is annotated by the authors with a logical form (or null if its mean- ing is not representable in the domain theory). These logical forms are not used to train P 3 but are useful to measure per-component error. We collected FOODWEBS by using a crowdsourc- ing process to expand a collection of real exam ques- tions. First, we collected 89 questions from 4th and 8th grade exams and 500 food web diagrams us- ing an image search engine. Second, we generated questions for these diagrams using Mechanical Turk. Workers were shown a diagram and a real question for inspiration and asked to write a new question and its answer options. We validated each gener- ated question by asking 3 workers to answer it, dis- carding questions where at least 2 did not choose the correct answer. We also manually corrected any am- biguous (e.g., two answer options are correct) and poorly-formatted (e.g., two answer options have the same letter) questions. The final data set has high quality: a human domain expert correctly answered 95 out of 100 randomly-sampled questions. 5.2 Baseline Comparison Our first experiment compares P 3 with several base- lines for situated question answering. The first base- line, WORLDS, is a possible worlds model based on Malinowski and Fritz (2014). This baseline learns a semantic parser P ((cid:96), tq) and a distribution over food webs P (wv), then evaluates (cid:96) on w to pro- duce a distribution over denotations. This model is implemented by independently training P 3's CCG parser (on question/answer pairs and labeled food webs) and a possible-worlds execution model (on la- beled food webs). The CCG lexicon for both P 3 and WORLDS was generated by applying PAL (Krishna- murthy, 2016) to the same data. Both models select answers as described in Section 4.4. We also compared P 3 to several neural network baselines. The first baseline, LSTM, is the text- only answer selection model described in Section 4.4. The second baseline, VQA, is a neural net- work for visual question answering. This model represents each image as a vector by using the fi- nal layer of a pre-trained VGG19 model (Simonyan and Zisserman, 2014) and applying a single fully- connected layer. It scores answer options by using the answer selection LSTM to encode question/an- swer pairs, then computing a dot product between the text and image vectors. This model is somewhat limited because VGG features are unlikely to encode important diagram structure, such as the content of text labels. Our third baseline, DQA, is a neural net- work that rectifies this limitation (Kembhavi et al., 2016). It encodes the diagram predictions from the vision system as vectors and attends to them using the LSTM-encoded question vector to select an an- Model Accuracy Accuracy (Unseen Organisms) P 3 WORLDS LSTM VQA DQA Random 69.1 63.6 60.3 56.5 59.3 25.2 57.7 50.8 34.7 36.8 33.0 25.2 Table 1: Accuracy of P 3 and several baselines on the FOOD- WEBS test set and a modified test set with unseen organisms. Model Accuracy ∆ P 3 -LSTM -LSTM -denotation -LSTM -denotation -predicate 69.1 59.8 55.8 52.4 -9.3 -13.3 -16.7 Table 2: Test set accuracy of P 3 removing LSTM answer se- lection (Section 4.4), denotation features and predicate features (Section 4.3). swer. This model is trained with question/answer pairs and diagram parses, which is roughly compa- rable to the supervision used to train P 3. Table 5.2 compares the accuracy of P 3 to these baselines. Accuracy is the fraction of questions an- swered correctly. LSTM performs well on this data set, suggesting that many questions can be answered without using the image. This result is consistent with results on visual question answering (Antol et al., 2015). The other neural network models have similar performance to LSTM, whereas both WORLDS and P 3 outperform it. We also find that P 3 outperforms WORLDS likely due to its global features, which we investigate in the next section. Given these results, we hypothesized that the neu- ral models were largely memorizing common pat- terns in the text and were not able to interpret the diagram. We tested this hypothesis by running each model on a test set with unseen organisms created by reversing the organism names in every question and diagram (Table 5.2, right column). As expected, the accuracy of LSTM is considerably reduced on this data set. VQA and DQA again perform similarly to LSTM, which is consistent with our hypothesis. In contrast, we find that the accuracies of WORLDS and P 3 are only slightly reduced, which is consistent with superior diagram interpretation abilities but in- effective LSTM answer selection. 5.3 Ablation Study We performed an ablation study to further under- stand the impact of LSTM answer selection and global features. Table 5.2 shows the accuracy of P 3 trained without these components. We find that LSTM answer selection improves accuracy by 9 points, as expected due to the importance of linguis- tic prior knowledge. Global features improve accu- racy by 7 points, which is roughly comparable to the delta between P 3 and WORLDS in Table 5.2. 5.4 Component Error Analysis Our third experiment analyses sources of error by training and evaluating P 3 while providing the gold logical form, food web, or both as input. Table 5.5 shows the accuracy of these three models. The final entry shows the maximum accuracy possible given our domain theory and answer selection. The larger accuracy improvement with gold food webs suggests that the execution model is responsible for more error than semantic parsing, though both com- ponents contribute. SCENE Experiments 5.5 Our final experiment applies P 3 to the SCENE data set of Krishnamurthy and Kollar (2013). In this data set, the input is a natural language expression, such as "blue mug to the left of the monitor," and the output is the set of objects in an image that the ex- pression denotes. The images are annotated with a bounding box for each candidate object. The data set includes a domain theory that was automatically generated by creating a category and/or relation per word based on its part of speech. It also includes a CCG lexicon and image features. We use these re- sources, adding predicate and denotation features. Table 5.5 compares P 3 to prior work on SCENE. The evaluation metric is exact match accuracy be- tween the predicted and labeled sets of objects. We consider three supervision conditions: QA trains with question/answer pairs, QA+E further includes labeled environments, and QA+E+LF further in- cludes labeled logical forms. We trained P 3 in the first two conditions, while prior work trained in the first and third conditions. KK2013 is a possible worlds model with a max-margin training objective. P 3 slightly outperforms in the QA condition and P 3 Model Accuracy ∆ 69.1 P 3 + gold logical form 75.1 82.3 + gold food web + both 91.6 +6.0 +13.2 +22.5 Table 3: Accuracy of P 3 when trained and evaluated with la- beled logical forms, food webs, or both. Model P 3 KK2013 Supervision 75 – QA QA+E QA+E+LF 68 67 – 70 Table 4: Accuracy on the SCENE data set. KK2013 results are from Krishnamurthy and Kollar (2013). trained with labeled environments outperforms prior work trained with additional logical form labels. 6 Conclusion Parsing to Probabilistic Programs (P 3) is a novel model for situated question answering that jointly reasons about question and environment interpreta- tions using background knowledge to produce an- swers. P 3 uses a domain theory – a probabilistic program – to define the information to be extracted from the environment and background knowledge. A semantic parser maps questions to logical forms in this theory, which are probabilistic programs whose possible executions represent possible interpreta- tions of the environment. An execution model scores these executions given features of the environment. Both the semantic parser and execution model are jointly trained in a loglinear model, which thereby learns to both parse questions and interpret environ- ments. Importantly, the model includes global fea- tures of the logical form and executions, which help the model avoid implausible interpretations. We demonstrate P 3 on a challenging new data set of 5000 science diagram questions, where it outper- forms several competitive baselines. Acknowledgments We gratefully acknowledge Minjoon Seo, Mike Sal- vato and Eric Kolve for their implementation help, Isaac Cowhey and Carissa Schoenick for their help with the data, and Oren Etzioni, Peter Clark, Matt Gardner, Hannaneh Hajishirzi, Mike Lewis, and Jonghyun Choi for their comments. References [Andreas et al.2016a] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. 2016a. Deep com- positional question answering with neural module net- works. In CVPR. [Andreas et al.2016b] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. 2016b. Learning to compose neural networks for question answering. In NAACL. [Antol et al.2015] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. 2015. In International VQA: Visual question answering. Conference on Computer Vision (ICCV). [Artzi and Zettlemoyer2013] Yoav Artzi and Luke Zettle- moyer. 2013. Weakly supervised learning of semantic parsers for mapping instructions to actions. Transac- tions of the Association for Computational Linguistics. [Berant et al.2013] Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Nat- ural Language Processing. [Berant et al.2014] Jonathan Berant, Vivek Srikumar, Pei- Chun Chen, Abby Vander Linden, Brittany Harding, Brad Huang, Peter Clark, and Christopher D. Man- ning. 2014. Modeling biological processes for reading comprehension. In Proceedings of EMNLP. [Chen and Mooney2011] David L. Chen and Raymond J. 2011. Learning to interpret natural lan- Mooney. guage navigation instructions from observations. In Proceedings of the 25th AAAI Conference on Artificial Intelligence. [Choi et al.2015] Eunsol Choi, Tom Kwiatkowski, and Luke Zettlemoyer. 2015. Scalable semantic parsing In Proceedings of the 2015 with partial ontologies. Association for Computational Linguistics. [Clark and Curran2007] Stephen Clark and James R. Cur- ran. 2007. Wide-coverage efficient statistical parsing with CCG and log-linear models. Computational Lin- guistics, 33(4):493–552. [Clark and Etzioni2016] Peter Clark and Oren Etzioni. 2016. My computer is an honor student - but how in- telligent is it? standardized tests as a measure of ai. AI Magazine, 37:5–12. [Fukui et al.2016] Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. 2016. Multimodal compact bilinear pool- ing for visual question answering and visual ground- ing. arXiv:1606.01847. [Goodman and Stuhlmuller2014] Noah D Goodman and Andreas Stuhlmuller. 2014. The Design and Imple- mentation of Probabilistic Programming Languages. http://dippl.org. Accessed: 2016-2-25. [Goodman et al.2008] Noah D. Goodman, Vikash K. Mansinghka, Daniel M. Roy, Keith Bonawitz, and Joshua B. Tenenbaum. 2008. Church: A language for generative models. In Uncertainty in Artificial In- telligence. [Hochreiter and Schmidhuber1997] Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735–1780. [Howard et al.2014a] Thomas M. Howard, Istvan Chung, Oron Propp, Matthew R. Walter, and Nicholas Roy. 2014a. Efficient natural language interfaces for assis- tive robots. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) Workshop on Rehabilitation and Assistive Robotics, September. [Howard et al.2014b] Thomas M Howard, Stefanie Tellex, and Nicholas Roy. 2014b. A natural language In 2014 planner interface for mobile manipulators. IEEE International Conference on Robotics and Automation (ICRA). [Kembhavi et al.2016] Aniruddha Kembhavi, Mike Sal- vato, Eric Kolve, Min Joon Seo, Hannaneh Hajishirzi, and Ali Farhadi. 2016. A diagram is worth a dozen images. In European Conference on Computer Vision (ECCV). [Kollar et al.2010] Thomas Kollar, Stefanie Tellex, Deb Roy, and Nicholas Roy. 2010. Toward understand- ing natural language directions. In Proceedings of the 5th ACM/IEEE International Conference on Human- Robot Interaction. [Krishnamurthy and Kollar2013] Jayant Krishnamurthy and Thomas Kollar. 2013. Jointly learning to parse and perceive: Connecting natural language to the physical world. Transactions of the Association of Computational Linguistics – Volume 1. [Krishnamurthy and Mitchell2012] Jayant Krishna- murthy and Tom M. Mitchell. 2012. Weakly super- In Proceedings vised training of semantic parsers. of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning. [Krishnamurthy and Mitchell2015] Jayant Krishna- murthy and Tom M. Mitchell. 2015. Learning a compositional semantics for freebase with an open predicate vocabulary. Transactions of the Association for Computational Linguistics, 3:257–270. [Krishnamurthy2016] Jayant Krishnamurthy. 2016. Probabilistic models for learning a semantic parser lexicon. In NAACL. [Kwiatkowski et al.2013] Tom Kwiatkowski, Eunsol Choi, Yoav Artzi, and Luke Zettlemoyer. 2013. Scaling semantic parsers with on-the-fly ontology matching. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. [Yang et al.2015] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alexander J. Smola. 2015. Stacked attention networks for image question answer- ing. arXiv preprint arXiv:1511.02274. [Yih et al.2015] Wen-tau Yih, Ming-Wei Chang, Xi- aodong He, and Jianfeng Gao. 2015. Semantic pars- ing via staged query graph generation: Question an- swering with knowledge base. In Proceedings of the 53rd Annual Meeting of the Association for Computa- tional Linguistics and the 7th International Joint Con- ference on Natural Language Processing (Volume 1: Long Papers). [Zelle and Mooney1993] John M. Zelle and Raymond J. Mooney. 1993. Learning semantic grammars with In Pro- constructive inductive logic programming. ceedings of the 11th National Conference on Artificial Intelligence. [Zettlemoyer and Collins2005] Luke S. Zettlemoyer and Michael Collins. 2005. Learning to map sentences to logical form: structured classification with proba- bilistic categorial grammars. In UAI '05, Proceedings of the 21st Conference in Uncertainty in Artificial In- telligence. [Liang et al.2011] Percy Liang, Michael I. Jordan, and Dan Klein. 2011. Learning dependency-based com- positional semantics. In Proceedings of the Associa- tion for Computational Linguistics. [Malinowski and Fritz2014] Mateusz Malinowski and Mario Fritz. 2014. A multi-world approach to question answering about real-world scenes based on In Advances in Neural Information uncertain input. Processing Systems. [Malinowski et al.2015] Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. 2015. Ask your neurons: A neural-based approach to answering questions about images. In International Conference on Computer Vi- sion. [Matuszek et al.2012] Cynthia Matuszek, Nicholas FitzGerald, Luke Zettlemoyer, Liefeng Bo, and Dieter Fox. 2012. A joint model of language and perception for grounded attribute learning. In Proceedings of the 29th International Conference on Machine Learning. [McCarthy1963] John McCarthy. 1963. A basis for a In Computer mathematical theory of computation. Programming and Formal Systems. [Nivre et al.2006] Joakim Nivre, Johan Hall, and Jens Nilsson. 2006. Maltparser: A data-driven parser- generator for dependency parsing. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Associa- tion for Computational Linguistics. [Reddy et al.2014] Siva Reddy, Mirella Lapata, and Mark Steedman. 2014. Large-scale semantic parsing with- out question-answer pairs. Transactions of the Associ- ation for Computational Linguistics. [Seo et al.2015] Minjoon Seo, Hannaneh Hajishirzi, Ali Farhadi, Oren Etzioni, and Clint Malcolm. 2015. Solving geometry problems: Combining text and di- agram interpretation. In Proceedings of the 2015 Con- ference on Empirical Methods in Natural Language Processing. [Simonyan and Zisserman2014] Karen Simonyan and Andrew Zisserman. 2014. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556. [Tellex et al.2011] Stefanie Tellex, Thomas Kollar, Steven Dickerson, Matthew Walter, Ashis Banerjee, Seth Teller, and Nicholas Roy. 2011. Understanding nat- ural language commands for robotic navigation and In AAAI Conference on Artifi- mobile manipulation. cial Intelligence. [Xu et al.2016] Kun Xu, Siva Reddy, Yansong Feng, Songfang Huang, and Dongyan Zhao. 2016. Ques- tion Answering on Freebase via Relation Extraction and Textual Evidence. In Proceedings of the Associa- tion for Computational Linguistics (ACL 2016).
1904.12087
1
1904
2019-04-27T01:51:55
Experiments in Cuneiform Language Identification
[ "cs.CL" ]
This paper presents methods to discriminate between languages and dialects written in Cuneiform script, one of the first writing systems in the world. We report the results obtained by the PZ team in the Cuneiform Language Identification (CLI) shared task organized within the scope of the VarDial Evaluation Campaign 2019. The task included two languages, Sumerian and Akkadian. The latter is divided into six dialects: Old Babylonian, Middle Babylonian peripheral, Standard Babylonian, Neo Babylonian, Late Babylonian, and Neo Assyrian. We approach the task using a meta-classifier trained on various SVM models and we show the effectiveness of the system for this task. Our submission achieved 0.738 F1 score in discriminating between the seven languages and dialects and it was ranked fourth in the competition among eight teams.
cs.CL
cs
Experiments in Cuneiform Language Identification Gustavo Henrique Paetzold1, Marcos Zampieri2 1Universidade Tecnol´ogica Federal do Paran´a, Toledo-PR, Brazil 2University of Wolverhampton, Wolverhampton, United Kingdom [email protected] 9 1 0 2 r p A 7 2 ] L C . s c [ 1 v 7 8 0 2 1 . 4 0 9 1 : v i X r a Abstract This paper presents methods to discriminate between languages and dialects written in Cuneiform script, one of the first writing sys- tems in the world. We report the results ob- tained by the PZ team in the Cuneiform Lan- guage Identification (CLI) shared task orga- nized within the scope of the VarDial Evalu- ation Campaign 2019. The task included two languages, Sumerian and Akkadian. The lat- ter is divided into six dialects: Old Babylo- nian, Middle Babylonian peripheral, Standard Babylonian, Neo Babylonian, Late Babylo- nian, and Neo Assyrian. We approach the task using a meta-classifier trained on various SVM models and we show the effectiveness of the system for this task. Our submission achieved 0.738 F1 score in discriminating between the seven languages and dialects and it was ranked fourth in the competition among eight teams. Introduction 1 As discussed in a recent survey (Jauhiainen et al., 2018), discriminating between similar languages, national language varieties, and dialects is an im- portant challenge faced by state-of-the-art lan- guage identification systems. The topic has at- tracted more and more attention from the CL/NLP community in recent years with publications on similar languages of the Iberian peninsula (Zu- biaga et al., 2016), and varieties and dialects of several languages such as Greek (Sababa and Stassopoulou, 2018) and Romanian (Ciobanu and Dinu, 2016) to name a few. As evidenced in Section 2, the focus of most of these studies is the identification of languages and dialects using contemporary data. A few ex- ceptions include the work by Trieschnigg et al. (2012) who applied language identification meth- ods to historical varieties of Dutch and the work by Jauhiainen et al. (2019) on languages writ- ten in cuneiform script: Sumerian and Akkadian. Cuneiform is an ancient writing system invented by the Sumerians for more than three millennia. In this paper we describe computational ap- proaches to language identification on texts writ- ten in cuneiform script. For this purpose we use the dataset made available by Jauhiainen et al. (2019) to participants of the Cuneiform Language Identification (CLI) shared task organized at Var- Dial 2019 (Zampieri et al., 2019). Our submis- sion, under the team name PZ, is an adaptation of an n-gram-based meta-classifier system which showed very good performance in previous lan- guage identification shared tasks (Malmasi and Zampieri, 2017b,a). Furthermore, we compare the performance of the meta-classifier to the sub- missions to the CLI shared task and, in partic- ular, to a deep learning approach submitted by the team ghpaetzold. It has been shown in pre- vious language identification studies (Medvedeva et al., 2017; Kroon et al., 2018) that deep learn- ing approaches do not outperform n-gram-based methods and we were interested in investigating whether this is also true for the languages and di- alects included in CLI. 2 Related Work Since its first edition in 2014, shared tasks on sim- ilar language and dialect identification have been organized together with the VarDial workshop co-located with international conferences such as COLING, EACL, and NAACL. The first and most well-attended of these competitions was the Discrminating between Similar Languages (DSL) shared task which has been organized between 2014 and 2017 (Malmasi et al., 2016b; Zampieri et al., 2014, 2015, 2017). The DSL provided the first benchmark for evaluation of language identi- fication systems developed for similar languages and language varieties using the DSL Corpus Col- Language or Dialect Code Late Babylonian LTB Middle Babylonian peripheral MPB NE Neo-Assyrian Neo-Babylonian NEB OLB Old Babylonian STB Standard Babylonian Sumerian SUX Total Texts 671 365 3,570 1,212 527 1,661 5,000 13,006 Lines 31,893 11,015 65,932 19,414 7,605 35,633 107,345 278,837 Signs ca. 260,000 ca. 95,000 ca. 490,000 ca. 200,000 ca. 65,000 ca. 390,000 ca. 400,000 ca. 1,900,000 Table 1: Number of texts, lines, and signs in each of the seven languages and dialects in the dataset of Jauhiainen et al. (2019), from which the instances of the CLI datasets were taken. lection (DSLCC) (Tan et al., 2014), a multilingual benchmarked dataset compiled for this purpose. In 2017 and 2018, VarDial featured evaluation cam- paigns with multiple shared tasks not only on lan- guage and dialect identification but also on other NLP tasks related to language and dialect variation (e.g. morphosyntactic tagging, and cross-lingual dependency parsing). With the exception of the DSL, the language and dialect identification com- petitions organized at VarDial focused on groups of dialects from the same language such as Arabic (ADI shared task) and German (GDI shared task). The focus of the aforementioned language and dialect identification competitions was diatopic variation and thus the data made available in these competitions was synchronic contemporary cor- pora. In the 2019 edition of the workshop, for the first time, a task including historical languages was organized. The CLI shared task provided par- ticipants with a dataset containing languages and dialects written in cuneiform script: Sumerian and Akkadian. Akkadian is divided into six dialects in the dataset: Old Babylonian, Middle Babylo- nian peripheral, Standard Babylonian, Neo Baby- lonian, Late Babylonian, and Neo Assyrian (Jauhi- ainen et al., 2019). The CLI shared task is an innovative initiative that opens new perspectives in the computational processing of languages written in cuneiform script. There have been a number of studies apply- ing computational methods to process these lan- guages (e.g. Sumerian (Chiarcos et al., 2018)), but with the exception of Jauhiainen et al. (2019), to the best of our knowledge, no language identifica- tion studies have been published. CLI is the first competition organized on cuneiform script texts in particular and in historical language identification in general. 3 Methodology and Data The dataset used in the CLI shared task is de- scribed in detail in Jauhiainen et al. (2019). All of the data included in the dataset was collected from the Open Richly Annotated Cuneiform Cor- pus (Oracc)1 which contains transliterated texts. Jauhiainen et al. (2019) created a tool to transform the texts back to the cuneiform script. The dataset features texts from seven languages and dialects amounting to a little over 13,000 texts. The list of languages and dialects is presented in Table 1. 3.1 System Description Our submission to the CLI shared task is a system based on a meta-classifier trained on several SVM models. Meta-classifiers (Giraud-Carrier et al., 2004) and ensemble learning methods have proved to deliver competitive performance not only in language identification (Malmasi and Zampieri, 2017b,a) but also in many other text classification tasks (Malmasi et al., 2016a; Sulea et al., 2017). The meta-classifier is an adaptation of previous submissions to VarDial shared tasks described in (Malmasi and Zampieri, 2017a). It is essentially a bagging ensemble trained on the outputs of lin- ear SVM classifiers. As features, the system uses the following character n-gram and character skip- gram features: • character n-grams of order 1 -- 5; • 1-skip character bigrams and trigrams; • 2-skip character bigrams and trigrams; • 3-skip character bigrams and trigrams. Each feature class is used to train a single lin- ear SVM classifier using LIBLINEAR (Fan et al., 1http://oracc.museum.upenn.edu/ 2008). The outputs of these SVM classifiers on the training data are then used to train the meta- classifier. 4 Results Table 2 showcases the results obtained by our team (PZ in bold) and the best submission by each of the eight teams which participating in the CLI shared task. Even though the competition allowed the use of other datasets (open submission), we have used only the dataset provided by the shared task orga- nizers to train our model. Our submission was ranked 4th in the shared task, only a few percentage points below the top-3 systems: NRC-CNRC, tearsofjoy, and Twist Bytes. The meta-classifier achieved much higher performance at distinguishing between these Mesopotamian languages and dialects than the neural model by ghpaetzold, which ranked 6th in the competition. We present this neural model in more detail comparing its performance to our meta-classifier in Section 4.1. System NRC-CNRC tearsofjoy Twist Bytes PZ ghmerti ghpaetzold ekh situx F1 (macro) 0.769 0.763 0.743 0.738 0.721 0.556 0.550 0.128 Table 2: Results for the CLI task obtained by the team PZ (in bold) in comparison to the the best entries of each of the eight teams in the shared task. Results re- ported in terms of F1 (macro). 4.1 Comparison to a Neural Model We take the opportunity to compare the perfor- mance of our system with an entirely different type of model submitted by team ghpaetzold. This comparison was motivated by the lower perfor- mance obtained by the neural models in compari- son to traditional machine learning models in pre- vious VarDial shared tasks (Zampieri et al., 2018). It was made possible due to the collaboration be- tween the ghpaetzold team and ours.2 2One of the ghpaetzold team members was also a member of the PZ team. As demonstrated by Ling et al. (2015), compo- sitional recurrent neural networks can offer very reliable performance on a variety of NLP tasks. Previous language identification and dialect stud- ies (Medvedeva et al., 2017; Kroon et al., 2018; Butnaru and Ionescu, 2019) and the results of the previous shared tasks organized at VarDial (Zampieri et al., 2017, 2018), however, showed that deep learning approaches do not outperform more linear n-gram-based methods so we were in- terested in comparing the performance of a neural model to the meta-classifier for this dataset. A compositional network is commonly de- scribed as a model that builds numerical represen- tations of words based on the sequence of charac- ters that compose them. They are inherently more time-consuming to train than typical neural mod- els that use traditional word vectors because of the added parameters, but they compensate by be- ing able to handle any conceivable word passed as input with very impressive robustness (Paetzold, 2018, 2019). The model takes as input a sentence and pro- duces a corresponding label as output. First, the model vectorizes each character of each word in the sentence using a typical character embedding layer. It then passes the sequence of vectors through a set of 2 layers of Gated Recurrent Units (GRUs) and produces a numerical representation for each word as a whole. This set of represen- tations is then passed through another 2-layer set of GRUs to produce a final vector for the sen- tence as a whole, and then a dense layer is used to produce a softmax distribution over the label set. The model uses 25 dimensions for character em- beddings, 30 nodes for each GRU layer and 50% dropout. A version of each model was saved af- ter each epoch so that the team could choose the one with the lowest error on the development set as their submission. Inspecting the two confusion matrices depicted in Figures 1 and 2, we found that the neural model did not do very well at differentiating between Standard Babylonian and Neo Assyrian, as well as between Neo Babylonian and Neo Assyrian, leading to many misclassifications. These two lan- guage pairs were also the most challenging for the meta-classifier, however, the number of missclas- sified instances by the meta-classifier was much lower. Figure 1: Confusion matrix for the meta-classifier. Figure 2: Confusion matrix for the neural model. 5 Conclusion and Future Work In this paper we presented a meta-classifier sys- tem submitted by the team PZ to the Cuneiform Language Identification shared task organized at VarDial 2019. Our submission is an adaptation of a sophisticated meta-classifier which achieved high performance in previous language and di- alect identification shared tasks at VarDial (Mal- masi and Zampieri, 2017a). The meta-classifier combines the output of multiple SVM classifers trained on character-based features. The meta- classifier ranked 4th in the competition among eight teams only a few percentage points below the top-3 systems in the competition. Finally, we compared the performance of the meta-classifier with a compositional RNN model that uses only the text from the instance as in- put trained on the same dataset. The compari- son shows that, while the neural model does of- fer competitive performance against some of the systems submitted to the shared task, the more elaborate features used by the meta-classifier al- lows it to much more proficiently distinguish be- tween very similar language pairs, such as Neo Babylonian and Neo Assyrian, leading to a per- formance gain of 18.2% F-score and 2 positions in the shared task rankings. The results obtained by the meta-classifier in comparison to the neural model corroborate the findings of previous stud- ies (Medvedeva et al., 2017) in the last two Var- Dial evaluation campaigns (Zampieri et al., 2017, 2018). In the future we would like to analyze the results obtained by the highest performing teams in the CLI shared task. The top team achieved the best performance in the competition using a neural- based method. This is, to the best of our knowl- edge, the first time in which a deep learning ap- proach outperforms traditional machine learning methods in one of the VarDial shared tasks. The great performance obtained by the NRC-CNRC team might be explained by the use of more suit- able deep learning methods such as BERT (Devlin et al., 2018). Acknowledgements We would like to thank Shervin Malmasi for his valuable suggestions and feedback. We further thank the CLI shared task organizer, Tommi Jauhi- ainen, for organizing this interesting shared task. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Ti- tan V GPU used for this research. References Andrei Butnaru and Radu Tudor Ionescu. 2019. MO- ROCO: The Moldavian and Romanian Dialectal Corpus. arXiv preprint arXiv:1901.06543. Christian Chiarcos, ´Emilie Pag´e-Perron, Ilya Khait, Niko Schenk, and Lucas Reckling. 2018. Towards a Linked Open Data Edition of Sumerian Corpora. In Proceedings of LREC. Alina Maria Ciobanu and Liviu P Dinu. 2016. A com- putational perspective on the romanian dialects. In Proceedings of LREC. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of LTBMPBNEANEBOLBSTBSUXPredicted labelLTBMPBNEANEBOLBSTBSUXTrue label941164119448007115163148369092531920233130948941022721339213720367013202709718457110195374377795Confusion Matrix0.00.20.40.60.8LTBMPBNEANEBOLBSTBSUXPredicted labelLTBMPBNEANEBOLBSTBSUXTrue label88312867441657081111321527541386021640415356417247111376475105200171931212742635292772738614251362633123743Confusion Matrix0.00.10.20.30.40.50.60.70.8 Deep Bidirectional Transformers for Language Un- derstanding. arXiv preprint arXiv:1810.04805. Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang- Rui Wang, and Chih-Jen Lin. 2008. LIBLINEAR: A Library for Large Linear Classification. Journal of Machine Learning Research, 9(Aug):1871 -- 1874. Christophe Giraud-Carrier, Ricardo Vilalta, and Pavel Brazdil. 2004. Introduction to the Special Issue on Meta-learning. Machine learning, 54(3):187 -- 193. Tommi Jauhiainen, Heidi Jauhiainen, Tero Alstola, and Krister Lind´en. 2019. Language and Dialect Identi- fication of Cuneiform Texts. In Proceedings of Var- Dial. Tommi Jauhiainen, Marco Lui, Marcos Zampieri, Tim- othy Baldwin, and Krister Lind´en. 2018. Automatic language identification in texts: A survey. arXiv preprint arXiv:1804.08186. Hanna Sababa and Athena Stassopoulou. 2018. A Classifier to Distinguish Between Cypriot Greek and Standard Modern Greek. In Proceedings of SNAMS. Octavia-Maria Sulea, Marcos Zampieri, Shervin Mal- masi, Mihaela Vela, Liviu P Dinu, and Josef van Genabith. 2017. Exploring the use of Text Classifi- cation in the Legal Domain. Proceedings of ASAIL. Liling Tan, Marcos Zampieri, Nikola Ljubesi´c, and Jorg Tiedemann. 2014. Merging Comparable Data Sources for the Discrimination of Similar Lan- In Proceed- guages: The DSL Corpus Collection. ings BUCC. Dolf Trieschnigg, Djoerd Hiemstra, Mariet Theune, Franciska Jong, and Theo Meder. 2012. An Ex- ploration of Language Identification Techniques in In Proceedings of the Dutch Folktale Database. the Workshop on Adaptation of Language Resources and Tools for Processing Cultural Heritage. Martin Kroon, Masha Medvedeva, and Barbara Plank. 2018. When Simple N-gram Models Outper- form Syntactic Approaches: Discriminating be- In Proceedings of Var- tween Dutch and Flemish. Dial. Marcos Zampieri, Shervin Malmasi, Nikola Ljubesi´c, Preslav Nakov, Ahmed Ali, Jorg Tiedemann, Yves Scherrer, and Noemi Aepli. 2017. Findings of the VarDial Evaluation Campaign 2017. In Proceedings of VarDial. Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ram´on Fernan- dez Astudillo, Silvio Amir, Chris Dyer, Alan W Black, and Isabel Trancoso. 2015. Finding function in form: Compositional character models for open arXiv preprint vocabulary word representation. arXiv:1508.02096. Shervin Malmasi and Marcos Zampieri. 2017a. Arabic Dialect Identification Using iVectors and ASR Tran- scripts. In Proceedings of VarDial. Shervin Malmasi and Marcos Zampieri. 2017b. Ger- man Dialect Identification in Interview Transcrip- tions. In Proceedings of VarDial. Shervin Malmasi, Marcos Zampieri, and Mark Dras. 2016a. Predicting Post Severity in Mental Health Forums. In Proceedings of CLPsych. Shervin Malmasi, Marcos Zampieri, Nikola Ljubesi´c, Preslav Nakov, Ahmed Ali, and Jorg Tiedemann. 2016b. Discriminating between Similar Languages and Arabic Dialect Identification: A Report on the Third DSL Shared Task. In Proceedings of VarDial. Maria Medvedeva, Martin Kroon, and Barbara Plank. 2017. When Sparse Traditional Models Outperform Dense Neural Networks: The Curious Case of Dis- In Pro- criminating between Similar Languages. ceedings of VarDial. Gustavo Paetzold. 2018. UTFPR at IEST 2018: Ex- ploring Character-to-Word Composition for Emo- tion Analysis. In Proceedings of WASSA. Gustavo Paetzold. 2019. UTFPR at SemEval-2019 Task 6: Relying on Compositionality to Find Of- fense. In Proceedings of SemEval. Marcos Zampieri, Shervin Malmasi, Preslav Nakov, Ahmed Ali, Suwon Shuon, James Glass, Yves Scherrer, Tanja Samardzi´c, Nikola Ljubesi´c, Jorg Tiedemann, Chris van der Lee, Stefan Grondelaers, Nelleke Oostdijk, Antal van den Bosch, Ritesh Ku- mar, Bornini Lahiri, and Mayank Jain. 2018. Lan- guage Identification and Morphosyntactic Tagging: The Second VarDial Evaluation Campaign. In Pro- ceedings of VarDial. Marcos Zampieri, Shervin Malmasi, Yves Scherrer, Tanja Samardzi´c, Francis Tyers, Miikka Silfverberg, Natalia Klyueva, Tung-Le Pan, Chu-Ren Huang, Radu Tudor Ionescu, Andrei Butnaru, and Tommi Jauhiainen. 2019. A Report on the Third VarDial Evaluation Campaign. In Proceedings of VarDial. Marcos Zampieri, Liling Tan, Nikola Ljubesi´c, and Jorg Tiedemann. 2014. A report on the DSL shared task 2014. In Proceedings of VarDial. Marcos Zampieri, Liling Tan, Nikola Ljubesi´c, Jorg Tiedemann, and Preslav Nakov. 2015. Overview In Proceedings of of the dsl shared task 2015. LT4VarDial. Arkaitz Zubiaga, Inaki San Vicente, Pablo Gamallo, Jos´e Ramom Pichel, Inaki Alegria, Nora Aranberri, Aitzol Ezeiza, and V´ıctor Fresno. 2016. Tweetlid: A Benchmark for Tweet Language Identification. Lan- guage Resources and Evaluation, 50(4):729 -- 766.
1905.13443
1
1905
2019-05-31T07:03:03
Symbol Emergence as an Interpersonal Multimodal Categorization
[ "cs.CL" ]
This study focuses on category formation for individual agents and the dynamics of symbol emergence in a multi-agent system through semiotic communication. Semiotic communication is defined, in this study, as the generation and interpretation of signs associated with the categories formed through the agent's own sensory experience or by exchange of signs with other agents. From the viewpoint of language evolution and symbol emergence, organization of a symbol system in a multi-agent system is considered as a bottom-up and dynamic process, where individual agents share the meaning of signs and categorize sensory experience. A constructive computational model can explain the mutual dependency of the two processes and has mathematical support that guarantees a symbol system's emergence and sharing within the multi-agent system. In this paper, we describe a new computational model that represents symbol emergence in a two-agent system based on a probabilistic generative model for multimodal categorization. It models semiotic communication via a probabilistic rejection based on the receiver's own belief. We have found that the dynamics by which cognitively independent agents create a symbol system through their semiotic communication can be regarded as the inference process of a hidden variable in an interpersonal multimodal categorizer, if we define the rejection probability based on the Metropolis-Hastings algorithm. The validity of the proposed model and algorithm for symbol emergence is also verified in an experiment with two agents observing daily objects in the real-world environment. The experimental results demonstrate that our model reproduces the phenomena of symbol emergence, which does not require a teacher who would know a pre-existing symbol system. Instead, the multi-agent system can form and use a symbol system without having pre-existing categories.
cs.CL
cs
Symbol Emergence as an Interpersonal Multimodal Categorization Yoshinobu Hagiwara 1,∗, Hiroyoshi Kobayashi 1, Akira Taniguchi 1, and Tadahiro Taniguchi 1 1Emergent Systems Laboratory, College of Information Science and Engineering, Ritsumeikan University, Shiga, Japan Correspondence*: Yoshinobu Hagiwara [email protected] 9 1 0 2 y a M 1 3 ] L C . s c [ 1 v 3 4 4 3 1 . 5 0 9 1 : v i X r a ABSTRACT This study focuses on category formation for individual agents and the dynamics of symbol emergence in a multi-agent system through semiotic communication. Semiotic communication is defined, in this study, as the generation and interpretation of signs associated with the categories formed through the agent's own sensory experience or by exchange of signs with other agents. From the viewpoint of language evolution and symbol emergence, organization of a symbol system in a multi-agent system (i.e., agent society) is considered as a bottom-up and dynamic process, where individual agents share the meaning of signs and categorize sensory experience. A constructive computational model can explain the mutual dependency of the two processes and has mathematical support that guarantees a symbol system's emergence and sharing within the multi-agent system. In this paper, we describe a new computational model that represents symbol emergence in a two-agent system based on a probabilistic generative model for multimodal categorization. It models semiotic communication via a probabilistic rejection based on the receiver's own belief. We have found that the dynamics by which cognitively independent agents create a symbol system through their semiotic communication can be regarded as the inference process of a hidden variable in an interpersonal multimodal categorizer, i.e., the complete system can be regarded as a single agent performing multimodal categorization using the sensors of all agents, if we define the rejection probability based on the Metropolis-Hastings algorithm. The validity of the proposed model and algorithm for symbol emergence, i.e., forming and sharing signs and categories, is also verified in an experiment with two agents observing daily objects in the real-world environment. In the experiment, we compared three communication algorithms: no communication, no rejection, and the proposed algorithm. The experimental results demonstrate that our model reproduces the phenomena of symbol emergence, which does not require a teacher who would know a pre-existing symbol system. Instead, the multi-agent system can form and use a symbol system without having pre-existing categories. 1 INTRODUCTION Language plays a crucial role in sharing information between people by using semiotic communication (i.e., exchanging signs). However, it is still a mysterious problem in language evolution: how the symbol system of the language has emerged through semiotic communication. The semiotic communication in this study is defined as the generation and interpretation of signs associated with the categories formed through the agent's own sensory experience or by exchanging signs with other agents. Although sharing and forming the symbols representing the sensory experience is only a part of the function of language, 1 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization obtaining a computational explanation of emergence of a symbol system in the real-world environment (i.e., only from individual sensory-motor experience and exchanging signs) is important and challenging. A fundamental study on language evolution Chomsky (1975) focused on thoughts and concept formation within individuals, and advocated the concept of generative grammar that explains the syntactic ability required for languages. Tomasello (1999) focused on human cooperative communication and proposed a model to determine the communication ability for sharing intentions with others. As a hypothesis that handles concept formation and intention sharing in an integrated manner, Okanoya and Merker (2007) advocated a mutual segmentation hypothesis of sound strings and situations based on co-creative communication. Our study was conducted by a constructive approach inspired by the Okanoya's hypothesis, and it deals with the concept formation in individuals and intention sharing in multi-agent systems simultaneously. Constructive approaches are highly advantageous to understanding complex systems and are also useful for studying evolutionary linguistics (Steels, 1997; Hashimoto, 1999). Nakamura et al. (2014); Taniguchi et al. (2018) developed integrative probabilistic generative models for multimodal categorization and word discovery by a robot (using multimodal sensorimotor information obtained by a robot, and speech signals). However, their model only explains individual learning, and they implicitly presume that a teacher has a fixed and static symbol system. The goal of this paper is to provide a computational model that not only categorizes sensory information but also shares the meaning of signs within the multi-agent system. This model provides a clear view of symbol emergence as an interpersonal multimodal categorization. In studies on language emergence in multi-agent systems, Kirby (1999) showed that the language exchanged between agents involving repeated generation alternation is gradually structured in a simulation model. Morita et al. (2012) showed in simulation experiments that semiotic communication systems emerge from interactions that solve collaborative tasks. Lazaridou et al. (2016) proposed a framework for language learning that relies on multi-agent communication for developing interactive machines (e.g., conversational agents). Lee et al. (2017) proposed a communication game in which two agents, native speakers of their own respective languages, jointly learn to solve a visual referential task. Graesser et al. (2019) proposed a computational framework in which agents equipped with communication capabilities simultaneously play a series of referential games, where agents are trained by deep reinforcement learning. These studies achieved language emergence in multi-agent systems by using a computational model. However, interaction with the real-world environment through one's own sensory information without pre-existing categories (i.e., internal representations) was not discussed in these studies. In studies on language evolution based on a constructive approach using robots, Steels performed experiments on a self-organizing spatial vocabulary (Steels, 1995) and perceptually grounded categories through language for color (Steels and Belpaeme, 2005). Their research considered how people talk about the location of objects and places (Steels and Loetzsch, 2008). The series of his studies using robots are summarized as the talking heads experiment (Steels, 2015). In studies beyond the talking heads experiment, Steels and Kaplan (2000) performed experiments with robots in "AIBO's first words: the social learning of language and meaning". De Beule et al. (2006) proposed a cross-situational learning algorithm for damping homonymy in the guessing game. Spranger proposed a perceptual system for language game experiments (Spranger et al., 2012) and performed the evolution of grounded spatial language (Spranger, 2011, 2015). Bleys (2015) proposed language strategies for the domain of color. Matuszek (2018) proposed grounded language learning, where robotics and natural language processing meet. These studies focused on the symbol grounding in the language game and built Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization the foundation of constructive studies on language evolution. However, the modeling of bottom-up internal representation learning from sensory-motor information within individuals has not been discussed. Taniguchi et al. (2016b) introduced a concept of symbol emergence system, which is a multi-agent system that dynamically organizes a symbol system, for example , by physical interaction with the environment and semiotic communication with other agents. A symbol emergence system can be regarded as an emergent system: a complex system that has an emergent property. Internal representations (e.g. object categories) are formed in individual agents' cognitive systems under the influence of a symbol system shared among a multi-agent system. A symbol system shared in a society is organized under the influence of internal representations formed by individual agents. The interdependency is crucial for symbol emergence in a multi-agent system. However, so far, there is a lack of a computational model that would describe the mutual dependency and would be evaluated in experiments in the real-world environment. In studies of bottom-up concept formation and word grounding based on the sensory-motor information of a robot, Nakamura et al. (2009) proposed a model for grounding word meanings in multimodal concepts, and Ando et al. (2013) proposed a model of hierarchical object concept formation based on multimodal information. Several methods that enable robots to acquire words and spatial concepts based on sensory- motor information in an unsupervised manner have been proposed (Isobe et al., 2017; Taniguchi et al., 2017). Hagiwara proposed a Bayesian generative model to acquire the hierarchical structure of spatial concepts based on the sensory-motor information of a robot (Hagiwara et al., 2016, 2018). These studies focused on language acquisition by a robot from a person who gives speech signals to the robot, and enables robots to discover words and categories based on their embodied meanings from raw sensory-motor information (e.g., visual, haptic, auditory, and acoustic speech information). They presume that a person has knowledge about categories and signs representing the categories, i.e., a symbol system shared in the society. Therefore, these computational models cannot be considered as a constructive model of symbol emergence systems. These studies have not dealt with the dynamics of emerging symbols while agents form categories based on sensory-motor information . A concept of symbol emergence in cognitive systems is surveyed in (Tadahiro Taniguchi, 2018). A symbol emergence system is socially self-organized through both semiotic communications with autonomous cognitive developmental agents and physical interactions with the environment, as shown in Figure 1. The figure represents a symbol emergence system. Note that a symbol system cannot be controlled by anyone, but all individuals are constrained by an emergent and shared symbol system. In addition, all of them contribute to creating the socially shared symbol system. To understand this phenomena, the coupled dynamics of both a symbol system shared between the agents and the internal representation systems of individuals has to be modeled with a constructive and computational approach. Computational models for category formation and lexical acquisition by a robot have been studied and proposed. Studies on language evolution and symbol emergence have different challenges, in addition to concept formation and lexical acquisition. They have to deal with organization of a symbol system in the society itself (i.e., the symbol system is unstable), in contrast with studies on category formation and lexical acquisition, where the system can be considered as static and stable. This study focuses on the symbol emergence in a multi-agent system and the category formation in individual agents through semiotic communication, which is the generation and interpretation of symbols associated with the categories formed using the agent's sensory information. The main contributions of this paper are as follows. 3 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 1. Overview of the symbol emergence systems Taniguchi et al. (2016b) • We propose a constructive computational model that represents the dynamics of a symbol emergence system by using probabilistic models for multimodal categorization and message passing based on the Metropolis-Hastings (M-H) algorithm. The model represents mutual dependency of individual categorization and formation of a symbol system in a multi-agent system. • We show that our model representing a multi-agent system and symbol emergence among agents can be regarded as a single agent and a single multimodal categorizer, i.e., an interpersonal categorizer, mathematically. We prove that the symbol emergence in the model is guaranteed to converge. • We evaluate the proposed model of the symbol emergence and category formation from an experiment by using two agents that can obtain visual information and exchange signs in the real-world environment. The results show the validity of our proposed model. The rest of this paper is structured as follows. Section 2 describes the proposed model and inference algorithm for representing the dynamics of symbol emergence and category formation in multi-agent systems. Section 3 presents experimental results, verifying the validity of the proposed model and inference algorithm on the object categorization and symbol emergence. Finally, Section 4 presents conclusions. 2 PROPOSED MODEL AND INFERENCE ALGORITHM 2.1 Expansion of a multimodal categorizer from personal to interpersonal The computational model that we propose in this paper is based on a key finding that a probabilistic generative model of multimodal categorization can be divided into several sub-modules of probabilistic generative models for categorization and message passing between the sub-modules. This idea of dividing a large probabilistic generative model for developing cognitive agents and re-integrating them was firstly introduced as a SERKET framework (Nakamura et al., 2018). However, their idea was only applied to creating a single agent. We found that the idea can be used for modeling multi-agent systems and is very suitable for modeling dynamics of a symbol emergence system. (cid:52)(cid:70)(cid:78)(cid:74)(cid:80)(cid:85)(cid:74)(cid:68)(cid:68)(cid:80)(cid:78)(cid:78)(cid:86)(cid:79)(cid:74)(cid:68)(cid:66)(cid:85)(cid:74)(cid:80)(cid:79)(cid:52)(cid:70)(cid:78)(cid:74)(cid:80)(cid:85)(cid:74)(cid:68)(cid:68)(cid:80)(cid:78)(cid:78)(cid:86)(cid:79)(cid:74)(cid:68)(cid:66)(cid:85)(cid:74)(cid:80)(cid:79)=C4A=0;A4?A4B4=C0C8>= Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 2. The expansion of a multimodal categorizer from personal to interpersonal: (a) shows a generative model of a personal multimodal categorizer between haptics and vision, and (b) shows a generative model of an inter-personal multimodal categorizer between the agents. Dashed lines in (b) show communication between agents. The parameters of these models are simplified. We modeled the symbol emergence in a multi-agent system and the category formation in individual agents as a generative model by expanding a personal multimodal categorizer (see Figure 2 (a)) to an interpersonal multimodal categorizer (see Figure 2 (b)). First, (a) shows a personal multimodal categorizer, which is a generative model with an integrated category c as a latent variable and sensor information from haptics and vision as observations oh and ov. The model is a simple version of multimodal latent Dirichlet allocation used as an object categorizer in the previous studies (Nakamura et al., 2009; Ando et al., 2013). Next, (b) shows an interpersonal multimodal categorizer in which two agents are modeled as a collective intelligence, with word w as a latent variable, and sensor information from agent A and B as observations oA and oB. As shown in Figure 2, the model generating observations through categories on each sensor from an integrated concept in an agent can be extended as the model generating observations through categories on each agent from a word in a multi-agent system. Figure 2 (a) represents a graphical model for probabilistic generative model multimodal categorization, e.g., Nakamura et al. (2014). It can integrate multimodal information, e.g., haptics and visual information, and form categories. Index of category is represented by c in this figure. Following the SERKET framework (Nakamura et al., 2018), we can divide the model into two modules and a communication protocol for a shared node. Here, c is shared by the two modules and the node is renamed by w. We regard an index w as an index of word. In this case, if we regard the two separated modules as two individual agents (i.e., agent A and agent B), the communication between the two nodes can be considered as exchange of signs (i.e., words). As we see later, we found that, if we employ the Metropolis-Hastings algorithm, which is one of the communication protocols that the original SERKET paper proposed, the communication protocol between the nodes can be considered as semiotic communication between two agents. Roughly speaking, the communication is described as follows. Agent A recognizes an object and generates words for Agent B. If the word is consistent to the belief of Agent B, then Agent B accepts the naming with a certain probability; otherwise, Agent B rejects the information, i.e., does not believe the meaning. If the rejection and acceptance probability of the communication is the same as the probability of the M-H 5 𝑜(cid:3002)𝑐(cid:3002)𝑤𝑜(cid:3003)𝑐(cid:3003)𝑤𝑜(cid:3035)𝑐(cid:3035)𝑜(cid:3049)𝑐(cid:3049)𝑐CategoryCategoryObservationObservationObservationIntegratedCategoryWordWordAgent BAgent AObservationCategoryCategory(a)VisionHaptic(b) Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Table 1. Definition of variables in the proposed interpersonal multimodal categorizer Index of the word Index of the category wd d , cB cA d d Observations of agents A and B d , oB oA φA l , φB l θA k , θA k α, β Parameters of the multinomial distribution Parameters of the multinomial distribution Hyperparameters for θ, φ Number of words Number of categories Number of data points Figure 3. Graphical model of interpersonal multimodal categorizer the proposed K L D algorithm, the posterior distribution over w, i.e., symbol emergence among the agents, is theoretically the same as the posterior distribution over c, i.e., interpersonal categorization. 2.2 Generative process on the interpersonal multimodal categorizer This subsection describes the generative process of the interpersonal multimodal categorizer. Figure 3 shows the graphical model is a single graphical model. However, following the SERKET framework (see Figure 2), it can be owned by two different agents separately. The right and left parts indicated with a dashed line in Figure 3 show the parts owned by agents A and B, respectively. Figure 3 and Table 1 show the graphical model and the parameters of a proposed interpersonal multimodal categorizer, respectively. Index wd (of word w) connects the agents A and B as a hidden variable to generate the index of a d are observations category cd from the parameter of multinomial distribution θk in each agent. oA d are on data point d obtained from the sensors attached to the agents A and B, respectively. cA l are the parameters of indices of a category allocated to an observation oA multinomial distributions to generate observations oA d and cB d . α and β are the hyperparameters of θ and φ. K is the number of words in the word dictionary that a robot has. L is the number of categories. D is the number of observed data points. The multinomial distribution is denoted as Multi(·), and the Dirichlet distribution is denoted as Dir(·). The generative process of the interpersonal multimodal categorizer is described as follows. l and φB d based on categories cA d , respectively. φA d and cB d and oB d and oB d and oB The parameters φA l and φB l of multinomial distributions on each category (l ∈ L) are shown as follows: (1) l ∼ Dir(βA), φA l ∼ Dir(βB). φB The parameters θA k and θB (2) k of multinomial distributions on each word (k ∈ K) are shown as follows: (3) k ∼ Dir(αA), θA AgentBAgentA𝜑(cid:3039)(cid:3002)𝐿𝐾𝐾𝛽(cid:3003)𝛼(cid:3002)𝛽(cid:3002)𝜑(cid:3039)(cid:3003)𝑜(cid:3031)(cid:3003)𝑜(cid:3031)(cid:3002)𝑐(cid:3031)(cid:3003)𝐿𝑐(cid:3031)(cid:3002)𝜃(cid:3038)(cid:3002)𝜃(cid:3038)(cid:3003)𝛼(cid:3003)𝑤(cid:3031)𝐷 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization k ∼ Dir(αB). θB The following operations from (5) to (8) are repeated for each data point (d ∈ 1, 2, ..., D): • Observations oA d generated from categories cA d are shown as follows: d and oB d and cB d ∼ Multi(φA oA d ∼ Multi(φB oB cA d cB d ), ). • Indices of categories cA d and cB d generated from word wd are shown as follows: d ∼ Multi(θA cA d ∼ Multi(θB cB wd wd ), ). (4) (5) (6) (7) (8) Theoretically, the generative model is a type of pre-existing model for multimodal categorization (Nakamura et al., 2018, 2014) for an individual agent. In this paper, we assume that the graphical model is representing the symbol emergence in a multi-agent system. 2.3 Communication protocol as an inference algorithm on the interpersonal multimodal categorizer This subsection describes the protocol of semiotic computation between two agents and cognitive dynamics of categorization in individual agents. As a whole, the total process can be regarded as a model of symbol emergence in the multi-agent system. Additionally, the total process can be regarded as an inference process of the probabilistic generative model integrating the two agents' cognitive systems (Figure 3). 2.3.1 Gibbs sampling First, to introduce our proposed model, we describe an ordinary Gibbs sampling algorithm for the integrative probabilistic generative model in Figure 3. Gibbs sampling algorithm is widely used for multimodal categorization and language learning in robotics. Gibbs sampling (Liu, 1994) is known as a type of Markov chain Monte Carlo (MCMC) algorithm for inferring latent variables in probabilistic generative models. Algorithm 1 shows the inference algorithm on the model of Figure 3 using Gibbs sampling. In the algorithm 1, i shows the number of iterations; OA and OB denote a set of all observations in agents A and B, respectively; CA and CB denote a set of all categories in agents A and B, respectively; and W denotes a set of all words. In line 14 of Algorithm 1, word w[i] d is sampled from the product of probability distributions P (cA[i] ) based on parameters θA[i] in agents A and B. ) and P (cB[i] and θB[i] θB[i] θA[i] k k d k d k If an agent can observe both θA[i] , which are internal representations of each agent, this algorithm can work. However, Agent A cannot observe θB[i] . Therefore, no agent can perform Gibbs sampling in this multi-agent system. In this sense, this is not a valid cognitive model for representing the symbol emergence between two agents. , or Agent B cannot observe θA[i] and θB[i] k k k k 7 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Algorithm 1 Gibbs sampling algorithm OA, CA[i−1], βA) OB, CB[i−1], βB) OA, W[i−1], αA) OB, W[i−1], αB) 1: Initialize all parameters 2: for i = 1 to I do 3: 4: l for l = 1 to L do l ∼ Dir(φA[i] φA[i] l ∼ Dir(φB[i] φB[i] l end for for k = 1 to K do k ∼ Dir(θA[i] θA[i] k ∼ Dir(θB[i] θB[i] k end for for d = 1 to D do k d d ∼ Multi(cA[i] cA[i] d ∼ Multi(cB[i] cB[i] d ∼ Multi(cA[i] w[i] end for d d 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: end for d θA[i] w[i−1] θB[i] w[i−1] θA[i] w[i] d d )Multi(oA )Multi(oB )Multi(cB[i] d ) ) d φA[i] cA[i] d d φB[i] cB[i] d θB[i] ) w[i] d 2.3.2 Computational model of the symbol emergence based on an inference procedure using the Metropolis-Hastings algorithm A communication protocol based on the M-H algorithm proposed in SERKET enables us to develop a valid cognitive model, i.e., updating parameters by an agent does not require the agent to use cognitively unobservable information (Nakamura et al., 2018; Hastings, 1970). The M-H algorithm is one of Markov chain Monte Carlo algorithms, and Gibbs sampling is a special case of it. It is known that both algorithms can sample latent variables from the posterior distribution. That means that, theoretically, both of the algorithms can converge to the same stationary distribution. Algorithm 2 shows the proposed inference algorithm based on the M-H algorithm. It can be also regarded as a semiotic communication between two agents, and individual object categorization process under the influence of words that are given by the other agent. A set of all the words W[i] at ith iteration is calculated by two steps of the M-H algorithm, as shown in lines 3 and 5. Basically, the M-H algorithm requires information that an agent can observe within the dotted line in Figure 3 and wd. In this model of symbol emergence, word wd is generated, i.e., uttered, by a speaker agent, either A or B. A listener agent judges if the word properly represents the object the agent looks at. The criterion for the judgement should rely on the information the listener knows, i.e., the probability variables inside the dotted line in Figure 3. Algorithm 3 shows the M-H algorithm, where Sp and Li are the speaker and listener, respectively. Generation of word wd from speaker's observation oSp d , which the speaker regards as the target object, is modeled as a sampling process using P (wSp d ). This sampling can be performed by using the information that is available to the speaker agent. In line 3, the sampling and judgment of words W are performed with agent A as the speaker, and agent B as the listener. In line 5, the sampling and judgment of words W are performed with agent B as the speaker, and agent A as the listener. In the M-H algorithm, the li that is available to the listener agents, i.e., ·Li and wd. d and category cSp d , θsp d cSp Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Simultaneous use of Algorithms 2 and 3 performs a probabilistic inference of the probabilistic generative models shown in Figure 3. Importantly, the M-H algorithm can sample words from the posterior distribution exactly the same way as Gibbs sampling that requires all information owned by an individual agent in a distributed manner. This gives us a mathematical support of the dynamics of symbol emergence. Algorithm 2 Proposed interactive learning process based on the M-H algorithm 1: Initialize all parameters 2: for i = 1 to I do 3: W[i], CA[i], CB[i], θB[i] = M-H algorithm(OA, WA[i−1], CA[i−1], OB, WB[i−1], CB[i−1], θB[i−1]) 4: WB[i] ← W[i] 5: W[i], CB[i], CA[i], θA[i] = M-H algorithm(OB, WB[i], CB[i], OA, WA[i−1], CA[i], θA[i−1]) 6: WA[i] ← W[i] 7: end for Algorithm 3 M-H algorithm θSp OSp, CSp, βSp) OSp, WSp, αSp) 1: M-H algorithm(OSp, WSp, CSp, OLi, WLi, CLi, θLi): 2: for l = 1 to L do l ∼ Dir(φSp φSp 3: l 4: end for 5: for k = 1 to K do k ∼ Dir(θSp θSp 6: 7: end for 8: for d = 1 to D do d ∼ Multi(cSp cSp 9: d 10: end for (cid:18) 11: for d = 1 to D do d ∼ P (wSp wSp 12: z ∼ min 1, u ∼ Unif(0, 1) if u ≤ z then wd = wSp d wd = wLi d cSp d , θSp k ) d θLi k ,wSp P (cLi d ) d θLi P (cLi k ,wLi d ) k )Multi(oSp d φSp l ) k d 13: 14: 15: (cid:19) else 16: 17: 18: end if 19: 20: end for 21: for l = 1 to L do l ∼ Dir(φLi φLi 22: l 23: end for 24: for k = 1 to K do k ∼ Dir(θLi θLi 25: 26: end for 27: for d = 1 to D do d ∼ Multi(cLi d θLi cLi 28: 29: end for 30: return W, CSp, CLi, θLi OLi, CLi, βLi) k OLi, W, αLi) k )Multi(oLi d φLi l ) 9 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 4. Dynamics of symbol emergence and category formation through semiotic communication between the agents in the proposed method. 2.3.3 Dynamics of symbol emergence and category formation This subsection describes how the proposed inference algorithm explains the dynamics of symbol emergence and category formation through semiotic communication. Figure 4 conceptually shows the relationship between the dynamics of symbol emergence and concept formation between the agents, and the inference process for a word in the proposed model. The proposed model consists of the categorization part, where the agents form categories individually, and the communication part, in which the agents exchange words between them. The categorization part is modeled based on latent Dirichlet allocation (LDA). The communication part connects the categorization parts of agents A and B. We modeled the communication part as the inference process of hidden variable w[i] d in the M-H algorithm. is sampled by a proposal distribution with parameters of the speaker In line 12 of Algorithm 3, word wSp d only (i.e., cSp d and θSp k ) by the following formula: d ∼ P (wSp wSp d cSp d , θSp k ). (9) The process can be regarded as a word utterance from agent A in observation oA parameters, as shown in Figure 4 (a). This is a part of semiotic communication. d based on its internal In line 13, sampled word wSp d following formula: is judged by the listener by using acceptance rate z calculated by the (cid:32) (cid:33) z ∼ min 1, P (cLi P (cLi d θLi d θLi k , wSp d ) k , wLi d ) . (10) 𝜑(cid:3039)(cid:3002)𝐿𝐾𝐾𝛽(cid:3003)𝛼(cid:3002)𝛽(cid:3002)𝜑(cid:3039)(cid:3003)𝑜(cid:3003)𝑜(cid:3002)𝑐(cid:3003)𝐿𝑐(cid:3002)𝜃(cid:3038)(cid:3002)𝜃(cid:3038)(cid:3003)𝛼(cid:3003)𝑤(cid:3002)[(cid:3036)]𝑤(cid:3003)[(cid:3036)](a) Sampling 𝑤(cid:3002)[(cid:3036)]by a proposed distribution 𝑃(𝑤𝑜(cid:3002))(b) Judging 𝑤(cid:3002)[(cid:3036)]by an acceptance rate 𝑧𝑧~ min (1,𝑃(𝑐(cid:3031)(cid:3003)𝜃(cid:3038)(cid:3003),𝑤(cid:3031)(cid:3002)[(cid:3036)])𝑃(𝑐(cid:3031)(cid:3003)𝜃(cid:3038)(cid:3003),𝑤(cid:3031)(cid:3003)[(cid:3036)(cid:2879)(cid:2869)]))𝑤[(cid:3036)]Judging 𝑤(cid:3003)[(cid:3036)]by an acceptance rate 𝑧𝑧~ min (1,𝑃(𝑐(cid:3031)(cid:3002)𝜃(cid:3038)(cid:3002),𝑤(cid:3031)(cid:3003)[(cid:3036)])𝑃(𝑐(cid:3031)(cid:3002)𝜃(cid:3038)(cid:3002),𝑤(cid:3031)(cid:3002)[(cid:3036)(cid:2879)(cid:2869)]))Sampling 𝑤(cid:3003)[(cid:3036)]by a proposed distribution 𝑃(𝑤𝑜(cid:3003))ObjectAgent BAgent Aa,a,..,ib,i,..,b Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Acceptance rate z of sampled word wSp d , θLi cLi In lines 14 to 19, sampled word wSp d k , wLi d ). Therefore, this is plausible from a cognitive perspective. acceptance rate z and uniform random number u by the following formulas: d can be calculated from parameters of the listener only (i.e., is probabilistically accepted or rejected by the listener using u ∼ Unif(0, 1), (cid:40) wSp[i] wLi[i−1] d d w[i] d = (u ≤ z) (otherwise), (11) (12) where the continuous uniform distribution is denoted as Unif(·). Word wLp[i−1] of the listener at a previous iteration is used when sampled word wSp is rejected. Roughly speaking, if the listener agent considers d that the current word is likely to be the word that represents the object that the listener also looks at, the listener agent accepts the word and updates its internal representations with a high probability. The process can be explained as a judgment as to whether agent B accepts or rejects an utterance of agent A based on self-knowledge, as shown in Figure 4 (b). d In lines 21 to 29, the internal parameters of the listener are updated based on judged words W by the following formulas: φLi l ∼ Dir(φLi l OLi, CLi, βLi), k ∼ Dir(θLi θLi k OLi, W, αLi), d ∼ Multi(cLi cLi d θLi wd )Multi(oLi d φLi cLi d (13) (14) (15) ). The process can be explained as the updation of self-knowledge based on partial acceptance of the other agent's utterance. Because both the utterance and acceptance of words use only self-knowledge, these processes can be rationally convinced. As shown in Algorithm 2, words W , categories C and parameters φl and θk are inferred by repeating this process with I iterations while exchanging the agents A and B. This inference process not only is rationalized as a model of the symbol emergence and category formation through semiotic communication between the agents, but also gives a mathematical guarantee on the inference of the model parameters. 3 EXPERIMENT 3.1 Experimental setup 3.1.1 Procedure We performed an experiment to verify the validity of the proposed model and algorithm for modeling the dynamics of symbol emergence and concept formation. Specifically, we used an experiment of object categorization in the real world. We also discuss the functions required for semiotic communication in 11 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 5. Overview of the experiment: agents A and B observed N objects placed at the front of them. An agent captures images and suggests words M times for each object. the category formation and the symbol emergence in multi-agent systems from the comparison of three communication algorithms on the proposed model. Figure 5 shows an overview of the experiment. The experiment was performed by the following procedure: • Step 1: Capture and memorize N objects with M images for each object on agent A and B with different angles. • Step 2: Convert a memorized image to a visual feature as observations oA • Step 3: Sampling wd and updating model parameters from observations oA d for agent A and B. d by the M-H algorithm. This step corresponds to semiotic communication between agents A and B based on the opponent's utterances and self-organized categories. • Step 4: Repeat step 3 with I iterations. • Step 5: Evaluate the coincidence of words and categories between agents A and B for each object. d , oB d , oB In the experiment, objects N, images M, and iterations I were set as 10, 10, and 300, respectively. We performed steps 1 to 5 with 10 trials for a statistical evaluation. 3.1.2 Capturing and memorizing images (Step 1) Figure 6 shows the experimental environment. Two cameras on agents A and B captured object's images from different angles. Captured images were memorized on a computer. Resolution of a captured image was 640 pixels on width and 360 pixels on height. Target objects were a book, can, mouse, camera, bottle, cup, pen, tissue box, stapler, and scissors , as shown in the right side of Figure 6. 3.1.3 Converting memorized images to observations (Step 2) An object's image captured by a camera is converted to a visual feature as an observation by Caffe (Jia et al., 2014), which is a framework for convolutional neural networks (CNN) (Krizhevsky et al., 2012) provided by Berkeley Vision and Learning Center. The parameters of CNN were trained by using the dataset from the ImageNet Large Scale Visual Recognition Challenge 20121. Visual feature oi ∈ {o1, o2,··· , oI} was calculated by the following equation: (cid:80)I oi = exp (vi) j=0 exp (vj) × 102, (16) 1 ILSVRC2012: http://www.image-net.org/challenges/LSVRC/2012/ Mimages and wordsMimages and words・・・Object 1Agent BAgent Aa,a,..,iObject 2Agent BAgent AObject NAgent BAgent Ac,c,..,ef,f,..,ff,d,..,jk,j,..,kb,i,..,bMimages and words Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 6. Experimental environment: two cameras were set as agent A and B with different angles. Each agent captured a target object placed at the center of two agents ten times, and we prepared ten objects as targets. where vi ∈ {v1, v2,··· , vI} is a value in the 7th layer of Caffe. I is the number of output units at the 7th layer and was set as 4096 in the experiment. We chose the 7th layer to use Caffe as a feature extractor, not as an object recognizer. 3.1.4 Communication and categorization (Steps 3 and 4) We conducted the experiment by employing the proposed model with three communication algorithms: • No communication: z = 0 is used instead of Formula (10) in the inference. In this algorithm, two agents have no communication. Each agent does the categorization based on observations only, without word information from the other agent. • No rejection: z = 1 is used instead of Formula (10) in the inference. In this algorithm, two agents accept all words from the other agent and update model parameters. • Proposed algorithm: Formula (10) by the M-H algorithm is used in the inference. In this algorithm, two agents decide whether to accept or reject a word from the other agent based on self-organized categories. The validity of the proposed model in the dynamics of symbol emergence and category formation and the functions required for semiotic communication are discussed by comparing the results between the proposed algorithm and two baseline algorithms, i.e. no rejection and no communication. The hyperparameters of the proposed model were set as follows: αA = 0.01, αB = 0.001, βA = 0.01, βB = 0.001. The number of data points D was 100. The number of categories and words were set as follows: L = 15, K = 15, to cover ten target objects. As characters corresponding to the word index, we used the following 15 characters: a, b, c, d, e, f, g, h, i, j, k, l, m, n, and o. 3.1.5 Evaluation criteria (Step 5) We evaluated the performance of the proposed model of the symbol emergence and concept formation using the following metrics: the kappa coefficient (Cohen, 1960) of words and adjusted rand index (ARI) (Hubert and Arabie, 1985) of categories between the agents. 13 Agent AAgent BBookCanMouseCameraBottleCupPenTissue boxStaplerScissors Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Table 2. Kappa coefficient on words and ARI on categories between agents A and B: the result is described with mean, standard deviation (SD), p-value, and t-test for 3 algorithms: no communication, no rejection, and the proposed algorithm. In the t-test, **: (p < 0.01), *: (p < 0.05), n.s.: not significant. Algorithm No rejection No communication Mean 0.01 0.57 Proposed algorithm 0.88 Kappa coefficient SD P-value 0.04 8.9 × 10−18 1.0 × 10−9 0.06 0.05 - ARI T-test Mean 0.89 0.88 0.92 ** ** - SD P-value 0.07 2.2 × 10−1 0.03 3.0 × 10−3 0.02 - T-test n.s. ** - The kappa coefficient was used as an evaluation criteria indicating the coincidence of words between agents A and B. Kappa coefficient κ was calculated by the following equation: κ = Co − Ce 1 − Ce , (17) where Co is the coincidence rate of words between agents, and Ce is the coincidence rate of words between agents by random chance. The kappa coefficient is judged as follows: Excellent : (κ > 0.8), Good : (κ > 0.6), M oderate : (κ > 0.4), P oor : (κ > 0.0). The ARI was used as an evaluation criteria indicating the coincidence of categories between agents A and B. The ARI was calculated by the following equation: ARI = Index − Expected Index Max Index − Expected Index . (18) Welch's t-test was used for statistical hypothesis testing between the proposed algorithm and two baseline algorithms, i.e. no communication and no rejection. 3.2 Experimental results Table 2 shows the experimental results: the kappa coefficient and ARI for the proposed algorithm and two baseline algorithms, i.e. no communication and no rejection. For the kappa coefficient on words between agents A and B, the proposed algorithm obtained a higher value than the baseline algorithms, and there were significant differences between the proposed algorithm and baseline algorithms in the t-test. The result implies that the agents used the same words for observations with a very high coincidence (of 0.8 or more) in the proposed algorithm. The ARI for the proposed algorithm was higher than for the baseline algorithms, and there were significant differences between the proposed algorithm and no rejection. In case of no rejection, the word has a negative effect on categorization between the agents, comparing with the result of no communication. On the other hand, in the proposed algorithm that stochastically accepts the other agent's word based on self-knowledge, the word positively acts on the categorization between agents. This result suggests that a rejection strategy in the semiotic communication works as an important function in the language evolution. Naturally, our result suggests it is biologically feasible and mathematically feasible. Figure 7 shows transitions in the kappa coefficients of words between agents A and B by the proposed algorithm, no rejection, and no communication in ten trials. In case of no communication, because all words of the opponent were rejected, the coincidence of words was at the level of random chance. In Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 7. Transition on the kappa coefficient of words between agents: a line shows an average value, and top and bottom of each color show a maximum and minimum values in ten trials. Figure 8. Transition on the ARI of categories between agents: a line shows an average value, and top and bottom of each color show a maximum and minimum values in ten trials. Figure 9. Examples of object's images: captured images of a bottle, can, and book from the viewpoints of agents A and B. case of no rejection, although the coincidence of words is increasing in the initial iterations, it drifts and stagnates at approximately 0.55, which is a moderate value. In case of the proposed algorithm, the kappa coefficient is higher than for the baseline algorithms, and the sharing of words accompanying the increase in iterations was confirmed. Figure 8 shows transitions for the ARIs of categories between agents A and B by the proposed algorithm, no rejection, and no communication in ten trials. Compared with the baseline algorithms, it was confirmed that the proposed algorithm gradually and accurately forms and shares the categories between the agents. Compared with no communication, the proposed algorithm promoted the sharing of categories from approximately 80 iterations, and obtained the highest ARI after approximately 150 iterations. The result suggests the dynamics of symbol emergence and concept formation, where a symbol communication slowly affects the category formation in an agent and promotes sharing of the categories between the agents. It is a cognitively natural result: repetition of semiotic communication in the same environment gradually causes the sharing of categories between the agents. For qualitative evaluation, we showed words assigned to each of the three objects: bottle, can, and book. Figure 9 shows the examples of object's images observed from the viewpoints of agent A and B. Table 3 shows the words sampled by agents A and B for three example objects on three algorithms: the proposed algorithm and two baseline algorithms (no rejection and no communication). The sampled words are described as three best results out of ten sampled words for each object. (·) shows the rate of a word to ten 15 050100150200250300Iteration0.00.20.40.60.81.0Kappa coefficientAlgorithmproposed_algorithmno_rejectionno_communication050100150200250300Iteration0.00.20.40.60.81.0ARIAlgorithmproposed_algorithmno_rejectionno_communicationAgent AAgent BAgent AAgent BAgent AAgent BBottleCanBook Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Table 3. Sampling results of words for three example objects by 3 communication algorithms, i.e. no communication, no rejection, and the proposed algorithm: the sampling results are described as 1st, 2nd, and 3rd words in ten sampled words for each object. The rate of a word to ten sampled words is described in (·) Bottle Object Word 1st 2nd 3rd 1st 2nd 3rd 1st 2nd 3rd Book Can No communication Agent A h, l (0.2) - Agent B j, l (0.2) - b, d, f, i, m, o (0.1) b, d, e, h, i, k (0.1) h, i (0.3) - a, e, k, n (0.1) m, o (0.2) - c, d, g, i, k, l (0.1) l (0.3) e (0.2) b, g, h, j, o (0.1) a (0.3) g, k (0.2) - i (0.5) b (0.4) c (0.1) g (0.5) k (0.3) j (0.2) h (0.4) c, n (0.3) - - n (0.5) c (0.4) h (0.1) No rejection Proposed algorithm Agent A Agent B Agent A Agent B c (1.0) b (0.7) i (0.2) c (0.1) j (0.6) g, k (0.2) f (1.0) f (1.0) c (1.0) - - - - - - - - b (0.6) k (0.4) - b (0.6) k (0.4) - (10a) Agent A (10b) Agent B Figure 10. ARI between object labels and categories formed by the proposed algorithm in ten trials with agents A and B. The horizontal axis and vertical axis show the iteration and ARI, respectively. sampled words. In case of no communication, a word representing an object was not shared between the agents. In case of no rejection, words representing an object such as "i," "b," and "c" (for the bottle) were shared, but the probabilities of words are not high. In case of the proposed algorithm, it was confirmed that a word representing an object was shared between the agents with a high probability. To evaluate the accuracy of categorization of actual objects, the ARI between the object labels and categories formed by the proposed algorithm is shown in Figure 10. At 300th iteration, the proposed algorithm shows a high accuracy, as the categorization of real-world objects by an unsupervised learning, despite being influenced by the words of another agent. The learning process of the correspondence relationship between words and objects for each agent is shown in Figure 11 as a confusion matrix. As the number of iterations increases, words corresponding to 050100150200250300Iteration0.00.20.40.60.81.0ARIAlgorithmproposed_algorithmno_rejectionno_communication050100150200250300Iteration0.00.20.40.60.81.0ARIAlgorithmproposed_algorithmno_rejectionno_communication Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization (11c) Agent A, 1 iteration (11d) Agent A, 50 iterations (11e) Agent A, 300 iterations (11f) Agent B, 1 iteration (11g) Agent B, 50 iterations (11h) Agent B, 300 iterations Figure 11. Confusion matrix between words and object's labels in each agent. The horizontal axis and vertical axis show the index of object's label and word, respectively. The order of the words was sorted according to the frequency of each object at agent A with 300 iterations. (12i) Two dimensions (12j) Three dimensions Figure 12. Results of PCA on the confusion matrix for agents A and B. The results are described from 30 to 300 iterations with a 30 iteration interval. object labels were learned from random to one-on-one relationship. Each word was allocated to describe an object at the result of 300 iterations. 17 12345678910fgcnakdjlibehmoAgent A at 1 iteration024681012345678910docnabmleifgkjhAgent A at 50 iterations024681012345678910fgcnakdjlibehmoAgent A at 300 iterations024681012345678910fgcnakdjlibehmoAgent B at 1 iteration024681012345678910docnabmleifgkjhAgent B at 50 iterations024681012345678910fgcnakdjlibehmoAgent B at 300 iterations02468105051015420246810306090120150180210240270300306090120150180210240270300Two dimensionsagent Aagent B5051015420246810420246Three dimensionsagent Aagent B Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Figure 12 shows the result of principal component analysis (PCA) between the confusion matrices for agents A and B in Figure 11. The results are described from 30 to 300 iterations at 30 iterations intervals on two and three dimensions. As the number of iterations increases, the results of PCA on the confusion matrices of two agents are getting closer. This can be interpreted as a process in which the interpretation system of words and objects between the agents approaches by the iteration of the semiotic communication. 3.3 Discussion We evaluated the validity of the proposed model and algorithm as a model of the dynamics on symbol emergence and category formation from the experiments using daily objects in the real-world environment. In the experiment, we compared the process of symbol emergence and category formation of objects between the agents by using three communication algorithms: the proposed algorithm, no rejection, and no communication. The experimental results demonstrated the following three events in the communication algorithms. • In case of no communication, when the agent rejects all the other agent's utterances, the coincidence of categories was high but the coincidence of words was not shared between the agents. This result is understood as the following event: similar categories are formed when two agents have similar sensors that individually observe the same object. • In case of no rejection, when the agent unconditionally accepts the other agent's utterances and updates the internal parameters, the coincidence of words drifts and stagnates, and the coincidence of categories decreases, compared with no communication. This result is understood as the following event: other agent's utterances that use different symbols interfere with categorization within the agent's individual as a noise. • In the proposed algorithm, which probabilistically accepts the other agent's utterances based on the internal parameters, the coincidence of words was very high, and the coincidence of categories also had a high value compared with other algorithms. This result is also convincing as a mechanism of the symbol emergence and category formation based on the human semiotic communication. Furthermore, it was suggested that the semiotic communication needs the function of rejecting other's utterances based on one's knowledge in the dynamics of symbol emergence and category formation between the agents. Naturally, our result can be interpreted as biologically and mathematically feasible. 4 CONCLUSIONS This study focused on the symbol emergence in a multi-agent system and the category formation in individual agents through semiotic communication that is the generation and interpretation of symbols associated with categories formed from the agent's perception. We proposed a model and an inference algorithm representing the dynamics of symbol emergence and category formation through semiotic communication between the agents as an interpersonal multimodal categorizer. We showed the validity of the proposed model and inference algorithm on the dynamics of symbol emergence and concept formation in multi-agent system from the mathematical explanation and the experiment of object categorization and symbol emergence in a real environment. The experimental results on object categorization using three communication styles, i.e. no communication, no rejection, and the proposed algorithm based on the proposed model suggested that semiotic communication needs a function of rejecting other's utterances based on one's knowledge in the dynamics of symbol emergence and category formation between agents. Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization This study did not model an emergence of a grammar. However, the proposed model and algorithm succeeded in giving a mathematical explanation for the dynamics of symbol emergence in multi-agent system and category formation in individual agents through semiotic communication. This means our study showed a certain direction for treating multi-agent system logically in the symbol emergence and category formation. As future work, we are extending the proposed model based on a mutual segmentation hypothesis of sound strings and situations based on co-creative communication (Okanoya and Merker, 2007). The extension will be achieved through the following research process. • The extension for a mutual segmentation model of sound strings and situations based on multimodal information will be achieved based on a multimodal LDA with nested Pitman-Yor language model (Nakamura et al., 2014) and a spatial concept acquisition model that integrates self-localization and unsupervised word discovery from spoken sentences (Taniguchi et al., 2016a). • To reduce development and calculation costs associated with the large-scale model, "Serket: An Architecture for Connecting Stochastic Models to Realize a Large-Scale Cognitive Model" (Nakamura et al., 2018), will be used. • Experiment with N agents will be performed on symbol emergence and concept formation by expanding the proposed model. We can design an experiment as a communication structure based on human conversation, because human conversation is usually performed by two people. In a related study, Oshikawa et al. (2018) proposed a Gaussian process hidden semi-Markov model, which enables robots to learn rules of interaction between persons by observing them in an unsupervised manner. • Experimental results have shown the importance of a rejection strategy, but the evidence for the human brain to use such a strategy is not shown. We are planning to conduct psychological experiments. • As an exploratory argument, mapping category c to observation o is theoretically possible for a neural network. A future study can develop a deep generative model, which integrates deep learning and generative model, by application of multimodal learning with deep generative models (Suzuki et al., 2016). FUNDING This work was supported by MEXT/JSPS KAKENHI Grant Number JP17H06383 in #4903 (Evolinguistics) and JP18K18134. REFERENCES Ando, Y., Nakamura, T., and Nagai, T. (2013). Formation of hierarchical object concept using hierarchical latent dirichlet allocation. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) , 2272 -- 2279 Bleys, J. (2015). Language Strategies for the Domain of Colour. No. 3 in Computational Models of Language Evolution (Berlin: Language Science Press) Chomsky, N. (1975). The Logical Structure of Linguistic Theory (Springer) Cohen, J. (1960). A coefficient of agreement for nominal scales. Educational and Psychological Measurement 20, 37 -- 46. doi:10.1177/001316446002000104 19 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization De Beule, J., De Vylder, B., and Belpaeme, T. (2006). A cross-situational learning algorithm for damping homonymy in the guessing game. In Artificial Life X, eds. L. M. Rocha, L. S. Yaeger, M. A. Bedau, D. Floreano, R. L. Goldstone, and A. Vespignani (MIT Press), 466 -- 472 Graesser, L., Cho, K., and Kiela, D. (2019). Emergent linguistic phenomena in multi-agent communication games. CoRR abs/1901.08706 Hagiwara, Y., Inoue, M., Kobayashi, H., and Taniguchi, T. (2018). Hierarchical spatial concept formation based on multimodal information for human support robots. Frontiers in Neurorobotics 12, 11. doi:10. 3389/fnbot.2018.00011 Hagiwara, Y., Masakazu, I., and Tadahiro, T. (2016). Place concept learning by hmlda based on position and vision information. IFAC-PapersOnLine 49, 216 -- 220 Hashimoto, T. (1999). Modeling categorization dynamics through conversation by constructive approach. In Advances in Artificial Life (Berlin, Heidelberg: Springer Berlin Heidelberg), 730 -- 734 Hastings, W. K. (1970). Monte carlo sampling methods using markov chains and their applications. Biometrika 57, 97 -- 109 Hubert, L. and Arabie, P. (1985). Comparing partitions. Journal of Classification 2, 193 -- 218. doi:10.1007/ BF01908075 Isobe, S., Taniguchi, A., Hagiwara, Y., and Taniguchi, T. (2017). Learning relationships between objects and places by multimodal spatial concept with bag of objects. In Social Robotics (Cham: Springer International Publishing), 115 -- 125 Jia, Y., Shelhamer, E., Donahue, J., Karayev, S., Long, J., Girshick, R., et al. (2014). Caffe: Convolutional architecture for fast feature embedding. In Proceedings of the 22nd ACM international conference on Multimedia (ACM), 675 -- 678 Kirby, S. (1999). Learning, bottlenecks and the evolution of recursive syntax Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems. 1097 -- 1105 Lazaridou, A., Peysakhovich, A., and Baroni, M. (2016). Multi-agent cooperation and the emergence of (natural) language. CoRR abs/1612.07182 Lee, J., Cho, K., Weston, J., and Kiela, D. (2017). Emergent translation in multi-agent communication. CoRR abs/1710.06922 Liu, J. S. (1994). The collapsed gibbs sampler in bayesian computations with applications to a gene regulation problem. Journal of the American Statistical Association 89, 958 -- 966. doi:10.1080/01621459. 1994.10476829 Matuszek, C. (2018). Grounded language learning: Where robotics and nlp meet. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18 (International Joint Conferences on Artificial Intelligence Organization), 5687 -- 5691. doi:10.24963/ijcai.2018/810 Morita, J., Konno, T., and Hashimoto, T. (2012). The role of imitation in generating a shared communication system. In Proceedings of the 34th Annual Meeting of the Cognitive Science Society (Sapporo, Japan), 779 -- 784 Nakamura, T., Nagai, T., Funakoshi, K., Nagasaka, S., Taniguchi, T., and Iwahashi, N. (2014). Mutual In 2014 IEEE/RSJ learning of an object concept and language model based on mlda and npylm. International Conference on Intelligent Robots and Systems. 600 -- 607. doi:10.1109/IROS.2014.6942621 Nakamura, T., Nagai, T., and Iwahashi, N. (2009). Grounding of word meanings in multimodal concepts using lda. IEEE/RSJ International Conference on Intelligent Robots and Systems , 3943 -- 3948 Hagiwara et al. Symbol Emergence as an Interpersonal Multimodal Categorization Nakamura, T., Nagai, T., and Taniguchi, T. (2018). Serket: An architecture for connecting stochastic models to realize a large-scale cognitive model. Frontiers in Neurorobotics 12, 25. doi:10.3389/fnbot. 2018.00025 Okanoya, K. and Merker, B. (2007). Neural Substrates for String-Context Mutual Segmentation: A Path to Human Language (London: Springer London). 421 -- 434. doi:10.1007/978-1-84628-779-4 22 Oshikawa, S., Nakamura, T., Nagai, T., Kaneko, M., Funakoshi, K., Iwahashi, N., et al. (2018). Interaction In 2018 27th IEEE modeling based on segmenting two persons motions using coupled gp-hsmm. International Symposium on Robot and Human Interactive Communication (RO-MAN). 288 -- 293. doi:10. 1109/ROMAN.2018.8525797 Spranger, M. (2011). The Evolution of Grounded Spatial Language. Ph.D. thesis, Vrije Universiteit Brussel, Brussels Spranger, M. (2015). The Evolution of Grounded Spatial Language. No. 5 in Computational Models of Language Evolution (Berlin: Language Science Press) Spranger, M., Loetzsch, M., and Steels, L. (2012). A perceptual system for language game experiments. In Language Grounding in Robots, eds. L. Steels and M. Hild (Springer). 89 -- 110 Steels, L. (1995). A self-organizing spatial vocabulary. Artif. Life 2, 319 -- 332. doi:10.1162/artl.1995.2.319 Steels, L. (1997). The synthetic modeling of language origins. Evolution of Communication Journal 1. doi:10.1075/eoc.1.1.02ste Steels, L. (2015). The Talking Heads experiment: Origins of words and meanings (Berlin: Language Science Press) Steels, L. and Belpaeme, T. (2005). Coordinating perceptually grounded categories through language: a case study for colour. Behavioral and Brain Sciences 28, 469 -- 489. doi:10.1017/S0140525X05000087 Steels, L. and Kaplan, F. (2000). Aibo's first words: The social learning of language and meaning. Evolution of Communication 4, 3 -- 32. doi:https://doi.org/10.1075/eoc.4.1.03ste Steels, L. and Loetzsch, M. (2008). Perspective alignment in spatial language. In Spatial Language and Dialogue, eds. K. R. Coventry, T. Tenbrink, and J. A. Bateman (Oxford University Press) Suzuki, M., Nakayama, K., and Matsuo, Y. (2016). Joint Multimodal Learning with Deep Generative Models. arXiv e-prints , arXiv:1611.01891 Tadahiro Taniguchi, M. H. L. J. T. N. B. R. T. M. N. I. E. O. J. P. F. W., Emre Ugur (2018). Symbol IEEE Transactions on Cognitive and emergence in cognitive developmental systems: a survey. Developmental Systems (in press) DOI: 10.1109/TCDS.2018.2867772 Taniguchi, A., Hagiwara, Y., Taniguchi, T., and Inamura, T. (2017). Online spatial concept and lexical acquisition with simultaneous localization and mapping. In 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). 811 -- 818. doi:10.1109/IROS.2017.8202243 Taniguchi, A., Taniguchi, T., and Inamura, T. (2016a). Spatial concept acquisition for a mobile robot that integrates self-localization and unsupervised word discovery from spoken sentences. IEEE Transactions on Cognitive and Developmental Systems 8, 285 -- 297 Taniguchi, A., Taniguchi, T., and Inamura, T. (2018). Unsupervised spatial lexical acquisition by updating a language model with place clues. Robotics and Autonomous Systems 99, 166 -- 180. doi:https: //doi.org/10.1016/j.robot.2017.10.013 Taniguchi, T., Nagai, T., Nakamura, T., Iwahashi, N., Ogata, T., and Asoh, H. (2016b). Symbol emergence in robotics: a survey. Advanced Robotics 30, 706 -- 728. doi:10.1080/01691864.2016.1164622 Tomasello, M. (1999). The Cultural Origins of Human Cognition (Harvard University Press) 21
1708.01980
1
1708
2017-08-07T03:46:48
Translating Phrases in Neural Machine Translation
[ "cs.CL" ]
Phrases play an important role in natural language understanding and machine translation (Sag et al., 2002; Villavicencio et al., 2005). However, it is difficult to integrate them into current neural machine translation (NMT) which reads and generates sentences word by word. In this work, we propose a method to translate phrases in NMT by integrating a phrase memory storing target phrases from a phrase-based statistical machine translation (SMT) system into the encoder-decoder architecture of NMT. At each decoding step, the phrase memory is first re-written by the SMT model, which dynamically generates relevant target phrases with contextual information provided by the NMT model. Then the proposed model reads the phrase memory to make probability estimations for all phrases in the phrase memory. If phrase generation is carried on, the NMT decoder selects an appropriate phrase from the memory to perform phrase translation and updates its decoding state by consuming the words in the selected phrase. Otherwise, the NMT decoder generates a word from the vocabulary as the general NMT decoder does. Experiment results on the Chinese to English translation show that the proposed model achieves significant improvements over the baseline on various test sets.
cs.CL
cs
Translating Phrases in Neural Machine Translation Xing Wang† Zhaopeng Tu‡ Deyi Xiong†∗ Min Zhang† [email protected], {dyxiong, minzhang}@suda.edu.cn †Soochow University, Suzhou, China ‡ Tencent AI Lab, Shenzhen, China 7 1 0 2 g u A 7 ] L C . s c [ 1 v 0 8 9 1 0 . 8 0 7 1 : v i X r a [email protected] Abstract Phrases play an important role in natu- ral language understanding and machine translation (Sag et al., 2002; Villavicencio et al., 2005). However, it is difficult to in- tegrate them into current neural machine translation (NMT) which reads and gener- ates sentences word by word. In this work, we propose a method to translate phrases in NMT by integrating a phrase memory storing target phrases from a phrase-based statistical machine translation (SMT) sys- tem into the encoder-decoder architecture of NMT. At each decoding step, the phrase memory is first re-written by the SMT model, which dynamically generates rel- evant target phrases with contextual in- formation provided by the NMT model. Then the proposed model reads the phrase memory to make probability estimations for all phrases in the phrase memory. If phrase generation is carried on, the NMT decoder selects an appropriate phrase from the memory to perform phrase translation and updates its decoding state by con- suming the words in the selected phrase. Otherwise, the NMT decoder generates a word from the vocabulary as the general NMT decoder does. Experiment results on the Chinese→English translation show that the proposed model achieves signif- icant improvements over the baseline on various test sets. 1 Introduction Neural machine translation (NMT) has been re- ceiving increasing attention due to its impressive ∗Corresponding author translation performance (Kalchbrenner and Blun- som, 2013; Cho et al., 2014; Sutskever et al., 2014; Bahdanau et al., 2015; Wu et al., 2016). Sig- nificantly different from conventional statistical machine translation (SMT) (Brown et al., 1993; Koehn et al., 2003; Chiang, 2005), NMT adopts a big neural network to perform the entire trans- lation process in one shot, for which an encoder- decoder architecture is widely used. Specifically, the encoder encodes a source sentence into a con- tinuous vector representation, then the decoder uses the continuous vector representation to gen- erate the corresponding target translation word by word. The word-by-word generation philosophy in NMT makes it difficult to translate multi-word phrases. Phrases, especially multi-word expres- sions, are crucial for natural language understand- ing and machine translation (Sag et al., 2002; Villavicencio et al., 2005) as the meaning of a phrase cannot be always deducible from the mean- ings of its individual words or parts. Unfortu- nately current NMT is essentially a word-based or character-based (Chung et al., 2016; Costa-juss`a and Fonollosa, 2016; Luong and Manning, 2016) translation system where phrases are not consid- ered as translation units. In contrast, phrases are much better than words as translation units in SMT and have made a significant advance in trans- lation quality. Therefore, a natural question arises: Can we translate phrases in NMT? Recently, there have been some attempts on multi-word phrase generation in NMT (Stahlberg et al., 2016b; Zhang and Zong, 2016). However these efforts constrain NMT to generate either syntactic phrases or domain phrases in the word- by-word generation framework. To explore the phrase generation in NMT beyond the word-by- word generation framework, we propose a novel architecture that integrates a phrase-based SMT model into NMT. Specifically, we add an auxil- iary phrase memory to store target phrases in sym- bolic form. At each decoding step, guided by the decoding information from the NMT decoder, the SMT model dynamically generates relevant target phrase translations and writes them to the mem- ory. Then the NMT decoder scores phrases in the phrase memory and selects a proper phrase or word with the highest probability. If the phrase generation is carried out, the NMT decoder gen- erates a multi-word phrase and updates its decod- ing state by consuming the words in the selected phrase. Furthermore, in order to enhance the ability of the NMT decoder to effectively select appropriate target phrases, we modify the encoder of NMT to make it fit for exploring structural information of source sentences. Particularly, we integrate syn- tactic chunk information into the NMT encoder, to enrich the source-side representation. We vali- date our proposed model on the Chinese→English translation task. Experiment results show that the proposed model significantly outperforms the conventional attention-based NMT by 1.07 BLEU points on multiple NIST test sets. The rest of this paper is organized as fol- lows. Section 2 briefly introduces the attention- based NMT as background knowledge. Section 3 presents our proposed model which incorporates the phrase memory into the NMT encoder-decoder architecture, as well as the reading and writing procedures of the phrase memory. Section 4 presents our experiments on the Chinese→English translation task and reports the experiment results. Finally we discuss related work in Section 5 and conclude the paper in Section 6. 2 Background Neural machine translation often adopts the encoder-decoder architecture with recurrent neu- ral networks (RNN) to model the translation pro- cess. The bidirectional RNN encoder which con- sists of a forward RNN and a backward RNN reads a source sentence x = x1, x2, ..., xTx and transforms it into word annotations of the entire source sentence h = h1, h2, ..., hTx. The de- coder uses the annotations to emit a target sentence y = y1, y2, ..., yTy in a word-by-word manner. In the training phase, given a parallel sentence (x, y), NMT models the conditional probability as Tx(cid:88) N(cid:88) Ty(cid:88) follows, P (yx) = Ty(cid:89) i=1 P (yiy<i, x) (1) where yi is the target word emitted by the decoder at step i and y<i = y1, y2, ..., yi−1. The condi- tional probability P (yiy<i, x) is computed as P (yiy<i, x) = sof tmax(f (si, yi−1, ci)) (2) where f (·) is a non-linear function and si is the hidden state of the decoder at step i: si = g(si−1, yi−1, ci) (3) where g(·) is a non-linear function. Here we adopt Gated Recurrent Unit (Cho et al., 2014) as the re- current unit for the encoder and decoder. ci is the context vector, computed as a weighted sum of the annotations h: ci = αt,jhj (4) j=1 where hj is the annotation of source word xj and its weight αt,j is computed by the attention model. We train the attention-based NMT model by maximizing the log-likelihood: C(θ) = log P (yn i yn <i, xn) (5) n=1 i=1 given the training data with N bilingual sentences (Cho, 2015). In the testing phase, given a source sentence x, we use beam search strategy to search a target sen- tence y that approximately maximizes the condi- tional probability P (yx) y = argmax y P (yx) (6) 3 Approach In this section, we introduce the proposed model which incorporates a phrase memory into the encoder-decoder architecture of NMT. Inspired by the recent work on attaching an external struc- ture to the encoder-decoder architecture (Gulcehre et al., 2016; Gu et al., 2016; Tang et al., 2016; Wang et al., 2017), we adopt a similar approach to incorporate the phrase memory into NMT. The balancing weight λ is produced by the bal- ancer – a multi-layer network. The balancer net- work takes as input the decoding information, in- cluding the context vector ci, the previous decod- ing state si−1 and the previous generated word yi−1: λi = σ(fb(si, yi−1, ci)) (8) where σ(·) is a sigmoid function and fb(·) is the activation function. Intuitively, the weight λ can be treated as the estimated importance of the phrase to be generated. We expect λ to be high if the phrase is appropriate at the current decoding step. Well-Formed Phrases We employ a source- side chunker to chunk the source sentence, and only phrases that corresponds to a source chunk are used in our model. We restrict ourselves to the well-formed chunk phrases based on the fol- lowing considerations: (1) In order to take ad- vantage of dynamic programming, we restrict our- selves to non-overlap phrases.1 (2) We explicitly utilize the boundary information of the source-side chunk phrases, to better guide the proposed model to adopt a target phrase at an appropriate decoding step. (3) We enable the model to exploit the syn- tactic categories of chunk phrases to enhance the proposed model with its selection preference for special target phrases. With these information, we enrich the context vector ci to enable the proposed model to make better decisions, as described be- low. Following the commonly-used strategy in se- quence tagging tasks (Xue and Shen, 2003), we al- low the words in a phrase to share the same chunk tag and introduce a special tag for the beginning word. For example, the phrase " ɞ ᐰ (in- formation security)" is tagged as a noun phrase "NP", and the tag sequence should be "NP B NP". Partially motivated by the work on integrating lin- guistic features into NMT (Sennrich and Haddow, 2016), we represent the encoder input as the com- bination of word embeddings and chunking tag embeddings, instead of word embeddings alone in the conventional NMT. The new input is formu- lated as follows: [Ewxi, Etti] (9) 1Overlapped phrases may result in a high dimensionality in translation hypothesis representation and make it hard to employ shared fragments for efficient dynamic programming. Figure 1: Architecture of the NMT decoder with the phrase memory. The NMT decoder per- forms phrase generation using the balancer and the phrase memory. 3.1 Framework Figure 1 shows an example. Given the gener- ated words "President Bush emphasized that", the model generates the next fragment either from a word generation mode or a phrase generation mode. If the model selects the word generation mode, it generates a word by the NMT decoder as in the standard NMT framework. Otherwise, it generates a multi-word phrase by enquiring a phrase memory, which is written by an SMT de- coder based on the dynamic decoding information from the NMT model for each step. The trade-off between word generation mode and phrase gener- ation mode is balanced by a weight λ, which is produced by a neural network based balancer. a generated translation y = {y1, y2, . . . , yTy} consists of two sets of frag- ments: words generated by NMT decoder w = {w1, w2, . . . , wK} and phrases generated from the phrase memory p = {p1, p2, . . . , pL} . The prob- ability of generating y is calculated by Formally, P (yx) = (1 − λt(wk))Pword(wk) (cid:89) wk∈w ×(cid:89) pl∈p λt(pl)Pphrase(pl) (7) where Pword(wk) is the probability of generating the word wk (see Equation 2), Pphrase(pl) is that of generating the phrase pl which will be described in Section 3.2, and t(·) is the decoding step to gen- erate the corresponding fragment. where Ew ∈ Rdw×V NM T is a word embedding matrix and dw is the word embedding dimension- ality, Et ∈ Rdt×V T AG is a tag embedding matrix and dt is the tag embedding dimensionality. [·] is the vector concatenation operation. 3.2 Phrase Memory The phrase memory stores relevant target phrases provided by an SMT model, which is trained on the same bilingual corpora. At each decoding step, the memory is firstly erased and re-written by the SMT model, the decoding of which is based on the translation information provided by the NMT model. Then, the proposed model enquires phrases along with their probabilities Pphrase from the memory. Writing to Phrase Memory Given a partial translation y<i = {y1, y2, . . . , yt−1} gener- ated from NMT, the SMT model picks potential phrases extracted from the translation table. The phrases are scored with multiple SMT features, including the language model score, the trans- lation probabilities, the reordering score, and so on. Specially, the reordering score depends on alignment information between source and target words, which is derived from attention distribution produced by the NMT model (Wang et al., 2017). SMT coverage vector in (Wang et al., 2017) is also introduced to avoid repeat phrasal recommen- dations. In our work, the potential phrase is phrase with high SMT score which is defined as follow- ing: SM Tscore(ply<t, x) = wmhm(pl, x(pl)) m=1 (10) where pl is a target phrase and x(pl) is its cor- responding source span. hm(pl, x(pl)) is a SMT feature function and wm is its weight. The feature weights can be tuned by the minimum error rate training (MERT) algorithm (Och, 2003). This leads to a better interaction between SMT and NMT models. It should be emphasized that our memory is dynamically updated at each de- coding step based on the decoding history from both SMT and NMT models. The proposed model is very flexible, where the phrase memory can be either fully dynamically generated by an SMT model or directly extracted from a bilingual dictionary, or any other bilingual resources storing idiomatic translations or bilin- M(cid:88) gual multi-word expressions, which may lead to a further improvement. 2 Reading Phrase Memory When phrases are read from the memory, they are rescored by a neu- ral network based score function. The score func- tion takes as input the phrase itself and decoding information from NMT (i = t(pl) denotes the cur- rent decoding step): (cid:0)e(pl), si, yi−1, ci (cid:1) scorephrase(pl) = gs (11) where gs(·) is either an identity or a non-linear function. e(pl) is the representation of phrase pl, which is modeled by a recurrent neural networks. Again, si is the decoder state, yi−1 is the lastly generated word, and ci is the context vector. The scores are normalized for all phrases in the phrase memory, and the probability for phrase pl is calcu- lated as Pphrase(pl) = sof tmax(scorephrase(pl)) (12) The probability calculation is controlled with pa- rameters, which are trained together with the pa- rameters from the NMT model. 3.3 Training Formally, we train both the default parameters of standard NMT and the new parameters associated with phrase generation on a set of training exam- ples {[xn, yn]}N n=1: C(θ) = log P (ynxn) (13) n=1 where P (ynxn) is defined in Equation 7. Ideally, the trained model is expected to produce a higher balance weight λ and phrase probability Pphrase when a phrase is selected from the memory, and lower scores in other cases. 3.4 Decoding During testing, the NMT decoder generates a tar- get sentence which consists of a mixture of words and phrases. Due to the different granularities of words and phrases, we design a variant of beam search strategy: At decoding step i, we first com- pute Pphrase for all phrases in the phrase memory 2Bilingual resources can be utilized in two ways: First, we can store the bilingual resources in a static memory and keep all items available to NMT in the whole decoding pe- riod. Second, we can integrate the bilingual resources into SMT and then dynamically feed them into the phrase mem- ory. N(cid:88) and Pword for all words in NMT vocabulary. Then the balancer outputs a balancing weight λi, which is used to scale the phrase and word probabilities : λi × Pphrase and (1 − λi) × Pword. Now outputs are normalized probabilities on the concatenation of phrase memory and the general NMT vocabu- lary. At last, the NMT decoder generates a proper phrase or word of the highest probability. If a target phrase in the phrase memory has the highest probability, the decoder generates the tar- get phrase to complete the multi-word phrase gen- eration process, and updates its decoding state by consuming the words in the selected phrase as de- scribed in Equation 3. All translation hypotheses are placed in the corresponding beams according to the number of generated target words. 4 Experiments In this section, we evaluated the effectiveness of our model on the Chinese→English machine translation task. The training corpora consisted of about 1.25 million sentence pairs3 with 27.9 million Chinese words and 34.5 million English words respectively. We used NIST 2006 (NIST06) dataset as development set, and NIST 2004 (NIST04), 2005 (NIST05) and 2008 (NIST08) datasets as test sets. We report experiment results with case-insensitive BLEU score4. We compared our proposed model with two state-of-the-art systems: * Moses: a state-of-the-art phrase-based SMT system (Koehn et al., 2007) with its default settings, where feature function weights are tuned by the minimum error rate training (MERT) algorithm (Och, 2003). * RNNSearch: an in-house implementation of the attention-based NMT system (Bahdanau et al., 2015) with its default settings. For Moses, we used the full bilingual train- ing data to train the phrase-based SMT model and the target portion of the bilingual training data to train a 4-gram language model using KenLM5. We ran Giza++ on the training data in both Chinese-to-English and English-to-Chinese 3The corpus includes LDC2002E18, LDC2003E07, Hansards LDC2004T07, portion LDC2003E14, LDC2004T08 and LDC2005T06. of 4ftp://jaguar.ncsl.nist.gov/mt/resources/mteval-v11b.pl 5https://kheafield.com/code/kenlm/ directions and applied the "grow-diag-final" re- finement rule (Koehn et al., 2003) to obtain word alignments. The maximum phrase length is set to 7. For RNNSearch, we generally followed settings in the previous work (Bahdanau et al., 2015; Tu et al., 2017a,b). We only kept a shortlist of the most frequent 30,000 words in Chinese and En- glish, covering approximately 97.7% and 99.3% of the data in the two languages respectively. We constrained our source and target sequences to have a maximum length of 50 words in the train- ing data. The size of embedding layer of both sides was set to 620 and the size of hidden layer was set to 1000. We used a minibatch stochastic gradient descent (SGD) algorithm of size 80 together with Adadelta (Zeiler, 2012) to train the NMT mod- els. The decay rates ρ and  were set as 0.95 and 10−6. We clipped the gradient norm to 1.0 (Pas- canu et al., 2013). We also adopted the dropout technique. Dropout was applied only on the out- put layer and the dropout rate was set to 0.5. We used a simple beam search decoder with beam size 10 to find the most likely translation. For the proposed model, we used a Chinese chunker6 (Zhu et al., 2015) to chunk the source- side Chinese sentences. 13 chunking tags ap- peared in our chunked sentences and the size of chunking tag embedding was set to 10. We used the trained phrase-based SMT to translate the source-side chunks. The top 5 translations accord- ing to their translation scores (Equation 10) were kept and among them multi-word phrases were used as phrasal recommendations for each source chunk phrase. For a source-side chunk phrase, if there exists phrasal recommendations from SMT, the output chunk tag was used as its chunking tag feature as described in Section 3.1. Otherwise, the words in the chunk were treated as general words by being tagged with the default tag. In the phrase memory, we only keep the top 7 target translations with highest SMT scores at each decoding step. We used a forward neural network with two hid- den layers for both the balancer (Equation 8) and the scoring function (Equation 11). The numbers of units in the hidden layers were set to 2000 and 500 respectively. We used a backward RNN en- coder to learn the phrase representations of target phrases in the phrase memory. 6http://www.niuparser.com/ SYSTEM Moses RNNSearch +memory +memory +chunking tag NIST04 NIST05 NIST08 Avg 34.74 30.14 37.80 32.48 32.95 38.21 38.83‡ 33.55 23.69 24.93 25.48† 26.09‡ 31.99 34.70 35.15 35.72‡ Table 1: Main experiment results on the NIST Chinese-English translation task. BLEU scores in the table are case insensitive. Moses and RNNSearch are SMT and NMT baseline system respectively. "†": significantly better than RNNSearch (p < 0.05); "‡": significantly better than RNNSearch (p < 0.01). +memory +chunking tag NIST04 NIST05 NIST08 34.3% 22.2% 58.4% 66.4% 29.4% 63.1% Table 2: Percentages of sentences that contain phrases generated by the proposed model. 4.1 Main Results Table 1 reports main results of different models measured in terms of BLEU score. We observe that our implementation of RNNSearch outper- forms Moses by 2.34 BLEU points. (+memory) which is the proposed model with the phrase mem- ory obtains an improvement of 0.47 BLEU points over the baseline RNNSearch. With the source- side chunking tag feature, (+memory+chunking tag) outperforms the baseline RNNSearch by 1.07 BLEU points, showing the effectiveness of chunk- ing syntactic categories on the selection of ap- propriate target phrases. From here on, we use "+memory+chunking tag" as the default setting in the following experiments if not otherwise stated. Number of Sentences Affected by Generated Phrases We also check the number of transla- tions that contain phrases generated by the pro- posed model, as shown in Table 2. As seen, a large portion of translations take the recom- mended phrases, and the number increases when the chunking tag feature is used.7 Considering BLEU scores reported in Table 1, we believe that the chunking tag feature benefits the proposed model on its phrase generation. 4.2 Analysis on Generated Phrases Syntactic Categories of Generated Phrases We first investigate which category of phrases is more likely to be selected by the proposed 7The numbers on NIST08 are relatively lower since part of the test set contains sentences from Web forums, which contain less multi-word expressions. Type NP VP QP Others Sum All New Total Correct Total Correct 81.0% 38.7% 46.0% 11.5% 0.8% 8.0% 0.9% 10.8% 0.2% 0% 100% 44.5% 58.9% 13.2% 1.7% 6.5% 4.1% 6.2% 0% 0.2% Table 3: Percentages of phrase categories to the total number of generated ones. "All" denotes all generated phrases, and "New" means new phrases that cannot be found in translations generated by the baseline system. "Total" is the total number of generated phrases and "Correct" denotes the fully correct ones. There are some phrases, such as approach. noun phrases (NPs, e.g., "national laboratory" and "vietnam airlines") and quantifier phrases (QPs, e.g., "15 seconds" and "two weeks") , that we expect to be favored by our approach. Statistics shown in Table 3 confirm our hypothesis. Let's first concern all generated phrases (i.e., column "All"): most selected phrases are noun phrases (81.0%) and quantifier phrases (10.8%). Among them, 44.5% percent of them are fully correct8. Specifically, NPs have relative higher generation accuracy (i.e., 47.8% = 38.7%/81.0%) while VPs have lower accuracy (i.e., 21.2% = 1.7%/8.0%). By looking into the wrong cases, we found most errors are related to verb tense, which is the draw- back of SMT models. Concerning the newly introduced phrases that cannot be found in baseline translations (i.e., col- umn "New"), 13.2% of generated phrases are both new and fully correct, which contribute most to the performance improvement. We can also find that most newly introduced verb phrases and quantifier phrases are not correct, the patterns of which can 8Fully correct means that the generated phrases can be retrieved in corresponding references as a whole unit. be well learned by word-based NMT models. Words 2 3 4 (cid:62)5 All New Total Correct 66.2% 33.6% 34.9% 8.4% 13.4% 20.7% 1.9% 5.4% 7.4% 5.7% 0.6% 5.2% Total Correct 9.1% 3.2% 0.6% 0.3% Table 4: Percentages of phrases with different word counts to the total number of generated ones. Number of Words in Generated Phrases Ta- ble 4 lists the distribution of generated phrases based on the number of inside words. As seen, most generated phrases are short phrases (e.g., 2- gram and 3-gram phrases), which also contribute most to the new and fully correct phrases (i.e., 12.3% = 9.1%+3.2%). Focusing on long phrases (e.g., order(cid:62) 4), most of them are newly intro- duced (10.6% out of 13.1%). Unfortunately, only a few portion of these phrases are fully correct, since long phrases have higher chance to contain one or two unmatched words. SYSTEM Test 32.95 +memory 31.63 +memory +NULL +memory +chunking tag 33.55 +memory +chunking tag +NULL 30.81 Table 5: Additional experiment results on the translation task to directly measure the im- provement obtained by the phrase generation. "+NULL" denotes that we replace the generated target phrases with a special symbol "NULL" in test sets. BLEU scores in the table are case in- sensitive. Effect of Generated Phrases on Translation Performance Note that the proposed model benefits not only from fully matched phrases, but also from partially matched phrases. For example, the baseline system translates " 8  B ɐ  ɛ" in a word-by-word manner and outputs "state aviation and space department". The gener- ated phrase provided by SMT is "national aviation and space administration", but the only correct ref- erence is "national aeronautics and space adminis- tration". The generated phrase is not fully correct but still useful. To directly measure the improvement obtained by the phrase generation, we replace the generated target phrases with a special symbol "NULL" in test sets. As shown in Table 5, when deleting the generated target phrases, ("+memory+chunking tag") and ("+memory") translation performances decrease by 2.74 BLEU points and 1.32 BLEU points respectively. Moreover, translation perfor- mances on NIST08 decrease less than those on NIST04 and NIST05 in both settings. The rea- son is that NIST08 which contains sentences from web data has little influence on generating target phrases which are provided from a different do- main 9. The overall results demonstrate that neu- ral machine translation benefits from phrase trans- lation. 4.3 Effect of Balancer Weight Dynamic Constant (λ = 0.1) Test 33.55 31.35 Table 6: Translation performance with a variety of balancing weight strategies. "Dynamic" is the pro- posed approach and "Constant (λ = 0.1)" denotes fixing the balancing weight to 0.1. BLEU scores in the table are case insensitive. The balancer which is used to coordinate the phrase generation and word generation is very cru- cial for the proposed model. We conducted an ad- ditional experiment to validate the effectiveness of the neural network based balancer. We use the set- ting "+memory +chunking tag" as baseline system to conduct the experiments. In this experiment, we fixed the balancing weight λ (Equation 8) to 0.1 during training and testing and report the re- sults. As shown in Table 6, we find that using the fixed value for the balancing weight (Constant (λ = 0.1) ) decreases the translation performance sharply. This demonstrates that the neural network based balancer is an essential component for the proposed model. 4.4 Comparison to Word-Level Recommendations and Discussions Our approach is related to our previous work (Wang et al., 2017) which integrates the SMT word-level knowledge into NMT. To make a com- parison, we conducted experiments followed set- 9The parallel training data are mainly from news domain. SYSTEM +word level recommendation +memory +chunking tag Test 33.27 33.55 Table 7: Experiment results on the translation task. "+word level recommendation" is the proposed model in (Wang et al., 2017). BLEU scores in the table are case insensitive. tings in (Wang et al., 2017). The comparison re- sults are reported in Table 7. We find that our approach is marginally better than the word-level model proposed in (Wang et al., 2017) by 0.28 BLEU points. In our approach, the SMT model translates source-side chunk phrases using the NMT decod- ing information. Although we use high-quality target phrases as phrasal recommendations, our approach still suffers from the errors in segmenta- tion and chunking. For example, the target phrase "laptop computers" cannot be recommended by the SMT model if the Chinese phrase "ɰ ? ᵯ ᾯ" is not chunked as a phrase unit. This is the rea- son why some sentences do not have correspond- ing phrasal recommendations (Table 2). There- fore, our approach can be further enhanced if we can reduce the error propagations from the seg- menter or chunker, for example, by using n-best chunk sequences instead of the single best chunk sequence. Additionally, we also observe that some target phrasal recommendations have been also gener- ated by the baseline system in a word-by-word manner. These phrases, even taken as parts of fi- nal translations by the proposed model, do not lead to improvements in terms of BLEU as they have already occurred in translations from the baseline system. For example, the proposed model suc- cessfully carries out the phrase generation mode to generate a target phrase "guangdong province" (the translation of Chinese phrase "  ḕ") which has appeared in the baseline system. As external resources, e.g., bilingual dictionary, which are complementary to the SMT phrasal rec- ommendations, are compatible with the proposed model, we believe that the proposed model will get further improvement by using external resources. 5 Related work Our work is related to the following research top- ics on NMT: Generating phrases for NMT In these stud- ies, the generated NMT multi-word phrases are either from an SMT model or a bilingual dictio- nary. In syntactically guided neural machine trans- lation (SGNMT), the NMT decoder uses phrase translations produced by the hierarchical phrase- based SMT system Hiero, as hard decoding con- straints. In this way, syntactic phrases are gener- ated by the NMT decoder (Stahlberg et al., 2016b). Zhang and Zong (2016) use an SMT translation system, which is integrated an additional bilin- gual dictionary, to synthesize pseudo-parallel sen- tences and feed the sentences into the training of NMT in order to translate low-frequency words or phrases. Tang et al. (2016) propose an external phrase memory that stores phrase pairs in sym- bolic forms for NMT. During decoding, the NMT decoder enquires the phrase memory and properly generates phrase translations. The significant dif- ferences between these efforts and ours are 1) that we dynamically generate phrase translations via an SMT model, and 2) that at the same time we modify the encoder to incorporate structural infor- mation to enhance the capability of NMT in phrase translation. Incorporating linguistic information into NMT NMT is essentially a sequence to sequence map- ping network that treats the input/output units, eg., words, subwords (Sennrich et al., 2016), charac- ters (Chung et al., 2016; Costa-juss`a and Fonol- losa, 2016), as non-linguistic symbols. However, linguistic information can be viewed as the task- specific knowledge, which may be a useful sup- plementary to the sequence to sequence mapping network. To this end, various kinds of linguis- tic annotations have been introduced into NMT to improve its translation performance. Sennrich and Haddow (2016) enrich the input units of NMT with various linguistic features, including lem- mas, part-of-speech tags, syntactic dependency la- bels and morphological features. Garc´ıa-Mart´ınez et al. (2016) propose factored NMT using the mor- phological and grammatical decomposition of the words (factors) in output units. Eriguchi et al. (2016) explore the phrase structures of input sen- tences and propose a tree-to-sequence attention model for the vanilla NMT model. Li et al. (2017) propose to linearize source-side parse trees to obtain structural label sequences and explicitly incorporated the structural sequences into NMT, while Aharoni and Goldberg (2017) propose to incorporate target-side syntactic information into NMT by serializing the target sequences into lin- earized, lexicalized constituency trees. Zhang et al. (2016) integrate topic knowledge into NMT for domain/topic adaptation. Combining NMT and SMT A variety of ap- proaches have been explored for leveraging the advantages of both NMT and conventional SMT. He et al. (2016) integrate SMT features with the NMT model under the log-linear framework in or- der to help NMT alleviate the limited vocabulary problem (Luong et al., 2015; Jean et al., 2015) and coverage problem (Tu et al., 2016). Arthur et al. (2016) observe that NMT is prone to mak- ing mistakes in translating low-frequency content words and therefore attempt at incorporating dis- crete translation lexicons into the NMT model, to alliterate the imprecise translation problem (Wang et al., 2017). Motivated by the complementary strengths of syntactical SMT and NMT, differ- ent combination schemes of Hiero and NMT have been exploited to form SGNMT (Stahlberg et al., 2016a,b). Wang et al. (2017) propose an approach to incorporate the SMT model into attention-based NMT. They combine NMT posteriors with SMT word recommendations through linear interpola- tion implemented by a gating function which dy- namically assigns the weights. Niehues et al. (2016) propose to use SMT to pre-translate the in- puts into target translations and employ the target pre-translations as input sequences in NMT. Zhou et al. (2017) propose a neural system combination framework to directly combine NMT and SMT outputs. The combination of NMT and SMT has been also introduced in interactive machine trans- lation to improve the system's suggestion quality (Wuebker et al., 2016). In addition, word align- ments from the traditional SMT pipeline are also used to improve the attention mechanism in NMT (Cohn et al., 2016; Mi et al., 2016; Liu et al., 2016). 6 Conclusion In this paper, we have presented a novel model to translate source phrases and generate target phrase translations in NMT by integrating the phrase memory into the encoder-decoder architecture. At decoding, the SMT model dynamically generates relevant target phrases with contextual informa- tion provided by the NMT model and writes them to the phrase memory. Then the proposed model reads the phrase memory and uses the balancer to make probability estimations for the phrases in the phrase memory. Finally the NMT decoder selects a phrase from the phrase memory or a word from the vocabulary of the highest probability to gen- erate. Experiment results on Chinese→English translation have demonstrated that the proposed model can significantly improve the translation performance. Acknowledgments We would like to thank three anonymous review- ers for their insightful comments, and also ac- knowledge Zhengdong Lu, Lili Mou for useful discussions. This work was supported by the National Natural Science Foundation of China (Grants No.61525205, 61373095 and 61622209). References Roee Aharoni and Yoav Goldberg. 2017. Towards arXiv string-to-tree neural machine translation. preprint arXiv:1704.04743. Philip Arthur, Graham Neubig, and Satoshi Nakamura. 2016. Incorporating discrete translation lexicons into neural machine translation. In Proceedings of the 2016 Conference on EMNLP. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly learning to align and translate. In ICLR. Peter F Brown, Vincent J Della Pietra, Stephen A Della Pietra, and Robert L Mercer. 1993. The mathemat- ics of statistical machine translation: Parameter esti- mation. Computational linguistics. David Chiang. 2005. A hierarchical phrase-based In Pro- model for statistical machine translation. ceedings of the 43rd ACL. Kyunghyun Cho. 2015. Natural language understand- ing with distributed representation. arXiv preprint. Kyunghyun Cho, Bart van Merrienboer, Caglar Gul- cehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rnn encoder–decoder In Proceedings for statistical machine translation. of the 2014 Conference on EMNLP. Junyoung Chung, Kyunghyun Cho, and Yoshua Ben- gio. 2016. A character-level decoder without ex- plicit segmentation for neural machine translation. In Proceedings of the 54th ACL, pages 1693–1703, Berlin, Germany. Trevor Cohn, Cong Duy Vu Hoang, Ekaterina Vy- molova, Kaisheng Yao, Chris Dyer, and Gholamreza Haffari. 2016. Incorporating structural alignment bi- ases into an attentional neural translation model. In Proceedings of NAACL 2016, San Diego, California. Marta R. Costa-juss`a and Jos´e A. R. Fonollosa. 2016. Character-based neural machine translation. In Pro- ceedings of the 54th ACL, pages 357–361, Berlin, Germany. Akiko Eriguchi, Kazuma Hashimoto, and Yoshimasa Tsuruoka. 2016. Tree-to-sequence attentional neu- ral machine translation. In Proceedings of the 54th ACL, pages 823–833, Berlin, Germany. Mercedes Garc´ıa-Mart´ınez, Loıc Barrault, and Fethi Bougares. 2016. Factored neural machine transla- tion. arXiv preprint arXiv:1609.04621. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O.K. Incorporating copying mechanism in In Proceedings of Li. 2016. sequence-to-sequence learning. the 54th ACL, Berlin, Germany. Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. 2016. Pointing the unknown words. In Proceedings of ACL 2016, Berlin, Germany. Wei He, Zhongjun He, Hua Wu, and Haifeng Wang. 2016. Improved neural machine translation with smt features. In Proceedings of the 30th AAAI Confer- ence on Artificial Intelligence. S´ebastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. 2015. On using very large tar- get vocabulary for neural machine translation. In Proceedings of the 53rd ACL and the 7th IJCNLP. Nal Kalchbrenner and Phil Blunsom. 2013. Recurrent In Proceedings of continuous translation models. the 2013 Conference on EMNLP. Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. 2007. Moses: Open source toolkit for statistical machine translation. In Proceedings of the 45th ACL Companion Volume Proceedings of the Demo and Poster Sessions, pages 177–180, Prague, Czech Republic. Philipp Koehn, Franz Josef Och, and Daniel Marcu. 2003. Statistical phrase-based translation. In Pro- ceedings of the 2003 NAACL. Minh-Thang Luong and Christopher D. Manning. 2016. Achieving open vocabulary neural machine translation with hybrid word-character models. In Proceedings of the 54th ACL. Thang Luong, Ilya Sutskever, Quoc Le, Oriol Vinyals, and Wojciech Zaremba. 2015. Addressing the rare word problem in neural machine translation. In Pro- ceedings of the 53rd ACL and the 7th IJCNLP. Haitao Mi, Zhiguo Wang, and Abe Ittycheriah. 2016. Supervised attentions for neural machine translation. In Proceedings of EMNLP 2016, pages 2283–2288, Austin, Texas. Jan Niehues, Eunah Cho, Thanh-Le Ha, and Alex Waibel. 2016. Pre-translation for neural machine translation. In Proceedings of COLING 2016, Os- aka, Japan. Franz Josef Och. 2003. Minimum error rate training in statistical machine translation. In Proceedings of the 41st ACL. Razvan Pascanu, Tomas Mikolov, and Yoshua Ben- gio. 2013. On the difficulty of training recurrent neural networks. In Proceedings of the 30th Inter- national Conference on Machine Learning, ICML 2013, pages 1310C–1318. Ivan A Sag, Timothy Baldwin, Francis Bond, Ann Copestake, and Dan Flickinger. 2002. Multiword expressions: A pain in the neck for nlp. In Interna- tional Conference on Intelligent Text Processing and Computational Linguistics, pages 1–15. Springer. Rico Sennrich and Barry Haddow. 2016. Linguistic input features improve neural machine translation. In Proceedings of the First Conference on Machine Translation, pages 83–91, Berlin, Germany. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with In Proceedings of the 54th ACL, subword units. pages 1715–1725, Berlin, Germany. Felix Stahlberg, Adri`a de Gispert, Eva Hasler, and Bill Byrne. 2016a. Neural machine transla- tion by minimising the bayes-risk with respect arXiv preprint to syntactic translation lattices. arXiv:1612.03791. Felix Stahlberg, Eva Hasler, Aurelien Waite, and Bill Byrne. 2016b. Syntactically guided neural machine translation. In Proceedings of the 54th ACL (Volume 2: Short Papers), Berlin, Germany. Junhui Li, Deyi Xiong, Zhaopeng Tu, Muhua Zhu, Min Zhang, and Guodong Zhou. 2017. Modeling source syntax for neural machine translation. arXiv preprint arXiv:1705.01020. Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural net- works. In Advances in Neural Information Process- ing Systems 27. Lemao Liu, Masao Utiyama, Andrew Finch, and Ei- ichiro Sumita. 2016. Neural machine translation with supervised attention. In Proceedings of COL- ING 2016, pages 3093–3102, Osaka, Japan. Yaohua Tang, Fandong Meng, Zhengdong Lu, Hang Li, and Philip LH Yu. 2016. Neural machine transla- tion with external phrase memory. arXiv preprint arXiv:1606.01792. Zhaopeng Tu, Yang Liu, Zhengdong Lu, Xiaohua Liu, and Hang Li. 2017a. Context gates for neural ma- chine translation. Transactions of the Association of Computational Linguistics. Zhaopeng Tu, Yang Liu, Lifeng Shang, Xiaohua Liu, and Hang Li. 2017b. Neural machine translation In Proceedings of the 31th with reconstruction. AAAI Conference on Artificial Intelligence. Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. 2016. Modeling coverage for neu- ral machine translation. In Proceedings of the 54th ACL. Aline Villavicencio, Francis Bond, Anna Korhonen, and Diana McCarthy. 2005. Introduction to the special issue on multiword expressions: Having a crack at a hard nut. Computer Speech & Language, 19(4):365–377. Xing Wang, Zhengdong Lu, Zhaopeng Tu, Hang Li, Deyi Xiong, and Min Zhang. 2017. Neural machine translation advised by statistical machine transla- tion. In Proceedings of the 31th AAAI Conference on Artificial Intelligence. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google's neural ma- chine translation system: Bridging the gap between arXiv preprint human and machine translation. arXiv:1609.08144. Joern Wuebker, Spence Green, John DeNero, Sasa Hasan, and Minh-Thang Luong. 2016. Models and inference for prefix-constrained machine trans- lation. In Proceedings of the 54th ACL, pages 66– 75, Berlin, Germany. Nianwen Xue and Libin Shen. 2003. Chinese word segmentation as lmr tagging. In Proceedings of the Second SIGHAN Workshop on Chinese Language Processing, pages 176–179, Sapporo, Japan. Matthew D Zeiler. 2012. Adadelta: an adaptive learn- ing rate method. arXiv preprint arXiv:1212.5701. Jiajun Zhang and Chengqing Zong. 2016. Bridging neural machine translation and bilingual dictionar- ies. arXiv preprint arXiv:1610.07272. Jian Zhang, Liangyou Li, Andy Way, and Qun Liu. 2016. Topic-informed neural machine translation. In Proceedings of COLING 2016, pages 1807–1817, Osaka, Japan. Long Zhou, Wenpeng Hu, and Chengqing Zong. 2017. Neural system combi- arXiv preprint nation for machine translation. arXiv:1704.06393. Jiajun Zhang, Jingbo Zhu, Muhua Zhu, Qiang Wang, and Tong Xiao. 2015. Niuparser: A chinese syntactic and seman- tic parsing toolkit. In Proceedings of ACL-IJCNLP 2015 System Demonstrations, Beijing, China.
1810.00438
2
1810
2019-12-06T05:01:36
Parameter-free Sentence Embedding via Orthogonal Basis
[ "cs.CL" ]
We propose a simple and robust non-parameterized approach for building sentence representations. Inspired by the Gram-Schmidt Process in geometric theory, we build an orthogonal basis of the subspace spanned by a word and its surrounding context in a sentence. We model the semantic meaning of a word in a sentence based on two aspects. One is its relatedness to the word vector subspace already spanned by its contextual words. The other is the word's novel semantic meaning which shall be introduced as a new basis vector perpendicular to this existing subspace. Following this motivation, we develop an innovative method based on orthogonal basis to combine pre-trained word embeddings into sentence representations. This approach requires zero parameters, along with efficient inference performance. We evaluate our approach on 11 downstream NLP tasks. Our model shows superior performance compared with non-parameterized alternatives and it is competitive to other approaches relying on either large amounts of labelled data or prolonged training time.
cs.CL
cs
Parameter-free Sentence Embedding via Orthogonal Basis Ziyi Yang1∗, Chenguang Zhu2, and Weizhu Chen3 1Department of Mechanical Engineering, Stanford university 2Microsoft Speech and Dialogue Research Group [email protected], {chezhu, wzchen}@microsoft.com 3Microsoft Dynamics 365 AI 9 1 0 2 c e D 6 ] L C . s c [ 2 v 8 3 4 0 0 . 0 1 8 1 : v i X r a Abstract We propose a simple and robust non- parameterized approach for building sentence representations. Inspired by the Gram- Schmidt Process in geometric theory, we build an orthogonal basis of the subspace spanned by a word and its surrounding context in a sentence. We model the semantic meaning of a word in a sentence based on two aspects. One is its relatedness to the word vector sub- space already spanned by its contextual words. The other is the word's novel semantic mean- ing which shall be introduced as a new ba- sis vector perpendicular to this existing sub- space. Following this motivation, we develop an innovative method based on orthogonal ba- sis to combine pre-trained word embeddings into sentence representations. This approach requires zero parameters, along with efficient inference performance. We evaluate our ap- proach on 11 downstream NLP tasks. Our model shows superior performance compared with non-parameterized alternatives and it is competitive to other approaches relying on ei- ther large amounts of labelled data or pro- longed training time. 1 Introduction The concept of word embeddings has been preva- lent in NLP community in recent years, as they can characterize semantic similarity between any pair of words, achieving promising results in a large number of NLP tasks (Mikolov et al., 2013; Pen- nington et al., 2014; Salle et al., 2016). However, due to the hierarchical nature of human language, it is not sufficient to comprehend text solely based on isolated understanding of each word. This has prompted a recent rise in search for semantically ∗ Most of the work was done during internship at Mi- Published as a conference paper at EMNLP 2019 (oral crosoft presentation) robust embeddings for longer pieces of text, such as sentences and paragraphs. Based on learning paradigms, the existing ap- proaches to sentence embeddings can be catego- rized into two categories: i) parameterized meth- ods and ii) non-parameterized methods. Parameterized sentence embeddings. These models are parameterized and require training to optimize their parameters. SkipThought (Kiros et al., 2015) is an encoder-decoder model that pre- dicts adjacent sentences. Pagliardini et al. (2018) proposes an unsupervised model, Sent2Vec, to learn an n-gram feature in a sentence to predict the center word from the surrounding context. Quick thoughts (QT) (Logeswaran and Lee, 2018) re- places the encoder with a classifier to predict con- text sentences from candidate sequences. Khodak et al. (2018) proposes `a la carte to learn a linear mapping to reconstruct the center word from its context. Conneau et al. (2017) generates the sen- tence encoder InferSent using Natural Language Inference (NLI) dataset. Universal Sentence En- coder (Yang et al., 2018; Cer et al., 2018) uti- lizes the emerging transformer structure (Vaswani et al., 2017; Devlin et al., 2018) that has been proved powerful in various NLP tasks. The model is first trained on large scale of unsupervised data from Wikipedia and forums, and then trained on the Stanford Natural Language Inference (SNLI) dataset. Wieting and Gimpel (2017b) propose the gated recurrent averaging network (GRAN), which is trained on Paraphrase Database (PPDB) and English Wikipedia. Subramanian et al. (2018) leverages a multi-task learning framework to gen- erate sentence embeddings. Wieting et al. (2015a) learns the paraphrastic sentence representations as the simple average of updated word embeddings. embedding. Recent work (Arora et al., 2017) shows that, surprisingly, a weighted sum or transformation Non-parameterized sentence of word representations can outperform many sophisticated neural network structures in sen- tence embedding tasks. These methods are parameter-free and require no further training upon pre-trained word vectors. Arora et al. (2017) constructs a sentence embedding called SIF as a sum of pre-trained word embeddings, weighted by reverse document frequency. Ethayarajh (2018) builds upon the random walk model proposed in SIF by setting the probability of word generation inversely related to the angular distance between the word and sentence embeddings. Ruckl´e et al. (2018) concatenates different power mean word embeddings as a sentence vector in p-mean. As these methods do not have a parameterized model, they can be easily adapted to novel text domains with both fast inference speed and high-quality sentence embeddings. In view of this trend, our work aims to further advance the frontier of this group and make its new state-of-the-art. In this paper, we propose a novel sen- tence embedding algorithm, Geometric Embed- ding (GEM), based entirely on the geometric structure of word embedding space. Given a d- dim word embedding matrix A ∈ Rd×n for a sen- tence with n words, any linear combination of the sentence's word embeddings lies in the subspace spanned by the n word vectors. We analyze the geometric structure of this subspace in Rd. When we consider the words in a sentence one-by-one in order, each word may bring in a novel orthog- onal basis to the existing subspace. This new ba- sis can be considered as the new semantic mean- ing brought in by this word, while the length of projection in this direction can indicate the inten- sity of this new meaning. It follows that a word with a strong intensity should have a larger influ- ence in the sentence's meaning. Thus, these in- tensities can be converted into weights to linearly combine all word embeddings to obtain the sen- tence embedding. In this paper, we theoretically frame the above approach in a QR factorization of the word embedding matrix A. Furthermore, since the meaning and importance of a word largely de- pends on its close neighborhood, we propose the sliding-window QR factorization method to cap- ture the context of a word and characterize its sig- nificance within the context. In the last step, we adapt a similar approach as Arora et al. (2017) to remove top principal vec- tors before generating the final sentence embed- ding. This step is to ensure commonly shared background components, e.g. stop words, do not bias sentence similarity comparison. As we build a new orthogonal basis for each sentence, we pro- pose to have disparate background components for each sentence. This motivates us to put for- ward a sentence-specific principal vector removal method, leading to better empirical results. We evaluate our algorithm on 11 NLP tasks. Our algorithm outperforms all non-parameterized methods and many parameterized approaches in 10 tasks. Compared to SIF (Arora et al., 2017), the performance is boosted by 5.5% on STS bench- mark dataset, and by 2.5% on SST dataset. Plus, the running time of our model compares favorably with existing models. The rest of this paper is organized as following. In Section 2, we describe our sentence embedding algorithm GEM. We evaluate our model on vari- ous tasks in Section 3 and Section 4. Finally, we summarize our work in Section 5. Our implemen- tation is available online1. 2 Approach We introduce three scores to quantify the impor- tance of a word, as will be explained in this sec- tion. First, novelty score αn measures the por- tion of the new semantic meaning in a word. Sec- ond, significance score αs describes the align- ment between the new semantic meaning and the sentence-level meaning. Finally, uniqueness score αu examines the uniqueness of the new se- mantic meaning in the corpus level. 2.1 Quantify New Semantic Meaning Let us consider the idea of word embeddings (Mikolov et al., 2013), where a word wi is pro- jected as a vector vwi ∈ Rd. Any sequence of words can be viewed as a subspace in Rd spanned by its word vectors. Before the appearance of the ith word, S is a subspace in Rd spanned by {vw1, vw2, ..., vwi−1}. Its orthonormal basis is {q1, q2, ..., qi−1}. The embedding vwi of the ith 1https://github.com/ziyi-yang/GEM word wi can be decomposed into vwi = rjqj + riqi i−1(cid:88) ri = (cid:107)vwi − i−1(cid:88) j=1 rj = qT j vwi j=1 (1) rjqj(cid:107)2 where(cid:80)i−1 j=1 rjqj is the part in vwi that resides in subspace S, and qi is orthogonal to S and is to be added to S. The above algorithm is also known as Gram-Schmidt Process. In the case of rank deficiency, i.e., vwi is already a linear combination of {q1, q2, ...qi−1}, qi is a zero vector and ri = 0. In matrix form, this process is also known as QR factorization, defined as follows. QR factorization. Define an embedding matrix of n words as A = [A:,1, A:,2, ..., A:,n] ∈ Rd×n, where A:,i is the embedding of the ith word wi in a word sequence (w1, . . . , wi, . . . , wn). A ∈ Rd×n can be factorized into A = QR, where the non- zero columns in Q ∈ Rd×n are the orthonormal basis, and R ∈ Rn×n is an upper triangular ma- trix. The process above computes the novel semantic meaning of a word w.r.t all preceding words. As the meaning of a word influences and is influenced by its close neighbors, we now calculate the novel orthogonal basis vector qi of each word wi in its neighborhood, rather than only w.r.t the preceding words. word Definition 1 (Contextual Window Matrix) Given its m- neighborhood window inside sentence (wi−m, . . . , wi−1, wi, wi+1, . . . , wi+m) , define the contextual window matrix of word wi as: and wi, the a Si = [vwi−m...vwi−1, vwi+1...vwi+m, vwi] (2) Here we shuffle vwi to the end of Si to compute its novel semantic information compared with its context. Now the QR factorization of Si is Si = QiRi (3) Note that qi is the last column of Qi, which is also the new orthogonal basis vector to this contextual window matrix. Next, in order to generate the embedding for a sentence, we will assign a weight to each of its words. This weight should characterize how much new and important information a word brings to the sentence. The previous process yields the or- thogonal basis vector qi. We propose that qi repre- sents the novel semantic meaning brought by word wi. We will now discuss how to quantify i) the novelty of qi to other meanings in wi, ii) the sig- nificance of qi to its context, and iii) the corpus- wise uniqueness of qi w.r.t the whole corpus. 2.2 Novelty We propose that a word wi is more important to a sentence if its novel orthogonal basis vector qi is a large component in vwi, quantified by the pro- posed novelty score αn. Let r denote the last col- umn of Ri, and r−1 denote the last element of r, αn is defined as: αn = exp( (cid:107)qi(cid:107)2 (cid:107)vwi(cid:107)2 ) = exp( r−1(cid:107)r(cid:107)2 ) (4) Note that (cid:107)qi(cid:107)2 = r−1 and (cid:107)vwi(cid:107)2 = (cid:107)r(cid:107)2. One can show that αn is the exponential of the nor- malized distance between vwi and the subspace spanned by its context. 2.3 Significance The significance of a word is related to how se- mantically aligned it is to the meaning of its con- text. To identify principal directions, i.e. mean- ings, in the contextual window matrix Si, we em- ploy Singular Value Decomposition. Singular Value Decomposition. Given a ma- trix A ∈ Rd×n, there exists U ∈ Rd×n with orthogonal columns, diagonal matrix Σ = diag(σ1, ..., σn), σ1 ≥ σ2 ≥ ... ≥ σn ≥ 0, and orthogonal matrix V ∈ Rn×n, such that A = U ΣV T . The columns of U, {U:,j}n j=1, are an orthonor- mal basis of A's columns subspace and we pro- pose that they represent a set of semantic mean- ings from the context. Their corresponding singu- lar values {σj}n j=1, denoted by σ(A), represent the importance associated with {U:,j}n j=1. The SVD of wi's contextual window matrix is Si = U iΣiV iT ∈ Rd×(2m+1). It follows that qT i U i is :,j}2m+1 the coordinate of qi in the basis of {U i j=1 . Intuitively, a word is more important if its novel semantic meaning has a better alignment with more principal meanings in its contextual window. This can be quantified as (cid:107)σ(Si) (cid:12) (qT i U i)(cid:107)2, where (cid:12) denotes element-wise product. There- fore, we define the significance of wi in its context to be: αs = (cid:107)σ(Si) (cid:12) (qT 2m + 1 i U i)(cid:107)2 It turns out αs can be rewritten as αs = = (cid:107)qT i U iΣi(cid:107)2 2m + 1 (cid:107)qT i Si(cid:107)2 2m + 1 = (cid:107)qT i U iΣiV i(cid:107)2 2m + 1 = qT i vwi 2m + 1 = r−1 2m + 1 (5) (6) and we use the fact that V i is an orthogonal matrix and qi is orthogonal to all but the last col- umn of Si, vwi. Therefore, αs is essentially the distance between wi and the context hyper-plane, normalized by the context size. Although αs and αn look alike in mathemat- ics form, they model distinct quantities in word wi against its contextual window. αn is a func- tion of (cid:107)qi(cid:107)2 divided by (cid:107)wi(cid:107)2, i.e., the portion of the new semantic meaning in word wi. In con- trast, eq. (6) shows that αs equals (cid:107)qi(cid:107)2 divided by a constant, namely αs quantifies the absolute magnitude of the new semantic meaning qi. 2.4 Corpus-wise Uniqueness Similar to the idea of inverse document frequency (IDF) (Sparck Jones, 1972), a word that is com- monly present in the corpus is likely to be a stop word, thus its corpus-wise uniqueness is small. In our solution, we compute the principal directions of the corpus and then measure their alignment with the novel orthogonal basis vector qi. If there is a high alignment, wi will be assigned a rela- tively low corpus-wise uniqueness score, and vice versa. 2.4.1 Compute Principal Directions of Corpus In Arora et al. (2017), given a corpus contain- ing a set of N sentences, an embedding matrix X = [x1, x2, . . . , xN ] ∈ Rd×N is generated, where xi is the sentence embedding for the i-th sentence in the corpus, computed by SIF algo- rithm. Then principal vectors of X are computed and projections onto the principal vectors are re- moved from each sentence embedding xi. In contrast to Arora et al. (2017), we do not form the embedding matrix after we obtain the final sentence representation. Instead, we obtain an intermediate coarse-grained embedding matrix X c = [g1, . . . , gN ] as follows. Suppose the n(cid:88) SVD of the sentence matrix of the ith sentence is S = [vw1, . . . , vwn] = U ΣV T . Then the coarse- grained embedding for the ith sentence is defined as: gi = f (σj)U:,j (7) j=1 where f (σj) is a monotonically increasing func- tion. We then compute the top K principal vectors {d1, ..., dK} of X c, with singular values σ1 ≥ σ2 ≥ ... ≥ σK. 2.4.2 Uniqueness Score In contrast to Arora et al. (2017), we select differ- ent principal vectors of X c for each sentence, as different sentences may have disparate alignments with the corpus. For each sentence, {d1, ..., dK} are re-ranked in descending order of their corre- lation with sentence matrix S. The correlation is defined as: oi = σi(cid:107)ST di(cid:107)2, 1 ≤ i ≤ K (8) Next, the top h principal vectors after re- ranking based on oi are selected: D = {dt1, ..., dth}, with ot1 ≥ ot2 ≥ ... ≥ oth and their singular values in X c are σd = [σt1, ..., σth] ∈ Rh. Finally, a word wi with new semantic mean- ing vector qi in this sentence will be assigned a corpus-wise uniqueness score: αu = exp (−(cid:107)σd (cid:12) (qT i D)(cid:107)2/h) (9) This ensures that common stop words will have their effect diminished since their embeddings are closely aligned with the corpus' principal direc- tions. 2.5 Sentence Vector A sentence vector cs is computed as a weighted sum of its word embeddings, where the weights come from three scores: a novelty score (αn), a significance score (αs) and a corpus-wise unique- ness score (αu). (cid:88) αi = αn + αs + αu cs = αivwi (10) i We provide a theoretical explanation of Equa- tion (10) in Appendix. Sentence-Dependent Removal of Principal Components. Arora et al. (2017) shows that given a set of sentence vectors, removing projections onto the principal components of the spanned sub- space can significantly enhance the performance on semantic similarity task. However, as each sen- tence may have a different semantic meaning, it could be sub-optimal to remove the same set of principal components from all sentences. Non-parameterized models GEM + L.F.P (ours) GEM + LexVec (ours) SIF (Arora et al., 2017) uSIF (Ethayarajh, 2018) LexVec L.F.P word2vec skipgram Glove ELMo Parameterized models dev 83.5 81.9 80.1 84.2 58.78 62.4 70.0 52.4 64.6 test 78.4 76.5 72.0 79.5 50.43 52.0 56.5 40.6 55.9 Therefore, we propose the sentence-dependent principal component removal (SDR), where we re-rank top principal vectors based on correlation with each sentence. Using the method from Sec- tion 2.4.2, we obtain D = {dt1, ..., dtr} for a sen- tence s. The final embedding of this sentence is then computed as: cs ← cs − r(cid:88) (dT tj cs)dtj (11) j=1 show that experiments sentence- Ablation dependent principal component removal can achieve better result. The complete algorithm is summarized in Algorithm 1 with an illustration in Figure 1. Reddit + SNLI (Yang et al., 2018) GRAN (Wieting and Gimpel, 2017b) PARANMT-50M (Wieting and Gimpel, 2017a) InferSent (Conneau et al., 2017) Sent2Vec (Pagliardini et al., 2018) 79.9 78.2 76.4 75.8 75.5 73.2 Table 1: Pearson's r × 100 on STSB. Best results are in bold. Paragram-Phrase (Wieting et al., 2015a) - 81.4 81.8 80.1 78.7 73.9 GEM + L.F.P (ours) Reddit + SNLI tuned KeLP-contrastive1 SimBow-contrastive2 SimBow-primary 49.11 47.44 49.00 47.87 47.22 Table 2: MAP on CQA subtask B. 2.6 Handling of out-of-vocabulary Words In many NLP algorithms, the out-of-vocabulary (OOV) words are projected to a special "UNK" token. However, in this way, different OOV words with drastically different meanings will share the same embedding. To fix this problem, we change this projection method by mapping OOVs to pre- trained in-vocabulary words, based on a hash func- tion SHA-256 of its characters. In this way, two different OOV words will almost certainly have different embeddings. In the experiments, we ap- ply this OOV projection technique in both STS-B and CQA tasks. 3 Experiments 3.1 Semantic Similarity Tasks: STS Benchmark We evaluate our model on the STS Benchmark (Cer et al., 2017), a sentence-level semantic simi- larity dataset. The goal for a model is to predict a similarity score of two sentences given a sentence pair. The evaluation is by the Pearson's coefficient r between human-labeled similarity (0 - 5 points) and predictions. Experimental settings. We report two versions of our model, one only using GloVe word vectors (GEM + GloVe), and the other using word vec- tors concatenated from LexVec, fastText and PSL (Wieting et al., 2015b) (GEM + L.F.P). The final similarity score is computed as an inner product of normalized sentence vectors. Since our model is non-parameterized, it does not utilize any informa- tion from the dev set when evaluating on the test set and vice versa. Hyper-parameters are chosen at m = 7, h = 17, K = 45, and t = 3 by conducing hyper-parameters search on dev set. Results on the dev and test set are reported in Table 1. As shown, on the test set, our model has a 6.4% higher score compared with another non-parameterized model SIF, and 26.4% higher than the baseline of averag- ing L.F.P word vectors. It also outperforms all pa- rameterized models including GRAN, InferSent, Sent2Vec and Reddit+SNLI. 3.2 Semantic Similarity Tasks: CQA We evaluate our model on subtask B of the Se- mEval Community Question Answering (CQA) task, another semantic similarity dataset. Given an original question Qo and a set of the first ten re- lated questions (Q1, ..., Q10) retrieved by a search engine, the model is expected to re-rank the related Figure 1: An illustration of GEM algorithm. Top middle: The sentence to encode, with words w1 to wn. The contextual window of word wi is inside the dashed line. Bottom middle: Form contextual window matrix Si for wi, compute qi and novelty score αn (Section 2.1 and Section 2.2). Bottom left: SVD of Si and compute the significance score αs (Section 2.3). Bottom right: Re-rank and select from principal components (orange blocks) and compute uniqueness score αu (Section 2.4). Algorithm 1 Geometric Embedding (GEM) Inputs: Outputs: for ith sentence s in S do A set of sentences S, vocabulary V, word embeddings {vw ∈ Rd w ∈ V} Sentence embeddings {cs ∈ Rd s ∈ S} Form matrix S ∈ Rd×n, S:,j = vwj and wj is the jth word in s The SVD is S = U ΣV T The ith column of the coarse-grained sentence embedding matrix X c :,i is U (σ(S))3 end for Take first K singular vectors {d1, ..., dK} and singular values σ1 ≥ σ2 ≥ ... ≥ σK of X c for sentence s in S do Re-rank {d1, ..., dK} in descending order by oi = σi(cid:107)ST di(cid:107)2, 1 ≤ i ≤ K. Select top h principal vectors as D = [dt1, ..., dth], with singular values σd = [σt1...., σth]. for word wi in s do Si = [vwi−m, ..., vwi−1, vwi+1, ..., vwi+m, vwi] is the contextual window matrix of wi. Do QR decomposition Si = QiRi, let qi and r denote the last column of Qi and Ri αn = exp(r−1/(cid:107)r(cid:107)2), αs = r−1/(2m + 1), αu = exp (−(cid:107)σd (cid:12) (qT αi = αn + αs + αu i D)(cid:107)2/h) cs =(cid:80) end for end for Principal vectors removal: cs ← cs − DDT cs vi∈s αivwi questions according to their similarity with respect to the original question. Each retrieved question Qi is labelled "PerfectMatch", "Relevant" or "Ir- relevant", with respect to Qo. Mean average pre- cision (MAP) is used as the evaluation measure. We encode each question text into a unit vec- i=1 are ranked tor u. Retrieved questions {Qi}10 according to their cosine similarity with Qo. Re- sults are shown in Table 2. For comparison, we include results from the best models in 2017 com- petition: SimBow (Charlet and Damnati, 2017), KeLP (Filice et al., 2017), and Reddit + SNLI tuned. Note that all three benchmark models re- quire learning on CQA training set, and SimBow !"!"#$!"%$!&=0.1=0.2=0.3'&=[0.1./"0,0.2./"3,0.1./"4,…]327+1... +0.1-0.4=0.2'9=exp(0.1[0.2,−0.4,…,0.1]3)/"∈BC×(3$%0)E"∈BC×3$%0(/"=E"F"G"H)I"∈BC!0=0.5=0.6=-0.1'J=exp(−0.5.C0,0.6.C3,−0.1.C4,…3/ℎ)Re-rankSelect and KeLP leverage optional features including us- age of comments and user profiles. In comparison, our model only uses the question text without any training. Our model clearly outperforms Reddit + SNLI tuned, SimBow-primary and KeLP model. 3.3 Supervised tasks We further test our model on nine supervised tasks, including seven classification tasks: movie review (MR) (Pang and Lee, 2005), Stanford Sentiment Treebank (SST) (Socher et al., 2013), question-type classification (TREC) (Voorhees and Dang, 2003), opinion polarity (MPQA) (Wiebe et al., 2005), product reviews (CR) (Hu and Liu, 2004), subjectivity/objectivity classifica- tion (SUBJ) (Pang and Lee, 2004) and paraphrase identification (MRPC) (Dolan et al., 2004). We also evaluate on two entailment and semantic re- latedness tasks: SICK similarity (SICK-R) and the SICK entailment (SICK-E) (Marelli et al., 2014). The sentence embeddings generated are fixed and only the downstream task-specific neural structure is learned. For classification tasks, a linear classi- fier is trained on top, following Kiros et al. (2015), and classification accuracy are reported. For relat- edness tasks, we follow Tai et al. (2015) to train a logistic regression to learn the probability distribu- tion of relatedness scores, and we report Pearson's correlation. The four hyper-parameters are chosen the same as those in STS benchmark experiment. For fair comparison, embeddings models are di- vided into two categories: non-parameterized and parameterized ones, as described in section 1. Re- sults are shown in Table 3. GEM outperforms all other non-parameterized sentence embedding models, including SIF, p- mean (Ruckl´e et al., 2018), and BOW on GloVe. The consistent superior performance again demonstrates GEM's advantage on weight- ing scheme. It also compares favorably with most of parameterized models, including `a la carte (Khodak et al., 2018), FastSent (Hill et al., 2016), InferSent, QT, Sent2Vec, SkipThought-LN (with layer normalization) (Kiros et al., 2015), SDAE (Hill et al., 2016), STN (Subramanian et al., 2018) and USE (Yang et al., 2018). Note that sentence representations generated by GEM have much smaller dimension compared to most of bench- mark models, and the subsequent neural structure has fewer trainable parameters. This observation suggests that local multi-word level information in sentences has already provided revealing infor- mation for sophisticated downstream tasks. The fact that GEM does well on several classification tasks (e.g. TREC and SUBJ) indicates that the proposed weight scheme is able to recognize im- portant words sentences. Also, GEM's competi- tive performance on sentiment tasks shows that ex- ploiting the geometric structures of two sentence subspaces is semantically informative. 4 Discussion Comparison with Arora et al. (2017). We would like to point out that although sharing the idea of modelling the sentence as the weighted sum of its word vectors, GEM is substantially different from Arora et al. (2017). First, we adopt well- established numerical linear algebra to quantify the semantic meaning and importance of words in the sentences context. And this new approach proves to be effective. Second, the weights in SIF (and uSIF) are calculated from the statistic of vocabularies on very large corpus (wikipedia). In contrast, the weights in GEM are directly computed from the sentences themselves along with the dataset, independent with prior statisti- cal knowledge of language or vocabularies. Fur- thermore, the components in GEM's weights are derived from numerical linear algebra eq. (4) to (9), while SIF directly includes a hyper-parameter term in its weight scheme, i.e. its smooth term. Robustness and Effectiveness. Besides exper- iments mentioned above, we also test the robust- ness and effectiveness GEM on several simple but non-trivial examples. These experiments demon- strate that GEM is quite insensitive against the re- moval of non-important stop words. Also GEM can correctly assign higher weights for words with more significant semantic meanings in the sen- tence. We first test the robustness of GEM by remov- ing one non-important stop word in a sentence and computed the similarity between the original sen- tence and the one after removal. For example: • original sentence: "the first tropical system to slam the US this year is expected to make landfall as a hurricane" • remove 7 stop words: "first tropical system slam US this year expected make landfall hurricane" The cosine similarity between these two sentences given by GEM is 0.954. Even though aggressively Model Dim Training time (h) MR CR SUBJ MPQA SST TREC MRPC SICK-R SICK-E Non-parameterized models GEM + L.F.P (ours) GEM + GloVe (ours) SIF uSIF p-mean GloVe BOW Paraemterized models InferSent Sent2Vec SkipThought-LN FastSent `a la carte SDAE QT STN USE 900 300 300 300 3600 300 4096 700 4800 300 4800 2400 4800 4096 512 0 0 0 0 0 0 24 6.5 336 2 N/A 192 28 168 N/A 79.8 78.8 77.3 - 78.4 78.7 81.1 75.8 79.4 70.8 81.8 74.6 82.4 82.5 81.36 82.5 81.1 78.6 - 80.4 78.5 86.3 80.3 83.1 78.4 84.3 78.0 86.0 87.7 86.08 93.8 93.1 90.5 - 93.1 91.6 92.4 91.1 93.7 88.7 93.8 90.8 94.8 94.0 93.66 89.9 89.4 87.0 - 88.9 87.6 90.2 85.9 89.3 80.6 87.6 86.9 90.2 90.9 87.14 84.7 83.6 82.2 80.7 83.0 79.8 84.6 - 82.9 - 86.7 - 87.6 83.2 86.24 91.4 88.6 78.0 - 90.6 83.6 88.2 86.4 88.4 76.8 89.0 78.4 92.4 93.0 96.60 75.4/82.9 73.4/82.3 - - - 72.1/80.9 76.2/83.1 72.5/80.8 - 72.2/80.3 - 73.7/80.7 76.9/84.0 78.6/84.4 - 86.5 86.3 86.0 83.8 - 80.0 88.4 - 85.8 - - - 87.4 88.8 - 86.2 85.3 84.6 81.1 - 78.6 86.3 - 79.5 - - - - 87.8 - Table 3: Results on supervised tasks. Sentence embeddings are fixed for downstream supervised tasks. Best results for each task are underlined, best results from models in the same category are in bold. SIF results are extracted from Arora et al. (2017) and Ruckl´e et al. (2018), and training time is collected from Logeswaran and Lee (2018). removing 7 stop words, GEM still assigns pretty similar embeddings for these two sentences. We further demonstrate that GEM does assign higher weights to words with more significant se- mantic meanings. Consider the following sen- tence: "there are two ducks swimming in the river". Weights assigned by GEM are (sorted from high to low): [ducks: 4.93, river:4.72 , swimming: 4.70, two: 3.87, are: 3.54, there: 3.23, in:3.04, the:2.93]. GEM successfully assigns higher weight to informative words like ducks and river, and downplay stop words like the and there. More examples can be found in the Appendix. Ablation Study. As shown in in Table 4, ev- ery GEM weight (αn, αs, αu) and proposed prin- cipal components removal methods contribute to the performance. As listed on the left, adding GEM weights improves the score by 8.6% on STS dataset compared with averaging three con- catenated word vectors. The sentence-dependent principal component removal (SDR) proposed in GEM improves 1.7% compared to directly remov- ing the top h corpus principal components (SIR). Using GEM weights and SDR together yields an overall improvement of 21.1%. As shown on the right in Table 4, every weight contributes to the performance of our model. For example, three weights altogether improve the score in SUBJ task by 0.38% compared with only using αn. Sensitivity Study. We evaluate the effect of all four hyper-parameters in our model: the win- Configurations Mean of L.F.P GEM weights GEM weights + SIR GEM weights + SDR αn + SDR αn, αs + SDR αn, αs, αu + SDR STSB dev SUBJ 62.4 71.0 81.8 83.5 81.6 81.9 83.5 - - - - 93.42 93.6 93.8 Table 4: Comparison of different configurations demonstrates the effectiveness of our model on STSB dev set and SUBJ. SDR stands for sentence-dependent principal component removal in Section 2.4.2. SIR stands for sentence-independent principal component removal, i.e. directly removing top h corpus principal components from the sentence embedding. the power t in f (σj) = σt dow size m in the contextual window matrix, the number of candidate principal components K, the number of principal components to remove h, and the power of the singular value in coarse sentence embedding, i.e. j in Equation (7). We sweep the hyper-parameters and test on STSB dev set, SUBJ, and MPQA. Unspec- ified parameters are fixed at m = 7, K = 45, h = 17 and t = 3. As shown in Figure 2, our model is quite robust with respect to hyper- parameters. Inference speed. We also compare the infer- ence speed of our algorithm on the STSB test set method not only sets up the new state-of-the-art of non-parameterized models but also performs com- petitively when compared with models requiring either large amount of training data or prolonged training time. In future work, we plan to consider subwords into the model and explore more geo- metric structures in sentences. Acknowledgments We would like to thank Jade Huang for proofread- ing the paper and helpful writing suggestions. We also acknowledge the anonymous reviewers for their valuable feedback. References Sanjeev Arora, Yingyu Liang, and Tengyu Ma. 2017. A simple but tough-to-beat baseline for sentence em- International Conference on Learning beddings. Representations. Steven Bird, Ewan Klein, and Edward Loper. 2009. Natural language processing with Python: analyz- ing text with the natural language toolkit. " O'Reilly Media, Inc.". Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez- Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity-multilingual and arXiv preprint cross-lingual focused evaluation. arXiv:1708.00055. Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, arXiv et al. 2018. Universal sentence encoder. preprint arXiv:1803.11175. Delphine Charlet and Geraldine Damnati. 2017. Sim- bow at semeval-2017 task 3: Soft-cosine semantic similarity between questions for community ques- tion answering. In Proceedings of the 11th Interna- tional Workshop on Semantic Evaluation (SemEval- 2017), pages 315 -- 319. Alexis Conneau, Douwe Kiela, Holger Schwenk, Loıc Barrault, and Antoine Bordes. 2017. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Nat- ural Language Processing, pages 670 -- 680, Copen- hagen, Denmark. Association for Computational Linguistics. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understand- ing. arXiv preprint arXiv:1810.04805. Figure 2: Sensitivity tests on four hyper-parameters, the window size m in contextual window matrix, the number of candidate principal components K, the number of principal components to remove h, and the exponential power of singular value in coarse sentence embedding. with the benchmark models SkipThought and In- ferSent. SkipThought and InferSent are run on a NVIDIA Tesla P100 GPU, and our model is run on a CPU (Intel Xeon CPU E5-2690 v4 @2.60GHz). For fair comparison, batch size in InferSent and SkipThought is set to be 1. The results are shown in Table 5. It shows that without acceleration from GPU, our model is still faster than InferSent and is 54% faster than SkipThought. Average run time (s) Variance GEM (CPU) InferSent(GPU) SkipThought (GPU) 20.08 21.24 43.36 0.23 0.15 0.10 Table 5: Run time of GEM, InferSent and SkipThought on encoding sentences in STSB test set. GEM is run on CPU, InferSent and SkipThought is run on GPU. Data are collected from 5 trials. 5 Conclusions We proposed a simple non-parameterized method to generate sentence embeddings, based entirely on the geometric structure of the subspace spanned by word embeddings. Our sentence embedding evolves from the new orthogonal basis vector brought in by each word, which represents novel semantic meaning. The evaluation shows that our lllllllllllllll80859056789window sizePerformancelllllllllllllll8085903545556575Klllllllllllllll808590811141720hPerformancelllllllllllllll80859012345power of slllMPQASTSBSUBJ Bill Dolan, Chris Quirk, and Chris Brockett. 2004. Unsupervised construction of large paraphrase cor- pora: Exploiting massively parallel news sources. In Proceedings of the 20th international conference on Computational Linguistics, page 350. Associa- tion for Computational Linguistics. Kawin Ethayarajh. 2018. Unsupervised random walk sentence embeddings: A strong but simple baseline. In Proceedings of The Third Workshop on Represen- tation Learning for NLP, pages 91 -- 100. Simone Filice, Giovanni Da San Martino, and Alessan- dro Moschitti. 2017. Kelp at semeval-2017 task 3: Learning pairwise patterns in community question answering. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 326 -- 333. Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of arXiv preprint 2016. sentences from unlabelled data. arXiv:1602.03483. Minqing Hu and Bing Liu. 2004. Mining and summa- rizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowl- edge discovery and data mining, pages 168 -- 177. ACM. Mikhail Khodak, Nikunj Saunshi, Yingyu Liang, Tengyu Ma, Brandon Stewart, and Sanjeev Arora. 2018. A la carte embedding: Cheap but effective in- duction of semantic feature vectors. arXiv preprint arXiv:1805.05388. Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Skip-thought vectors. In Advances in neural information processing systems, pages 3294 -- 3302. Lajanugen Logeswaran and Honglak Lee. 2018. An efficient framework for learning sentence represen- tations. International Conference on Learning Rep- resentations. Marco Marelli, Luisa Bentivogli, Marco Baroni, Raf- faella Bernardi, Stefano Menini, and Roberto Zam- parelli. 2014. Semeval-2014 task 1: Evaluation of compositional distributional semantic models on full sentences through semantic relatedness and textual entailment. In Proceedings of the 8th international workshop on semantic evaluation (SemEval 2014), pages 1 -- 8. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- rado, and Jeff Dean. 2013. Distributed representa- tions of words and phrases and their compositional- In Advances in neural information processing ity. systems, pages 3111 -- 3119. Matteo Pagliardini, Prakhar Gupta, and Martin Jaggi. 2018. Unsupervised Learning of Sentence Embed- dings using Compositional n-Gram Features. In NAACL 2018 - Conference of the North American Chapter of the Association for Computational Lin- guistics. Bo Pang and Lillian Lee. 2004. A sentimental educa- tion: Sentiment analysis using subjectivity summa- rization based on minimum cuts. In Proceedings of the 42nd annual meeting on Association for Compu- tational Linguistics, page 271. Association for Com- putational Linguistics. Bo Pang and Lillian Lee. 2005. Seeing stars: Exploit- ing class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd annual meeting on association for computa- tional linguistics, pages 115 -- 124. Association for Computational Linguistics. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 confer- ence on empirical methods in natural language pro- cessing (EMNLP), pages 1532 -- 1543. A. Ruckl´e, S. Eger, M. Peyrard, and I. Gurevych. 2018. Concatenated p-mean Word Embeddings as Univer- sal Cross-Lingual Sentence Representations. ArXiv e-prints. Alexandre Salle, Aline Villavicencio, and Marco Idiart. 2016. Matrix factorization using window sampling and negative sampling for improved word represen- tations. CoRR, abs/1606.00819. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment tree- In Proceedings of the 2013 conference on bank. empirical methods in natural language processing, pages 1631 -- 1642. Karen Sparck Jones. 1972. A statistical interpretation of term specificity and its application in retrieval. Journal of documentation, 28(1):11 -- 21. Sandeep Subramanian, Adam Trischler, Yoshua Ben- gio, and Christopher J Pal. 2018. Learning gen- eral purpose distributed sentence representations via arXiv preprint large scale multi-task learning. arXiv:1804.00079. Kai Sheng Tai, Richard Socher, and Christopher D Manning. 2015. Improved semantic representations from tree-structured long short-term memory net- works. arXiv preprint arXiv:1503.00075. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Pro- cessing Systems, pages 5998 -- 6008. Ellen M Voorhees and Hoa Trang Dang. 2003. Overview of the trec 2003 question answering track. In TREC, volume 2003, pages 54 -- 68. Janyce Wiebe, Theresa Wilson, and Claire Cardie. 2005. Annotating expressions of opinions and emo- tions in language. Language resources and evalua- tion, 39(2-3):165 -- 210. John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. 2015a. Towards universal paraphrastic sen- tence embeddings. In International Conference on Learning Representation. John Wieting, Mohit Bansal, Kevin Gimpel, Karen Livescu, and Dan Roth. 2015b. From paraphrase database to compositional paraphrase model and back. arXiv preprint arXiv:1506.03487. John Wieting and Kevin Gimpel. 2017a. Paranmt-50m: Pushing the limits of paraphrastic sentence embed- dings with millions of machine translations. arXiv preprint arXiv:1711.05732. John Wieting and Kevin Gimpel. 2017b. Revisiting re- current networks for paraphrastic sentence embed- dings. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. Y. Yang, S. Yuan, D. Cer, S.-y. Kong, N. Con- stant, P. Pilar, H. Ge, Y.-H. Sung, B. Strope, and R. Kurzweil. 2018. Learning Semantic Textual Sim- ilarity from Conversations. ArXiv e-prints. A Robustness and Effectiveness of GEM A.1 Robustness Test We test the robustness of GEM by removing one non-important stop word in a sentence and com- puted the similarity between the original sentence and the one after removal. For example: • original = "The student is reading a physics book" • removed = "student is reading a physics book" Stop word "The" is removed. The cosine simi- larity between embeddings of the two sentences generated by GEM is 0.998. GEM assigns pretty similar embeddings for these two sentences even with the removal of stop words, especially this is a short sentence with only 7 words. More examples are: • original = "Someone is sitting on the blanket" • removed = "Someone is sitting on blanket" • cosine similarity = 0.981 and • original = "A man walks along walkway to the store" • removed = "man walks along walkway to the store" • cosine similarity = 0.984 These experiments prove that GEM is robust against stop words and words order. A.2 Effectiveness Test We also demonstrate that GEM assign higher weights to words with more significant meanings. Consider the sentence: the stock market closes lower on Friday, weights assigned by GEM are [lower: 4.94, stock: 4.93, closes: 4.78, market: 4.62, Friday: 4.51, the: 3.75, on: 3.70]. Again, GEM emphasizes informative words like lower and closes, and diminishes stop words like the and there. B Proof The novelty score (αn), significance score (αs) and corpus-wise uniqueness score (αu) are larger when a word w has relatively rare appearance in the corpus and can bring in new and important se- mantic meaning to the sentence. Following the section 3 in Arora et al. (2017), we can use the probability of a word w emitted from sentence s in a dynamic process to explain eq. (10) and put this as following Theorem with its proof provided below. Theorem 1. Suppose the probability that word wi is emitted from sentence s is2: p[wics] ∝ ( exp((cid:104)cs, vwi(cid:105)) +exp(−(αn+αs+αu))) Z (cid:80) (12) where cs is the sentence embedding, Z = wi∈V exp((cid:104)cs, vwi(cid:105)) and V denotes the vocab- ulary. Then when Z is sufficiently large, the MLE for cs is: (αn + αs + αu)vwi (13) cs ∝ (cid:88) wi∈s Proof: According to Equation (12), p[wics] = 1 N ( exp((cid:104)cs, vwi(cid:105)) Z +exp(−(αn+αs+αu))) (14) Where N and Z are two partition functions de- fined as N = 1 + exp(−(αn(wi) + αs(wi) + αu(wi))) (cid:88) wi∈V (cid:88) wi∈V Z = p(scs) = exp((cid:104)cs, vwi(cid:105)) (cid:89) p(wics) wi∈s (15) (16) The joint probability of sentence s is then To simplify the notation, let α = αn + αs + αu. It follows that the log likelihood f (wi) of word wi emitted from sentence s is given by fwi(cs) = log( exp((cid:104)cs, vwi(cid:105)) Z + e−α) − log(N ) (17) 2The first term is adapted from Arora et al. (2017), where words near the sentence vector cs has higher probability to be generated. The second term is introduced so that words sim- ilar to the context in the sentence or close to common words in the corpus are also likely to occur. gi = (cid:80)d the sequence is larger than the dimension d of pre- trained word vectors in this case. The only part in GEM relevant to the length of the sequence n is the coarse embedding in Equation (7). The SVD of the sentence matrix of the ith sentence is still S ∈ Rd×n = [vw1, . . . , vwn] = U ΣV T , where now U ∈ Rd×d, Σ ∈ Rd×n, and V ∈ Rn×n. Note that the d + 1th column to nth col- umn in Σ are all zero. And Equation (7) becomes j=1 f (σj)U:,j. The rest of the algorithm works as usual. Also, Gram-Schmidt (GS) pro- cess is computed in the context window of word wi, and the length of context window is set to be 2m+1 = 17 in STS benchmark dataset and super- vise downstream tasks. That is, GS is computed on 17 vectors, and 17 is smaller than the dimension d. Therefore, GS is always validate in our model, in- dependent with the length of the sentence. D.2 Sensitivity to Word Order Although utilizing Gram-Schmidt process (GS), GEM is insensitive to the order of words in the sentence, explained as follows. The new semantic meaning vector qi computed from doing GS on the context window matrix Si is independent with the relative order of first 2m vectors. This is because in GEM wi (the word we are calculating weights for) is always shifted to be the last column of Si. And weighting scheme in GEM only depends on qi. Therefore, weight scores stay the same for wi. ∇fwi(cs) = exp((cid:104)cs, vwi(cid:105))vwi exp((cid:104)cs, vwi(cid:105)) + Ze−α By Taylor expansion, we have fwi(cs) ≈ fwi(0) + ∇fwi(0)T cs (cid:104)cs, vwi(cid:105) Ze−α + 1 = constant + Again by Taylor expansion on Z, 1 Ze−α + 1 ≈ 1 + Z (1 + Z)2 α 1 + Z Z (1 + Z)2 α ≈ (18) (19) (20) ≈ 1 1 + Z α The approximation is based on the assumption that Z is sufficiently large. It follows that, (cid:104)cs, vwi(cid:105) fwi(cs) ≈ constant + Then the maximum log likelihood estimation of 1 + Z (21) α cs is: cs ≈ (cid:88) ∝ (cid:88) wi∈s wi∈s α 1 + Z vwi (αn + αs + αu)vwi (22) C Experimental settings For all experiments, sentences are tokenized us- ing the NLTK tokenizer (Bird et al., 2009) word- punct tokenize, and all punctuation is skipped. j in Equation (7). In the STS bench- f (σj) = σt mark dataset, our hyper-parameters are chosen by conducting parameters search on STSB dev set at m = 7, h = 17, K = 45, and t = 3. And we use the same values for all supervised tasks. The inte- ger interval of parameters search are m ∈ [5, 9], h ∈ [8, 20], L ∈ [35, 75] (at stride of 5), and t ∈ [1, 5]. In CQA dataset, m and h are changed to 6 and 15, the correlation term in section 2.4.2 is changed to oi = (cid:107)ST di(cid:107)2 empirically. In super- vised tasks, same as Arora et al. (2017), we do not perform principal components in supervised tasks. D Clarifications on Linear Algebra D.1 Encode a long sequence of words We would like to give a clarification on encoding a long sequence of words, for example, a para- graph or a article. Specifically, the length n of
1704.08966
2
1704
2017-07-15T17:27:13
Not All Dialogues are Created Equal: Instance Weighting for Neural Conversational Models
[ "cs.CL", "cs.AI" ]
Neural conversational models require substantial amounts of dialogue data for their parameter estimation and are therefore usually learned on large corpora such as chat forums or movie subtitles. These corpora are, however, often challenging to work with, notably due to their frequent lack of turn segmentation and the presence of multiple references external to the dialogue itself. This paper shows that these challenges can be mitigated by adding a weighting model into the architecture. The weighting model, which is itself estimated from dialogue data, associates each training example to a numerical weight that reflects its intrinsic quality for dialogue modelling. At training time, these sample weights are included into the empirical loss to be minimised. Evaluation results on retrieval-based models trained on movie and TV subtitles demonstrate that the inclusion of such a weighting model improves the model performance on unsupervised metrics.
cs.CL
cs
Not All Dialogues are Created Equal: Instance Weighting for Neural Conversational Models Pierre Lison Norwegian Computing Center Oslo, Norway [email protected] 7 1 0 2 l u J 5 1 ] L C . s c [ 2 v 6 6 9 8 0 . 4 0 7 1 : v i X r a Abstract Neural conversational models require sub- stantial amounts of dialogue data to es- timate their parameters and are therefore usually learned on large corpora such as chat forums, Twitter discussions or movie subtitles. These corpora are, however, of- ten challenging to work with, notably due to their frequent lack of turn segmentation and the presence of multiple references ex- ternal to the dialogue itself. This paper shows that these challenges can be miti- gated by adding a weighting model into the neural architecture. The weighting model, which is itself estimated from dialogue data, associates each training example to a numerical weight that reflects its intrinsic quality for dialogue modelling. At training time, these sample weights are included into the empirical loss to be minimised. Evaluation results on retrieval-based mod- els trained on movie and TV subtitles demonstrate that the inclusion of such a weighting model improves the model per- formance on unsupervised metrics. 1 Introduction The development of conversational agents (such as mobile assistants, chatbots or interactive robots) is increasingly based on data-driven methods aim- ing to infer conversational patterns from dialogue data. One major trend in the last recent years is the emergence of neural conversation models (Vinyals and Le, 2015; Sordoni et al., 2015; Shang et al., 2015; Serban et al., 2016; Lowe et al., 2017; Li et al., 2017). These neural models can be directly ∗ Also affiliated with Universidad Central del Ecuador (Quito, Ecuador). Serge Bibauw∗ KU Leuven, imec Universit´e catholique de Louvain [email protected] estimated from raw (non-annotated) dialogue cor- pora, allowing them to be deployed with a limited amount of domain-specific knowledge and feature engineering. Due to their large parameter space, the es- timation of neural conversation models requires considerable amounts of dialogue data. They are therefore often trained on conversations col- lected from various online resources, such as Twit- ter discussions (Ritter et al., 2010) online chat logs (Lowe et al., 2017), movie scripts (Danescu- Niculescu-Mizil and Lee, 2011) and movie and TV subtitles (Lison and Tiedemann, 2016). Although these corpora are undeniably useful, they also face some limitations from a dialogue modelling perspective. First of all, several dia- logue corpora, most notably those extracted from subtitles, do not include any explicit turn seg- mentation or speaker identification (Serban and Pineau, 2015; Lison and Meena, 2016). In other words, we do not know whether two consecutive sentences are part of the same dialogue turn or were uttered by different speakers. The neural conversation model may therefore inadvertently learn responses that remain within the same dia- logue turn instead of starting a new turn. Furthermore, these dialogues contain multiple references to named entities (in particular, person names such as fictional characters) that are spe- cific to the dialogue in question. These named en- tities should ideally not be part of the conversa- tion model, since they often draw on an external context that is absent from the inputs provided to the conversation model. For instance, the mention of character names in a movie is associated with a visual context (for instance, the characters ap- pearing in a given scene) that is not captured in the training data. Finally, a substantial portion of the utterances observed in these corpora is made of neutral, commonplace responses ("Perhaps", "I don't know", "Err", ...) that can be used in most conversational situations but fall short of creating meaningful and engaging conversations with hu- man users (Li et al., 2016a). The present paper addresses these limitations by adding a weighting model to the neural architec- ture. The purpose of this model is to associate each (cid:104)context, response(cid:105) example pair to a numer- ical weight that reflects the intrinsic "quality" of each example. The instance weights are then in- cluded in the empirical loss to minimise when learning the parameters of the neural conversation model. The weights are themselves computed via a neural model learned from dialogue data. Exper- imental results demonstrate that the use of instance weights improves the performance of neural con- versation models on unsupervised metrics. Human evaluation results are, however, inconclusive. The rest of this paper is as follows. The next section presents a brief overview of existing work on neural conversation models. Section 3 provides a description of the instance weighting approach. Section 4 details the experimental validation of the proposed model, using both unsupervised metrics and a human evaluation of the selected responses. Finally, Section 5 discusses the advantages and limitations of the approach, and Section 6 con- cludes this paper. 2 Related Work Neural conversation models are a family of neu- ral architectures (generally based on deep convo- lutional or recurrent networks) used to represent mappings between dialogue contexts (or queries) and possible responses. Compared to previous sta- tistical approaches to dialogue modelling based on Markov processes (Levin et al., 2000; Rieser and Lemon, 2011; Young et al., 2013), one benefit of these neural models is their ability to be estimated from raw dialogue corpora, without having to rely on additional annotation layers for intermediate representations such as state variables or dialogue acts. Rather, neural conversation models automat- ically derive latent representations of the dialogue state based on the observed utterances. Neural conversation models can be divided into two main categories, retrieval models and gener- ative models. Retrieval models are used to se- lect the most relevant response for a given con- text amongst a (possibly large) set of predefined responses, such as the set of utterances extracted from a corpus (Lowe et al., 2015; Prakash et al., 2016). Generative models, on the other hand, rely on sequence-to-sequence models (Sordoni et al., 2015) to generate new, possibly unseen responses given the provided context. These models are built by linking together two recurrent architec- tures: one encoder which maps the sequence of input tokens in the context utterance(s) to a fixed- sized vector, and one decoder that generates the response token by token given the context vec- tor (Vinyals and Le, 2015; Sordoni et al., 2015). Recent papers have shown that the performance of these generative models can be improved by incorporating attentional mechanisms (Yao et al., 2016) and accounting for the structure of con- versations through hierarchical networks (Serban et al., 2016). Neural conversation models can also be learned using adversarial learning (Li et al., 2017). two neural models are jointly learned: a generative model producing the response, and a discriminator optimised to dis- tinguish between human-generated responses and machine-generated ones. The discriminator out- puts are then used to bias the generative model to- wards producing more human-like responses. In this setting, The linguistic coherence and diversity of the models can be enhanced by including speaker- addressee information (Li et al., 2016b) and by ex- pressing the objective function in terms of Max- imum Mutual Information to enhance the diver- sity of the generated responses (Li et al., 2016a). As demonstrated by (Ghazvininejad et al., 2017), neural conversation models can also be combined with external knowledge sources in the form of factual information or entity-grounded opinions, which is an important requirement for developing task-oriented dialogue systems that must ground their action in an external context. Dialogue is a sequential decision-making pro- cess where the conversational actions of each par- ticipant influence not only the current turn but the long-term evolution of the dialogue (Levin et al., 2000). To incorporate the prediction of future outcomes in the generation process, sev- eral papers have explored the use of reinforcement learning techniques, using deep neural networks to model the expected future reward (Li et al., 2016c; Cuay´ahuitl, 2017). In particular, the Hybrid Code Networks model of (Williams et al., 2017) demon- strate how a mixture of supervised learning, re- inforcement learning and domain-specific knowl- edge can be used to optimise dialogue strategies from limited amount of training data. In contrast with the approaches outlined above, this paper does not present a new neural architec- ture for conversational models. Rather, it investi- gates how the performance of existing models can be improved "upstream", by adapting how these models can be trained on large, noisy corpora with varying levels of quality. It should be noted that, although the experiments presented in Section 4 focus on a limited range of neural models, the ap- proach presented in this paper is designed to be model-independent and can be applied as a prepro- cessing step to any data-driven model of dialogue. 3 Approach As mentioned in the introduction, the interactions extracted from large dialogue corpora do not all have the same intrinsic quality, due for instance to the frequent lack of turn segmentation or the pres- ence of external, unresolvable references to person names. In other words, there is a discrepancy be- tween the actual (cid:104)context, response(cid:105) pairs found in these corpora and the conversational patterns that should be accounted for in the neural model. One way to address this discrepancy is by fram- ing the problem as one of domain adaptation, the source domain being the original dialogue corpus and the target domain representing the dialogues we want our model to produce. The target do- main is in this case not necessarily another dia- logue domain, but simply reflects the fact that the distribution of responses in the raw corpus does not necessarily reflect the distribution of responses we ultimately wish to encode in the conversational model. A popular strategy for domain adaptation in nat- ural language processing, which has notably been used in POS-tagging, sentiment analysis, spam fil- tering and machine translation (Bickel et al., 2007; Jiang and Zhai, 2007; Foster et al., 2010; Xia et al., 2013), is to assign a higher weight to training in- stances whose properties are similar to the tar- get domain. We present below such an instance weighting approach tailored for neural conversa- tional models. 3.1 Weighting model The quality of a particular (cid:104)context, response(cid:105) pair is difficult to determine using handcrafted rules – for instance, the probability of a turn bound- ary may depend on multiple factors such as the presence of turn-yielding cues or the time gap be- tween the utterances (Lison and Meena, 2016). To overcome these limitations, we adopt a data- driven approach and automatically learn a weight- ing model from examples of "high-quality" re- sponses. What constitutes a high-quality response depends in practice on the specific criteria we wish to uphold in the conversation model – for instance, favouring responses that are likely to form a new dialogue turn (rather than a continuation of the current turn), avoiding the use of dull, common- place responses, or disfavouring the selection of responses that contain unresolved references to person names. can be The weighting model a neural model which associates expressed each as to a numer- (cid:104)context, response(cid:105) example pair ical weight. The architecture of this neural network is depicted in Figure 1. It is composed of two recurrent sub-networks with shared weights, one for the context and one for the response. Each sub-network takes a sequence of tokens as input and pass them through an embedding layer and a recurrent layer with LSTM or GRU cells. The fixed-size vectors for the context and response are then fed to a regular densely-connected layer, and finally to the final weight value through a sigmoid activation function. Additional features can also be included whenever available – for instance, timing information for movie and TV subtitles (such as the duration gap between the context and its response, in milliseconds), or document-level features such as the dialogue genre or the total duration of the dialogue. To estimate its parameters, the neural model is provided with positive examples of "high-quality" responses along with negative examples sampled at random from the corpus. Based on this training data, the network learns to assign higher weights to the (cid:104)context, response(cid:105) pairs whose output vec- tors (combined with the additional inputs) are close from the high-quality examples, and a lower weight for those further away. In practice, the se- lection of high-quality example pairs from a given corpus can be performed through a combination of simple heuristics, as detailed in Section 4.1. 3.2 Instance weighting Once the weighting model next the to run it on the entire dia- is estimated, step is Figure 1: Neural weighting model, taking as input the (cid:104)context, response(cid:105) pairs, possibly along additional features (such as timing information for subtitles), and returning an associated weight value. loss that logue corpus to compute the expected weight These sam- of each (cid:104)context, response(cid:105) pair. ple weights are then included in the empiri- cal is being minimised during train- ing. Formally, assuming a set of context-response pairs {(c1, r1), (c2, r2), ...(cn, rn)} with associ- ated weights {w1, ...wn}, the estimation of the model parameters θ is expressed as a minimisa- tion problem. For retrieval models, this minimisa- tion is expressed as: θ∗ = minθ wi L(yi, f (ci, ri; θ)) (1) n(cid:88) 1 n(cid:88) where L is a loss function (for instance, the cross-entropy loss), and yi is set to either 1 if ri is the response to ci, and 0 otherwise (when ri is a negative example). For generative models, the minimisation is similarly expressed as: θ∗ = minθ wi L(ri, f (ci; θ)) (2) 1 In both cases, the loss computed from each ex- ample pair is multiplied by the weight value deter- mined by the weight model. Examples associated with a larger weight wi will therefore have a larger influence on the gradient update steps. 4 Evaluation The approach is evaluated on the basis of retrieval- based neural models trained on English-language subtitles from (Lison and Tiedemann, 2016). Three alternative models are evaluated: 1. A traditional TF-IDF model, 2. A Dual Encoder model trained directly on the corpus examples, 3. A Dual Encoder model combined with the weighting model from Section 3.1. 4.1 Models TF-IDF model The TF-IDF (Term Frequency - Inverse Document Frequency) model computes the similarity be- tween the context and its response using methods from information retrieval (Ramos, 2003). TF- IDF measures the importance of a word in a "doc- ument" (in this case the context or response) rel- ative to the whole corpus. The model transforms the context and response (represented as bag-of- words) into TF-IDF-weighted vectors. These vec- tors are sparse vectors of a size equivalent to the vocabulary size, where each row corresponds, if the given word is present in the context or re- sponse, to its TF-IDF weight, and is 0 otherwise. The matching score between the context and its re- sponse is then determined as the cosine similarity between the two vectors: similarity = vc · vr (cid:107)vc(cid:107)2 (cid:107)vr(cid:107)2 (3) where vc and vr respectively denote the TF-IDF- weighted vectors for the context and response. Dual Encoder The Dual Encoder model (Lowe et al., 2017) con- sists of two recurrent networks, one for the con- text and one for the response. The tokens are first wc1wc2wc3wcc-1wcc.........h1h2hc-1wr1wr2wr3wrr-1wrr.........h1h2hr-1other inputs context tokensembedding layerrecurrent layer (GRU or LSTM cells)dense layerresponse tokensweight of <c,r> pair(time gap between context & response, document-level features, etc.) Figure 2: Dual encoder model, taking as input the (cid:104)context, response(cid:105) pairs and returning a score ex- pressing the adequacy of the response given the context. passed through an embedding layer and then to a recurrent layer with LSTM or GRU cells. In the original formalisation of this model (Lowe et al., 2015), the context vector is transformed through a dense layer of same dimension, representing the "predicted" response. The inner product of the predicted and actual responses is then calculated and normalised, yielding a similarity score. This model, however, only seeks to capture the seman- tic similarity between the two sequences, while the selection of the most adequate response in a given context may also need to account for other factors such as the grammaticality and coherence of the response. We therefore extend the Dual Encoder model in two ways. First, both the context and response vectors are transformed through a dense layer at the end of the recurrent layer (instead of just the context vector). Second, the final predic- tion is connected to both the inner product of the two vectors and to the response vector itself, as depicted in Figure 2. Dual Encoder with instance weighting Finally, the third model relies on the exact same Dual Encoder model as above, but applies the weighting model described in Section 3.1 prior to learning in order to assign weights to each training example. The weighting model is esti- mated on a subset of the movie and TV subtitles augmented with speaker information and filtered through heuristics to ensure a good cohesion be- tween the context and its response. These heuris- tics are detailed in the next section. Although the architecture of the Dual Encoder is superficially similar to the weighting model of Figure 1, the two models serve a different purpose: the weighting model returns the expected quality of a training example, while the Dual Encoder re- turns a score expressing the adequacy between the context and the response. 4.2 Datasets Training data for the conversation models The dataset used for training the three retrieval models is the English-language portion of the OpenSubtitles corpus of movie and TV subtitles (Lison and Tiedemann, 2016). The full dataset is composed of 105 445 subtitles and 95.5 million utterances, each utterance being associated with a start and end time (in milliseconds). Training data for the weighting model For training the weighting model, we extracted a small subset of the full corpus of subtitles cor- responding to (cid:104)context, response(cid:105) pairs satisfying specific quality criteria. The first step was to align at the sentence level the subtitles with an online collection of movie and TV scripts (1 069 movies and 6 398 TV episodes), following the approach described in (Lison and Meena, 2016). This alignment enabled us to annotate the sub- titles with speaker names and turn boundaries. Based on these subtitles, we then selected exam- ple pairs with two heuristics: 1. To ensure the response constitutes an ac- tual reply from another speaker and not sim- ply a continuation of the current turn, the wc1wc2wc3wcc-1wcc.........h1h2hc-1wr1wr2wr3wrr-1wrr.........h1h2hr-1context tokensembedding layerrecurrent layer (GRU or LSTM cells)response tokens final output(adequacy score of response giventhe context)σ(vc ⋅ vr) vcvr(dense layer)(dense layer)(dense layer) from the context subtitles were segmented into sub-dialogues. (cid:104)context, response(cid:105) pairs including a change of speaker to the re- sponse were then extracted from these sub- dialogues. Since multi-party dialogues make it harder to determine who replies to whom, only sub-dialogues with two participants were considered in the subset. 2. To ensure the response is intelligible given the context (without drawing on unresolved references to e.g. fictional person names), we also filtered out from the subset the dialogue turns including mentions of fictional charac- ter names and out-of-vocabulary words. A total of 95 624 (cid:104)context, response(cid:105) pairs can be extracted using these two heuristics. This cor- responds to about 0.1 % of the total number of ex- amples for the OpenSubtitles corpus. These pairs are used as positive examples for the weighting model, along with negative pairs sampled at ran- dom from the corpus. Test data Two distinct corpora are used as test sets for the evaluation. The first corpus, whose genre is rel- atively close to the training set, is the Cornell Movie Dialog Corpus (Danescu-Niculescu-Mizil and Lee, 2011), which is a collection of fictional conversations extracted from movie scripts (unre- lated to the ones used for training the weighting model). The transcripts from this corpus are seg- mented into conversations. Each conversation is represented as a sequence of dialogue turns. As this paper concentrates on the selection of rel- evant responses in a given context, we limited the test pairs to the ones where the context ends with a question, which yields a total of 67 305 (cid:104)context, response(cid:105) pairs. The second test set comes from a slightly dif- ferent conversational genre, namely theatre plays. The scripts of 62 English-language theatre plays were downloaded from public websites. We also limited the test pairs to the pairs where the context ends with a question, for a total of 3 427 pairs. 4.2.1 Experimental design Preprocessing The utterances from all datasets were tokenised, lemmatised and POS-tagged using the spaCy NLP library1. We also ran the named entity recogniser 1https://spacy.io/ from the same library to extract named entities. Since the person names mentioned in movies and theatre plays typically refer to fictional characters, we replaced their occurrences by tags, one distinct tag per entity. For instance, the pair: Dana: Frank, do you think you could give me a hand with these bags? I'm not a doorman, Miss Barrett. I'm a building superintendent. Frank: is simplified as: Dana: Frank: <person1>, do you think you could give me a hand with these bags? I'm not a doorman, <person2>. I'm a building superintendent. Named entities of locations and numbers are also replaced by similar tags. To account for the turn structure, turn boundaries were annotated with a <newturn> tag. The vocabulary is capped to 25 000 words determined from their frequency in the training corpus. Tokens not covered in this vocabulary are replaced by <unknown>. Training details The dialogue contexts were limited to the last 10 utterances preceding the response and a maximum of 60 tokens. The responses were defined as the next dialogue turn after the context, and limited to a maximum of 5 utterances and 30 tokens. The embedding layers of the Dual Encoders were initialised with Skip-gram embeddings trained on the OpenSubtitles corpus. For the re- current layers, we tested the use of both GRU and LSTM cells, along with their bidirectional equiva- lents (Chung et al., 2014), without noticeable dif- ferences in accuracy. As GRU cells are faster to train than LSTM cells, we opted for the use of GRU-based recurrent layers. The dimensionality of the output vectors from the recurrent layers was 400. The neural networks are trained with a batch size of 256, binary cross-entropy as cost function and RMSProp as optimisation algorithm. To avoid overfitting issues, a dropout of 0.2 was applied at all layers of the neural model. Both the weighting model and the Dual Encoder models were training with a 1:1 ratio between pos- itive examples (actual (cid:104) context, response (cid:105) pairs) and negative examples with a response sampled at random from the training set. Model name Cornell Movie Dialogs Theatre plays TF-IDF Dual Encoder Dual Encoder + weighting R10@1 R10@2 R10@5 R10@1 R10@2 R10@5 0.53 0.75 0.80 0.33 0.44 0.47 0.44 0.67 0.70 0.44 0.62 0.63 0.67 0.83 0.85 0.33 0.52 0.56 Table 1: Performance of the 3 retrieval models on the two test sets, namely the Cornell Movie Dialogs Dataset and the smaller dataset of theatre plays, using the Recall10@i metric. 4.3 Results The three models (the TF-IDF model, the base- line Dual Encoder and the Dual Encoder com- bined with the weighting model) are evaluated us- ing the Recallm@i metric, which is the most com- mon metric for the evaluation of retrieval-based models. Let {(cid:104)ci, ri(cid:105), 1 ≤ i ≤ n} be the list of m context-response pairs from the test set. For each context ci, we create a set of m alternative re- sponses, one response being the actual response ri, and the m−1 other responses being sampled at ran- dom from the same corpus. The m alternative re- sponses are then ranked based on the output from the conversational model, and the Recallm@i mea- sures how often the correct response appears in the top i results of this ranked list. The Recallm@i metric is often used for the evaluation of retrieval models as several responses may be equally "cor- rect" given a particular context. The experimental results are shown in Table 1. As detailed in the table, the Dual Encoder model combined with the weighting model outperforms the Dual Encoder baseline on both test sets (the Cornell Movie Dialogs corpus and the smaller cor- pus of theatre plays). Our hypothesis is that the weighting model biases the responses selected by the conversation model towards more cohesive ad- jacency pairs between context and response2. Figure 3 illustrates the learning curve for the two Dual Encoder models, where the accuracy is measured on a validation set composed of the high-quality example pairs described in the pre- vious section along with randomly sampled al- ternative responses (using a 1:1 ratio of positive vs. negative examples). We can observe that the Dual Encoder with instance weights outperforms the baseline model on this validation set – which is not per se a surprising result, since the purpose 2Contrary to the OpenSubtitles corpus which is made of subtitles with no turn segmentation, the Cornell Movie Di- alogs corpus and the corpus of theatre plays are derived from scripts and are therefore segmented in dialogue turns. of the weighting model is precisely to bias the con- versation model to give more importance to these types of example pairs. Figure 3: Learning curve for the two Dual Encoder models, showing the evolution of their accuracy on the validation set as a function of the number of observed training examples. 4.4 Human evaluation To further investigate the potential of this weight- ing strategy for neural conversational models, we conducted a human evaluation of the responses generated by the two neural models included in the evaluation. We collected human judgements on (cid:104)context, response(cid:105) pairs using a crowdsourc- ing platform. We extracted 115 random con- texts from the Cornell Movie Dialogs corpus and used four distinct strategies to generate dialogue responses: a random predictor (used to identify the lower bound), the two Dual Encoder models (both without and with instance weights), and ex- pert responses (used to identify the upper bound). The expert responses were manually authored by two human annotators. The resulting 460 (cid:104)context, response(cid:105) pairs were evaluated by 8 dis- tinct human judges each (920 ratings per model). The human judges were asked to rate the consis- tency between context and response on a 5-points scale, from Inconsistent to Consistent. In total, 0.00.51.01.52.02.53.03.5Numberoftrainingexamples×1060.500.550.600.650.700.750.80AccuracyDualEncoderDualEncoderwithweightingmodel 118 individuals participated in the crowdsourced evaluation. The results of this human evaluation are pre- sented in Figure 4. There is unfortunately no sta- tistically significant difference between the base- line Dual Encoder (M = 2.97, SD = 1.27) and the one combined with the weighting model (M = 3.04, SD = 1.27), as established by a Wilcoxon rank-sum test, W (1838) = 410360, p = 0.23. These inconclusive results are prob- ably due to the very low agreement between the evaluation participants (Krippendorff's α for con- tinuous variable = 0.36). The fact that the lower and upper bounds are only separated by 2 standard deviations confirms the difficulty for the raters to discriminate between responses. We hypothesise that the nature of the corpus, which is heavily de- pendent on an external context (the movie scenes), makes it particularly difficult to assess the consis- tency of the responses. Figure 4: Distribution of human ratings of the re- sponses generated by the four models tested. Some examples of responses produced by the two Dual Encoder models illustrate the improve- ments brought by the weighting model. In (1), the baseline Dual Encoder selected a turn continuation rather than a reply, while the second model avoids this pitfall. Both (1) and (2) also show that the dual encoder with instance weighting tends to select ut- terances with fewer named entities. (1) Context of conversation: – This is General Ripper speaking. – Yes, sir. – Do you recognize my voice?" ⇒ Response of Dual Encoder: – This is General Nikolas Pherides, Com- mander of the Third Army. I'm Oliver (2) Davis. ⇒ Response of Dual Encoder + weighting: – Yes, sir. I'm Gideon. Context of conversation: – Let me finish dinner before you eat it... Chop the peppers... – Are you all right? ⇒ Response of Dual Encoder: – No thanks, not hungry. Harry Dunne. ⇒ Response of Dual Encoder + weighting: – Yes I'm fine. Everything is ok. 5 Discussion The limitations of neural conversational models trained on large, noisy dialogue corpora such as movie and TV subtitles have been discussed in several papers. Some of the issues raised in pre- vious papers are the absence of turn segmentation in subtitling corpus (Vinyals and Le, 2015; Serban and Pineau, 2015; Lison and Meena, 2016), the lack of long-term consistency and "personality" in the generated responses (Li et al., 2016b), and the ubiquity of dull, commonplace responses when training generative models (Li et al., 2016a). To the best of our knowledge, this paper is the first to propose an instance weighting approach to address some of these limitations. One related approach is described in (Zhang et al., 2017) which also relies on domain adaptation for neural response gener- ation, using a combination of online and offline human judgement. Their focus is, however, on the construction of personalised conversation models and not on instance weighting. The empirical results corroborate the hypothe- sis that assigning weights to the training examples of "noisy" dialogue corpora can boost the perfor- mance of neural conversation models. In essence, the proposed approach replaces a one-pass train- ing regime with a two-pass procedure: the first pass to determine the quality of each example pair, and a second pass to update the model based on the observed pair and its associated weight. We also showed that these weights can be determined in a data-driven manner with a neural model trained on example pairs selected for their adherence to spe- cific quality criteria. Instead of this two-pass procedure, an alterna- tive approach is to directly learn a conversation model on the subset of example pairs that are known to be of high-quality. However, one major shortcoming of this approach is that it consider- llllll2345RandomDual EncoderDE+weightingAuthoredModelConsistency (1−5) ably limits the size of the training set that can be exploited. For instance, the data used to estimate the weighting model in Section 4.2 corresponds to a mere 0.1 % of the total English-language part of the OpenSubtitles corpus (since the utterances had to be associated with speaker names derived from aligned scripts in order to apply the heuris- tics). In contract, the proposed two-pass procedure can scale to datasets of any size. The results from Section 4 are limited to retrieval-based models. One important question for future work is to investigate whether the results carry over to generative, sequence-to-sequence models. As generative models are more computa- tionally intensive to train than retrieval models, the presented approach may bring another important benefit, namely the ability to filter out part of the training data to concentrate the training time on "interesting" examples with a high cohesion be- tween the context and its response. 6 Conclusion Dialogue corpora such as chat logs or movie subti- tles are very useful resources for developing open- domain conversation models. They do, however, also raise a number of challenges for conversation modelling. Two notable challenges are the lack of segmentation in dialogue turns (at least for the movie subtitles) and the presence of external con- text that is not captured in the dialogue transcripts themselves (leading to mentions of person names and unresolvable named entities). This paper showed how to mitigate these chal- lenges through the use of a weighting model ap- plied on the training examples. This weighting model can be estimated in a data-driven manner, by providing example of "high-quality" training pairs along with random pairs extracted from the same corpus. The criteria that determine how these training pairs should be selected depend in practice on the type of conversational model one wishes to learn. This instance weighting approach can be viewed as a form of domain adaptation, where the data points from the source domain (in this case, the original corpus) are re-weighted to improve the model performance in a target domain (in this case, the interactions in which the conver- sation model will be deployed). Evaluation results on retrieval-based neural models demonstrate the potential of this approach. The weighting model is essentially a preprocess- ing step and can therefore be combined with any type of conversational model. Future work will focus on two directions. The first is to extend the weighting model to account for other criteria, such as ensuring diversity of re- sponses and coherence across turns. The second is to evaluate the approach on other types of neural conversational models, and more particularly on generative models. References Steffen Bickel, Michael Bruckner, and Tobias Scheffer. 2007. Discriminative learning for differing train- In Proceedings of the ing and test distributions. 24th International Conference on Machine Learn- ing. ACM, New York, NY, USA, ICML '07, pages 81–88. Junyoung Chung, C¸ aglar Gulc¸ehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence model- ing. CoRR abs/1412.3555. Heriberto Cuay´ahuitl. 2017. SimpleDS: A simple deep reinforcement learning dialogue system. In Kris- tiina Jokinen and Graham Wilcock, editors, Dia- logues with Social Robots: Enablements, Analyses, and Evaluation, Springer, Singapore, Lecture Notes in Electrical Engineering, pages 109–118. Cristian Danescu-Niculescu-Mizil and Lillian Lee. 2011. Chameleons in imagined conversations: A new approach to understanding coordination of lin- guistic style in dialogs. In Proceedings of the Work- shop on Cognitive Modeling and Computational Linguistics, ACL 2011. Association for Computa- tional Linguistics. George Foster, Cyril Goutte, and Roland Kuhn. 2010. Discriminative instance weighting for domain adap- tation in statistical machine translation. In Proceed- ings of the 2010 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Stroudsburg, PA, USA, EMNLP '10, pages 451–459. Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. 2017. A knowledge-grounded neural conversation model. CoRR abs/1702.01932. Jing Jiang and Chengxiang Zhai. 2007. Instance In Pro- weighting for domain adaptation in NLP. ceedings of the 45th Annual Meeting of the Associ- ation of Computational Linguistics. Association for Computational Linguistics, Prague, Czech Republic, pages 264–271. E. Levin, R. Pieraccini, and W. Eckert. 2000. A stochastic model of human-machine interaction for IEEE Transactions on learning dialog strategies. Speech and Audio Processing 8(1):11–23. Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016a. A diversity-promoting ob- jective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Compu- tational Linguistics: Human Language Technolo- gies. Association for Computational Linguistics, San Diego, California, pages 110–119. Jiwei Li, Michel Galley, Chris Brockett, Georgios Sp- ithourakis, Jianfeng Gao, and Bill Dolan. 2016b. A In Pro- persona-based neural conversation model. ceedings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, Berlin, Germany, pages 994–1003. Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. 2016c. Deep rein- forcement learning for dialogue generation. CoRR abs/1606.01541. Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. 2017. Adversarial learning for neural dialogue generation. CoRR abs/1701.06547. Pierre Lison and Raveesh Meena. 2016. Automatic turn segmentation of movie & TV subtitles. In Pro- ceedings of the 2016 Spoken Language Technology Workshop. IEEE, San Diego, CA, USA, pages 245– 252. Pierre Lison and Jorg Tiedemann. 2016. Opensub- titles2016: Extracting large parallel corpora from movie and TV subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016). Ryan Lowe, Nissan Pow, Iulian Serban, and Joelle Pineau. 2015. The Ubuntu Dialogue Corpus: A large dataset for research in unstructured multi-turn In Proceedings of the 16th An- dialogue systems. nual Meeting on Discourse and Dialogue (SIGDIAL 2015). pages 285–294. Ryan Lowe, Nissan Pow, Iulian V. Serban, Lau- rent Charlin, Chia-Wei Liu, and Joelle Pineau. 2017. Training end-to-end dialogue systems with the Ubuntu Dialogue Corpus. Dialogue & Dis- course 8(1):31–65. Abhay Prakash, Chris Brockett, and Puneet Agrawal. Emulating human conversations using CoRR 2016. convolutional neural network-based IR. abs/1606.07056. Juan Ramos. 2003. Using TF-IDF to Determine Word In Proceedings Relevance in Document Queries. of the First Instructional Conference on Machine Learning. Rutgers University, New Brunswick, NJ, USA. V. Rieser and O. Lemon. 2011. Reinforcement Learn- Springer, ing for Adaptive Dialogue Systems. Berlin, Heidelberg. Alan Ritter, Colin Cherry, and Bill Dolan. 2010. Un- supervised modeling of twitter conversations. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the ACL. Association for Computational Linguistics, Stroudsburg, PA, USA, HLT '10, pages 172–180. Iulian V Serban and Joelle Pineau. 2015. Text-based speaker identification for multi-participant open- In NIPS Workshop on domain dialogue systems. Machine Learning for Spoken Language Under- standing. Montreal, Canada. Iulian V. Serban, Alessandro Sordoni, Yoshua Bengio, Aaron Courville, and Joelle Pineau. 2016. Building end-to-end dialogue systems using generative hier- archical neural network models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelli- gence. AAAI Press, AAAI'16, pages 3776–3783. Lifeng Shang, Zhengdong Lu, and Hang Li. 2015. Neural responding machine for short-text conver- In Proceedings of the 53rd Annual Meet- sation. ing of the Association for Computational Linguistics and the 7th International Joint Conference on Natu- ral Language Processing (Volume 1: Long Papers). Association for Computational Linguistics, Beijing, China, pages 1577–1586. Alessandro Sordoni, Michel Galley, Michael Auli, Chris Brockett, Yangfeng Ji, Margaret Mitchell, Jian-Yun Nie, Jianfeng Gao, and Bill Dolan. 2015. A neural network approach to context-sensitive gen- In Proceed- eration of conversational responses. ings of the 2015 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies. Denver, CO, USA, pages 196–205. Oriol Vinyals and Quoc Le. 2015. A Neural Conversa- tional Model. CoRR abs/1506.05869. Jason D. Williams, Kavosh Asadi, and Geoffrey Zweig. 2017. Hybrid code networks: practical and efficient end-to-end dialog control with supervised and rein- forcement learning. CoRR abs/1702.03274. Rui Xia, Xuelei Hu, Jianfeng Lu, Jian Yang, and Chengqing Zong. 2013. Instance selection and in- stance weighting for cross-domain sentiment clas- In Proceedings of the sification via pu learning. Twenty-Third International Joint Conference on Ar- tificial Intelligence. AAAI Press, IJCAI '13, pages 2176–2182. Kaisheng Yao, Baolin Peng, Geoffrey Zweig, and Kam-Fai Wong. 2016. An attentional neural con- versation model with improved specificity. CoRR abs/1606.01292. S. Young, M. Gai, B. Thomson, and J. D. Williams. POMDP-based statistical spoken dialog the IEEE Proceedings of 2013. systems: A review. 101(5):1160–1179. Weinan Zhang, Ting Liu, Yifa Wang, and Qingfu Zhu. 2017. Neural personalized response generation as domain adaptation. CoRR abs/1701.02073.
1808.06305
3
1808
2019-02-04T05:34:09
Post-Processing of Word Representations via Variance Normalization and Dynamic Embedding
[ "cs.CL" ]
Although embedded vector representations of words offer impressive performance on many natural language processing (NLP) applications, the information of ordered input sequences is lost to some extent if only context-based samples are used in the training. For further performance improvement, two new post-processing techniques, called post-processing via variance normalization (PVN) and post-processing via dynamic embedding (PDE), are proposed in this work. The PVN method normalizes the variance of principal components of word vectors while the PDE method learns orthogonal latent variables from ordered input sequences. The PVN and the PDE methods can be integrated to achieve better performance. We apply these post-processing techniques to two popular word embedding methods (i.e., word2vec and GloVe) to yield their post-processed representations. Extensive experiments are conducted to demonstrate the effectiveness of the proposed post-processing techniques.
cs.CL
cs
POST-PROCESSING OF WORD REPRESENTATIONS VIA VARIANCE NORMALIZATION AND DYNAMIC EMBEDDING Bin Wang1, Fenxiao Chen1, Angela Wang2, C.-C. Jay Kuo1 University of Southern California1, University of California, Berkeley2 9 1 0 2 b e F 4 ] L C . s c [ 3 v 5 0 3 6 0 . 8 0 8 1 : v i X r a ABSTRACT Language processing becomes more and more important in multimedia processing. Although embedded vector repre- sentations of words offer impressive performance on many natural language processing (NLP) applications, the infor- mation of ordered input sequences is lost to some extent if only context-based samples are used in the training. For further performance improvement, two new post-processing techniques, called post-processing via variance normalization (PVN) and post-processing via dynamic embedding (PDE), are proposed in this work. The PVN method normalizes the variance of principal components of word vectors, while the PDE method learns orthogonal latent variables from or- dered input sequences. The PVN and the PDE methods can be integrated to achieve better performance. We apply these post-processing techniques to several popular word embed- ding methods to yield their post-processed representations. Extensive experiments are conducted to demonstrate the ef- fectiveness of the proposed post-processing techniques. Index Terms -- Word Representation, Variance Normal- ization, Sequential Extraction, Language processing 1. INTRODUCTION By transferring prior knowledge from large unlabeled corpus, one can embed words into high-dimensional vectors with both semantic and syntactic meanings in their distributional repre- sentations. The design of effective word embedding methods has attracted the attention of researchers in recent years be- cause of their superior performance in many downstream nat- ural language processing (NLP) tasks, including sentimental analysis [1], information retrieval [2] and machine translation [3]. In this work, two new post-processing techniques, called post-processing via variance normalization (PVN) and post- processing via dynamic embedding (PDE), are proposed for further performance improvement. PCA-based post-processing methods have been examined in various research fields. In the word embedding field, it is observed that learned word vectors usually share a large mean and several dominant principal components, which prevents word embedding from being isotropic. Word vectors that are isotropically distributed (or uniformly distributed in spatial angles) can be differentiated from each other more easily. A post-processing algorithm (PPA) was recently proposed in [4] to exploit this property. That is, the mean and several domi- nant principal components are removed by the PPA method. On the other hand, their complete removal may not be the best choice since they may still provide some useful information. Instead of removing them, we propose a new post-processing technique by normalizing the variance of embedded words and call it the PVN method here. The PVN method imposes constraints on dominant principal components instead of eras- ing their contributions completely. Existing word embedding methods are primarily built upon the concept that "You shall know a word by the company it keeps." [5]. As a result, most of current word embedding methods are based on training samples of "(word, context)". Most context-based word embedding methods do not differ- entiate the word order in sentences, meaning that, they ignore the relative distance between the target and the context words in a chosen context window. Intuitively, words that are closer in a sentence should have stronger correlation. This has been verified in [6]. Thus, it is promising to design a new word embedding method that not only captures the context infor- mation but also models the dynamics in a word sequence. To achieve further performance improvement, we pro- pose the second post-processing technique, which is called the PDE method. Inspired by dynamic principal component analysis (Dynamic-PCA) [7], the PDE method projects exist- ing word vectors into an orthogonal subspace that captures the sequential information optimally under a pre-defined lan- guage model. The PVN method and the PDE method can work together to boost the overall performance. Extensive experiments are conducted to demonstrate the effectiveness of PVN/PDE post-processed representations over their origi- nal ones. 2. HIGHLIGHTED CONTRIBUTIONS Post-processing and dimensionality reduction techniques in word embeddings have primarily been based on the principal component analysis (PCA). There is a long history in high dimensional correlated data analysis using latent variable ex- traction, including PCA, singular spectrum analysis (SSA) and canonical correlation analysis (CCA). They are shown to be effective in various applications. Among them, PCA is a widely used data-driven dimensionality reduction tech- 1 nique as it maximizes the variance of extracted latent vari- ables. However, the conventional PCA focuses on static vari- ance while ignoring time dependence between data distribu- tions. It demands additional work in applying the PCA to dynamic data. It is pointed out in [4] that embedded words usually share a large mean and several dominant principal components. As a consequence, the distribution of embedded words are not isotropic. Word vectors that are isotropically distributed (or uniformly distributed in spatial angles) are more differen- tiable from each other. To make the embedding scheme more robust and alleviate the hubness problem [8], they proposed to remove dominant principal components of embedded words. On the other hand, some linguistic properties are still captured by these dominant principal components. Instead of remov- ing dominant principal components completely, we propose a new post-processing technique by imposing regularizations on principal components in this work. Recently, contextualized word embedding has gained at- tention since it tackles the word meaning problem using the information from the whole sentence [9]. It contains a bi- directional long short-term memory (bi-LSTM) module to learn a language model whose inputs are sequences. The per- formance of this model indicates that the ordered information plays an important role in the context-dependent representa- tion, and it should be taken into consideration in the design of context-independent word embedding methods. There are three main contributions in this work. We propose two new post-processing techniques in Sec. 3 and Sec. 4, respectively. Then, we apply the developed tech- niques to several popular word embedding methods and gen- erate their post-processed representations. Extensive experi- ments are conducted over various baseline models including SGNS [10], CBOW [10], GloVe [11] and Dict2vec [12] in Sec. 5 to demonstrate the effectiveness of post-processed rep- resentations over their original ones. 3. POST-PROCESSING VIA VARIANCE NORMALIZATION We modify the PPA method [4] by regularizing the vari- ances of leading components at a similar level and call it the post-processing algorithm with variance normalization (PVN). The PVN method is described in Algorithm 1, where V denotes the vocabulary set. In Step 4, (uT i v(w)) is the projection of v(w) to the ith principal component. We multiply it by a ratio factor σi − σd+1 to constrain its variance. Then, we project it back σi to the original bases and subtract it from the mean-removed word vector. Algorithm 1 Post-Processing via Variance Normalization (PVN) Input: Given word representations v(w), w ∈ V , and threshold parameter d. 1. Remove the mean of {v(w), w ∈ V } µ ← 1 V Pw∈V v(w) and v(w) ← v(w) − µ. 2. Compute the first d + 1 PCA components u1, · · · , ud+1 ← PCA(v(w), w ∈ V ) 3. Compute the standard deviation for the first d + 1 PCA components σ1, · · · , σd+1 ← variances of u1, · · · , ud+1, 4. Determine the new representation ′ v (w) ← v(w) − Pd Output: Processed representations v i=1 σi σi − σd+1 (uT i v(w))ui ′ (w), w ∈ V . v′(w) to bases uj : d j v′(w) = uT uT j v(w) − = uT j v(w) − σi − σd+1 X i=1 σj − σd+1 σi σj (uT i v(w))uT j ui (uT j v(w))uT j uj (1) = σd+1 σj uT j v(w). Thus, the standard deviation of all post-processed jth prin- cipal component, 1 ≤ j ≤ d, is equal to σd+1. Thus, all variances of leading d + 1 principal components will be nor- malized to the same level by the PVN. This makes embedding vectors more evenly distributed in all dimensions. The only hyper-parameter to tune is threshold parameter d. The optimal setting may vary with different word embed- ding baselines. A good rule of thumb is to choose d ≈ D/50, where D is the dimension of word embeddings. Also, we can determine the dimension threshold, d, by examining energy ratios of principal components. 4. POST-PROCESSING VIA DYNAMIC EMBEDDING 4.1. Language Model Our language model is a linear transformation that predicts the current word given its ordered context words. For a se- quence of words: w1, w2, w3, · · · , wn, the word embedding format is represented as v(w1), v(w2), v(w3), · · · , v(wn). Two baseline models, SGNS and GloVe, are considered. In other words, v(wi) is the embedded word of wi using one of these methods. Our objective is to maximize the conditional probability p(wi wi−c, · · · , wi−1, wi+1, · · · , wi+c), (2) To compute the standard deviation of the ith principal component of processed representation v′(w), we project where c is the context window size. As compared to other lan- guage models that use tokens from the past [9], we consider 2 the two-sided context as shown in Eq. (2) since they are about equally important to the center word distribution in language modeling. The linear language model can be written as v(wi) = X i−c≤j≤i+c,j6=i bj v(wj ) + ∆, (3) where v(w) is the word embedding representation after the latent variable transform to be discussed in Sec. 4.2. The term, ∆, is used to represent the information loss that cannot be well modeled in the linear model. We treat ∆ as a neglible term and Eq. (3) as a linear approximation of the original language model. 4.2. Dynamic Latent Variable Extraction We apply the dynamic latent variable technique to the word embedding problem in this subsection. To begin with, we de- fine an objective function to extract the dynamic latent vari- ables. The word sequence data is denoted by W = [w1, w2, · · · , wn], (4) and the data matrix, Wi, derived from W is formed using the chosen context window size and its word embedding repre- sentation Vi from data Wi: Wi = [wi−c, · · · , wi−1, wi+1, · · · , wi+c] ∈ R1×2c,(5) Vi = [v(wi−c), · · · , (6) v(wi−1), v(wi+1), · · · , v(wi+c)] ∈ RD×2c, (7) where D is the word embedding dimension. Then, the objec- tive function used to extract the dynamic latent variable can be written as 4.3. Optimization There is no analytical solution to Eq. (8) since A and b are coupled [13]. Besides, we need to impose constraints on A and b. That is, the columns of A are orthonormal vectors while b = 1. The orthogonality constraint on matrix A plays an important role. For example, the orthogonality con- straint is introduced for bilingual word embedding for several reasons. The original word embedding space is invariant and self-consistent under the orthogonal principal [14, 15]. More- over, without such a constraint, the learned dynamic latent variables has to be extracted iteratively, which is time con- suming. Furthermore, the extracted latent variables tend to be close to each other with a small angle. We adopt the optimization procedure in Algorithm 2 to solve the optimization problem. Note that parameter β is used to control the orthogonality-wise convergence rate. Algorithm 2 Optimization for extracting dynamic latent vari- ables Initialize A and b randomly as learnable parameters. for Training batch Wi=1,...,m do Find corresponding word embedding Vi. Predict the center word v(wi) = AT Vib. Extract negative samples based on word frequency. Update A and b by gradient descent to optimize Eq. (9). b := b/b A := (1 + β)A − βAAT A end for We maximize the inner product over all tokens as shown in Eq. (8) in theory, yet we adopt negative sampling for pa- rameter update in practice to save the computation. The ob- jective function can be rewritten as A,b X max i < AT Vib, AT v(wi) > (8) max A,b F (A, b), where A is a matrix of dimension D × k, b ∈ R2c is a weighted sum of context word representations, and where k is the selected dynamic dimension. We interpret A in Eq. (8) as a matrix that stores dynamic If A contains all learned dynamic princi- latent variables. pal components of dimension k, AT Vi is the projection to dynamic principal components from all context word repre- sentation and AT v(wi) is the projection of the center word representation v(wi). Vector b is a weighted sum of context representations used for prediction. We seek optimal A and b to maximize the sum of all inner products of predicted cen- ter word representation AT Vib and the ith center word rep- resentation AT v(wi). The choice of the inner product rather than other distance measures is to maximize the variance over extracted dynamic latent variables. For further details, we re- fer to [7]. where N X n=1 F (A, b) = (cid:16) log σ((cid:2)(AT Vib)T AT v(wi)(cid:3))+ wn∼Pn(w) (cid:2)log σ(−(cid:2)(AT Vib)T AT v(wn)(cid:3))(cid:3)(cid:17), E (9) and where σ(x) = 1/(1 + exp(−x)), N is the amount of the negative samples used per positive training sample, and negative samples v(wn) are sampled based on their overall frequency distribution. The final word embedding vector is a concatenation of two parts: 1) the dynamic dimensions by projecting v(wi) to the learned dynamic subspace A in form of AT v(wi), and 2) static dimensions obtained from static PCA dimension reduc- tion in form of P CA(v(wi)). 3 5. EXPERIMENTS 5.1. Baselines and Hyper-parameter Settings We conduct the PVN on top of several baseline models. For all SGNS related experiments, wiki2010 corpus1 (around 6G) is used for training. The vocabulary set contains 830k vocab- ularies, which means words occur more than 10 times are in- cluded. For CBOW, GloVe and Dict2vec, we all adopt the of- ficial released code and trained on the same dataset as SGNS. Here we set d=11 across all experiments. For the PDE method, we obtain training pairs from the wiki2010 corpus to maintain consistency with the SGNS model. The vocabulary size is 800k. Words with low fre- quency are assigned to the same word vectors for simplicity. Name Pairs Year 353 2002 WS-353 2009 WS-353-SIM 203 2009 252 WS-353-REL 2013 2034 Rare-Word MEN 3000 2012 2011 287 MTurk-287 2012 771 MTurk-771 2014 999 SimLex-999 Verb-143 143 2014 2016 3500 SimVerb-3500 Type WS-353 WS-353-SIM WS-353-REL Rare-Word MEN MTurk-287 MTurk-771 SimLex-999 Verb-143 SimVerb-3500 Average SGNS 65.7 73.2 58.1 39.5 70.2 62.8 64.6 41.6 35.0 26.5 47.8 PPA PVN(ours) 67.6 73.8 59.4 42.4 72.5 64.7 66.2 42.6 38.9 28.1 49.8 68.1 73.9 60.7 42.9 73.2 66.4 66.8 42.8 39.5 28.5 50.3 Table 2. The SRCC performance comparison (×100) for SGNS alone, SGNS+PPA and SGNS+PVN against word sim- ilarity datasets, where the last row is the average performance weighted by the pair number of each dataset. Type: Google Semantic Syntactic MSR Add Mul Add Mul Add Mul Add Mul SGNS 59.6 61.2 57.8 59.3 61.1 62.7 51.0 53.3 PPA PVN(ours) 61.3 60.3 62.4 59.5 60.5 61.0 53.0 53.3 62.1 61.9 62.4 60.9 61.8 62.7 53.4 54.9 Table 1. Word similarity datasets used in our experiments, where pairs indicate the number of word pairs in each dataset. Table 3. The SRCC performance comparison (×100) for SGNS alone, SGNS+PPA and SGNS+PVN against word analogy datasets. 5.2. Datasets 5.2.2. Word Analogy We consider two popular intrinsic evaluation benchmarks in our evaluation: 1) word similarity and 2) word analogy. De- tailed introduction can be found in [16]. Our proposed post- processing methods work well in both evaluation methods as reported in Sec. 5.3 and Sec. 5.4. 5.2.1. Word Similarity Word similarity evaluation is widely used in evaluating word embedding quality. It focuses on the semantic meaning of words. Here, we use the cosine distance measure and Spear- man's rank correlation coefficients (SRCC) [17] to measure the distance and evaluate the similarity between our results and human scores, respectively. We conduct tests on 10 pop- ular datasets (see Table 1) to avoid evaluation occasionality. For more information of each dataset, we refer to the web- site2. Due to the limitation of performance comparison in terms of word similarity [18], performance comparison in word anal- ogy is adopted as a complementary tool to evaluate the quality of word embedding methods. Both addition and multiplica- tion operations are implemented to predict word d here. In PDE method, we report commonly used addition operation for simplicity. We choose two major datasets for word analogy evalua- tion. They are: 1) the Google dataset [19] and 2) the MSR dataset [20]. The Google dataset contains 19,544 questions. They belong to two major categories: semantic and morpho- syntactic, each of which contains 8,869 and 10,675 questions, respectively. We also report the results conducted on two Google subsets. The MSR dataset contains 8,000 analogy questions. Out-of-vocabulary words were removed from both datasets.3 1http://nlp.stanford.edu/data/WestburyLab.wikicorp.201004.txt.bz2 2http://www.wordvectors.org/ 3Out-of-vocabulary words are those appear less than 10 times in the wiki2010 dataset. 4 5.2.3. Extrinsic Evaluation For PVN method, we conduct further experiments over ex- trinsic evaluation tasks including sentiment analysis and neu- ral machine translation (NMT). For both tasks, Bidirection LSTM is utilized as the inference tool. Two sentiment analy- sis dataset is utilized: Internet Movie Database (IMDb) and Sentiment Treebank dataset (SST). Europarl v8 dataset for english-french translation is utilized in our neural machine translation task. We report accuracy for IMDb and SST dataset and validation accuracy for NMT. Baselines SGNS CBOW GloVe Dict2vec IMDb SST NMT 80.92/86.03 85.20/85.81 83.51/84.88 80.62/84.40 66.00/66.76 67.12/66.94 64.53/67.74 65.06/66.89 50.50/50.62 49.78/49.97 50.31/50.58 50.45/50.56 Table 4. Extrinsic Evaluation for SGNS alone and SGNS+PVN. The first value is from orignal model while sec- ond value is from our post-processing embedding model. 5.3. Performance Evaluation of PVN The performance of the PVN as a post-processing tool for the SGNS baseline methods is given in Tables 3. It also shows results of the baselines and the baseline+PPA [4] for perfor- mance bench-marking. Table 2 compares the SRCC scores of the SGNS alone, the SGNS+PPA and the SGNS+PVN against word similarity datasets. We see that the SGNS+PVN performs better than the SGNS+PPA. We observe the largest performance gain of the SGNS+PVN reaches 5.2% in the avarage SRCC scores. It is also interesting to point out that the PVN is more robust than the PPA with different settings in d. Table 3 compares the SRCC scores of SGNS, SGNS+PPA and SGNS+PVN against word analogy datasets. We use ad- dition as well as multiplication evaluation methods. PVN per- forms better than PPA in both. For the multiplication evalu- ation, the performance of PPA is worse than the baseline. In contrast, the proposed PVN method has no negative effect as it performs consistently well. This can be explained below. When the multiplication evaluation is adopted, the missing dimensions of the PPA influence the relative angles of vectors a lot. This is further verified by the fact that some linguis- tic properties are captured by these high-variance dimensions and their total elimination is sub-optimal. Table 4 indicates extrinsic evaluation results. We can see that our PVN post-processing method performs much bet- ter compared with the original result in various downstream tasks. SGNS Type WS-353 65.7 WS-353-SIM 73.2 58.1 WS-353-REL 39.5 Rare-Word 59.6 Google 57.8 Semantic 61.1 Syntactic MSR 51.0 PVN(ours) 65.9 73.6 59.3 38.6 60.8 59.6 61.8 51.6 Table 5. The SRCC performance comparison (×100) for SGNS alone and SGNS+PDE against word similarity and analogy datasets. 5.4. Performance Evaluation of PDE We adopt the same setting in evaluating the PDE method such as the window size, vocabulary size, number of nega- tive samples, training data, etc. when it is applied to SGNS baseline. The final word representation is composed by two parts: v(w) = [vs(w)T , vd(w)T ]T , where vs(w) is the static part obtained from dimension reduction using PCA and vd(w) = AT v(w) is the projection of v(w) to dynamic sub- space A. Here, we set the dimensions of vs(w) and vd(w) to 240 and 60, respectively. The SRCC performance comparison of SGNS alone and SGNS+PDE against the word similarity and analogy datasets are shown in Tables 5. By adding the ordered information via PDE, we see that the quality of word representations is improved in both evaluation tasks. SGNS Type WS-353 65.7 WS-353-SIM 73.2 WS-353-REL 58.1 35.0 Verb-143 39.5 Rare-Word 59.6 Google Semantic 57.8 61.1 Syntactic MSR 51.0 PVN(ours) 69.0 75.3 61.9 44.1 42.5 62.8 62.8 62.8 53.7 Table 6. The SRCC performance comparison (×100) for SGNS alone and SGNS+PVN/PDE model against word sim- ilarity and analogy datasets. 5.5. Performance Evaluation of Integrated PVN/PDE We can integrate PVN and PDE together to improve their in- dividual performance. Since the PVN provides a better word embedding, it can help PDE learn better. Furthermore, nor- malizing variances for dominant principal components is ben- eficial since they occupy too much energy and mask the con- tributions of remaining components. On the other hand, com- 5 ponents with very low variances may contain much noise. They should be removed or replaced while the PDE can be used to replace the noisy components. The SRCC performances of the baseline SGNS method and the SGNS+PVN/PDE method for the word similarity and the word analogy tasks are listed in Table 6. Better results are obtained across all datasets. The improvement over the Verb- 143 dataset has a high ranking among all datasets with either joint PVN/PDE or PDE alone. This matches our expectation since the context order has more contribution over verbs. 6. CONCLUSION AND FUTURE WORK Two post-processing techniques, PVN and PDE, were pro- posed to improve the quality of baseline word embedding methods in this work. The two techniques can work indepen- dently or jointly. The effectiveness of these techniques was demonstrated by both intrinsic and extrinsic evaluation tasks. We would like to study the PVN method by exploiting the correlation of dimensions, and applying it to dimensionality reduction of word representations in the near future. Further- more, we would like to apply the dynamic embedding tech- nique to both generic and/or domain-specific word embed- ding methods with a limited amount of data. It is also desired to consider its applicability to non-linear language models. 7. REFERENCES [1] Bonggun Shin, Timothy Lee, and Jinho D Choi, "Lex- icon integrated cnn models with attention for sentiment analysis," arXiv preprint arXiv:1610.06272, 2016. [2] Hinrich Schutze, Christopher D Manning, and Prab- hakar Raghavan, Introduction to information retrieval, vol. 39, Cambridge University Press, 2008. [3] Yanzhuo Ding, Yang Liu, Huanbo Luan, and Maosong Sun, "Visualizing and understanding neural machine translation," in NAACL, 2017, vol. 1, pp. 1150 -- 1159. [4] Jiaqi Mu, Suma Bhat, and Pramod Viswanath, "All-but- the-top: Simple and effective postprocessing for word representations," arXiv preprint arXiv:1702.01417, 2017. [5] John R Firth, "A synopsis of linguistic theory, 1930- 1955," Studies in linguistic analysis, 1957. [6] Urvashi Khandelwal, He He, and Peng Qi, "Sharp nearby, fuzzy far away: How neural language models use context," arXiv preprint arXiv:1805.04623, 2018. [7] Yining Dong and S Joe Qin, "A novel dynamic pca al- gorithm for dynamic data modeling and process moni- toring," Journal of Process Control, vol. 67, pp. 1 -- 11, 2018. [8] Milos Radovanovi´c, Alexandros Nanopoulos, and Mir- jana Ivanovi´c, "On the existence of obstinate results in vector space models," in ACM SIGIR. ACM, 2010, pp. 186 -- 193. [9] Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer, "Deep contextualized word representa- tions," arXiv preprint arXiv:1802.05365, 2018. [10] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- rado, and Jeff Dean, "Distributed representations of words and phrases and their compositionality," in Ad- vances in neural information processing systems, 2013, pp. 3111 -- 3119. [11] Jeffrey Pennington, Richard Socher, and Christopher Manning, "Glove: Global vectors for word represen- tation," in EMNLP, 2014, pp. 1532 -- 1543. [12] Julien Tissier, Christophe Gravier, and Amaury Habrard, "Dict2vec: Learning word embeddings using lexical dictionaries," in EMNLP, 2017, pp. 254 -- 263. [13] Junghui Chen and Kun-Chih Liu, "On-line batch pro- cess monitoring using dynamic pca and dynamic pls models," Chemical Engineering Science, vol. 57, no. 1, pp. 63 -- 75, 2002. [14] Mikel Artetxe, Gorka Labaka, and Eneko Agirre, "Learning principled bilingual mappings of word em- beddings while preserving monolingual invariance," in EMNLP, 2016, pp. 2289 -- 2294. [15] Mikel Artetxe, Gorka Labaka, and Eneko Agirre, "Gen- eralizing and improving bilingual word embedding mappings with a multi-step framework of linear trans- formations," in AAAI, 2018. [16] Bin Wang, Angela Wang, Fenxiao Chen, Yunchen Wang, and C-C Jay Kuo, "Evaluating word embed- ding models: Methods and experimental results," arXiv preprint arXiv:1901.09785, 2019. [17] Charles Spearman, "The proof and measurement of as- sociation between two things," The American journal of psychology, vol. 15, no. 1, pp. 72 -- 101, 1904. [18] Manaal Faruqui, Yulia Tsvetkov, Pushpendre Rastogi, and Chris Dyer, "Problems with evaluation of word em- beddings using word similarity tasks," arXiv preprint arXiv:1605.02276, 2016. [19] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean, "Efficient estimation of word representations in vector space," arXiv preprint arXiv:1301.3781, 2013. 6 [20] Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig, "Linguistic regularities in continuous space word rep- resentations," in NAACL, 2013, pp. 746 -- 751. 7
1512.05030
3
1512
2016-01-24T04:28:46
Morpho-syntactic Lexicon Generation Using Graph-based Semi-supervised Learning
[ "cs.CL" ]
Morpho-syntactic lexicons provide information about the morphological and syntactic roles of words in a language. Such lexicons are not available for all languages and even when available, their coverage can be limited. We present a graph-based semi-supervised learning method that uses the morphological, syntactic and semantic relations between words to automatically construct wide coverage lexicons from small seed sets. Our method is language-independent, and we show that we can expand a 1000 word seed lexicon to more than 100 times its size with high quality for 11 languages. In addition, the automatically created lexicons provide features that improve performance in two downstream tasks: morphological tagging and dependency parsing.
cs.CL
cs
Morpho-syntactic Lexicon Generation Using Graph-based Semi-supervised Learning Manaal Faruqui Carnegie Mellon University [email protected] Ryan McDonald Google Inc. Radu Soricut Google Inc. [email protected] [email protected] 6 1 0 2 n a J 4 2 ] L C . s c [ 3 v 0 3 0 5 0 . 2 1 5 1 : v i X r a Abstract Morpho-syntactic lexicons provide informa- tion about the morphological and syntactic roles of words in a language. Such lexicons are not available for all languages and even when available, their coverage can be limited. We present a graph-based semi-supervised learning method that uses the morphologi- cal, syntactic and semantic relations between words to automatically construct wide cover- age lexicons from small seed sets. Our method is language-independent, and we show that we can expand a 1000 word seed lexicon to more than 100 times its size with high quality for 11 languages. In addition, the automatically created lexicons provide features that improve performance in two downstream tasks: mor- phological tagging and dependency parsing. 1 Introduction lexicons contain information Morpho-syntactic the morphological attributes and syntactic about roles of words in a given language. A typical lexicon contains all possible attributes that can be displayed by a word. Table 1 shows some entries in a sample English morpho-syntactic lexicon. As these lexicons contain rich linguistic information, they are useful as features in downstream NLP tasks like machine translation (Niessen and Ney, 2004; Minkov et al., 2007; Green and DeNero, 2012), part of speech tag- ging (Schmid, 1994; Denis and Sagot, 2009; Moore, 2015), dependency parsing (Goldberg et al., 2009), language modeling (Arisoy et al., 2010) and mor- phological tagging (Muller and Schuetze, 2015) in- ter alia. There are three major factors that limit the use of such lexicons in real world applications: (1) played playing awesome POS:VERB, VFORM:FIN, . . . POS:VERB, VFORM:GER, . . . POS:ADJ, DEGREE:POS TENSE:PAST, TENSE:PRES, Table 1: A sample English morpho-syntactic lexicon. They are often constructed manually and are expen- sive to obtain (Kokkinakis et al., 2000; Dukes and Habash, 2010); (2) They are currently available for only a few languages; and (3) Size of available lexi- cons is generally small. In this paper, we present a method that takes as in- put a small seed lexicon, containing a few thousand annotated words, and outputs an automatically con- structed lexicon which contains morpho-syntactic attributes (henceforth referred to as attributes) for a large number of words of a given language. We model the problem of morpho-syntactic lexicon gen- eration as a graph-based semi-supervised learning problem (Zhu, 2005; Bengio et al., 2006; Subra- manya and Talukdar, 2014). We construct a graph where nodes represent word types and the goal is to label them with attributes. The seed lexicon pro- vides attributes for a subset of these nodes. Nodes are connected to each other through edges that de- note features shared between them or surface mor- phological transformation between them. Our entire framework of lexicon generation, in- cluding the label propagation algorithm and the fea- ture extraction module is language independent. We only use word-level morphological, semantic and syntactic relations between words that can be in- duced from unannotated corpora in an unsuper- of our model. We construct a graph in which nodes are word types and directed edges are present be- tween nodes that share one or more features. Edges between nodes denote that there might be a relation- ship between the attributes of the two nodes, which we intend to learn. As we want to keep our model language independent, we use edge features that can be induced between words without using any lan- guage specific tools. To this end, we describe three features in this section that can be obtained using unlabeled corpora for any given language.1 Fig. 1 shows a subgraph of the full graph constructed for English. Word Clusters. Previous work has shown that un- labeled text can be used to induce unsupervised word clusters which can improve the performance of many NLP tasks in different languages (Clark, 2003; Koo et al., 2008; Turian et al., 2010; Faruqui and Pad´o, 2010; Tackstrom et al., 2012; Owoputi et al., 2013). Word clusters capture semantic and syntactic similarities between words, for example, play and run are present in the same cluster. We obtain word clusters by using Exchange clustering algorithm (Kneser and Ney, 1993; Martin et al., 1998; Uszkoreit and Brants, 2008) on large unla- beled corpus of every language. As in Tackstrom et al. (2012), we use one year of news articles scrapped from a variety of sources and cluster only the most frequent 1M words into 256 different clusters. An edge was introduced for every word pair sharing the same word cluster and a feature for the cluster is fired. Thus, there are 256 possible cluster features on an edge, though in our case only a single one can fire. Suffix & Prefix. Suffixes are often strong indi- cators of the morpho-syntactic attributes of a word (Ratnaparkhi, 1996; Clark, 2003). For example, in English, -ing denotes gerund verb forms like, study- ing, playing and -ed denotes past tense like studied, played etc. Prefixes like un-, in- often denote ad- jectives. Thus we include both 2-gram and 3-gram 1Some of these features can cause the graph to become very dense making label propagation prohibitive. We keep the size of the graph in check by only allowing a word node to be con- nected to at most 100 other (randomly selected) word nodes sharing one particular feature. This reduces edges while still keeping the graph connected. Figure 1: A subgraph from the complete graph of English showing different kinds of features shared on the edges between words. Some possible features/edges have been removed for enhancing clarity. vised manner. One particularly novel aspect of our graph-based framework is that edges are fea- turized. Some of these features measure similarity, e.g., singular nouns tend to occur in similar distri- butional contexts as other singular nouns, but some also measure transformations from one inflection to another, e.g., adding a ‘s’ suffix could indicate flip- ping the NUM:SING attribute to NUM:PLUR (in En- glish). For every attribute to be propagated, we learn weights over features on the edges separately. This is in contrast to traditional label propagation, where edges indicate similarity exclusively (Zhu, 2005). We construct lexicons in 11 languages of vary- ing morphological complexity. We perform intrin- sic evaluation of the quality of generated lexicons obtained from either the universal dependency tree- bank or created manually by humans (§4). We show that these automatically created lexicons provide useful features in two extrinsic NLP tasks which re- quire identifying the contextually plausible morpho- logical and syntactic roles: morphological tagging (Hajic and Hladk´a, 1998; Hajic, 2000) and syntactic dependency parsing (Kubler et al., 2009). We ob- tain an average of 15.4% and 5.3% error reduction across 11 languages for morphological tagging and dependency parsing respectively on a set of publicly available treebanks (§5). We anticipate that the lexi- cons thus created will be useful in a variety of NLP problems. 2 Graph Construction The approach we take propagates information over lexical graphs (§3). In this section we describe how to construct the graph that serves as the backbone playplayedplayingrunrunningclus:20prefix:pl, suffix:{null}:edprefix:plsuffix:ing:edclus:15suffix:ingsuffix:{null}:ningprefix:plsuffix:{null}:ing suffix and prefix as edge features.2 We introduce an edge between two words sharing a particular suffix or prefix feature. Morphological Transformations. Soricut and Och (2015) presented an unsupervised method of inducing prefix- and suffix-based morphological transformations between words using word embed- dings. In their method, statistically, most of the transformations are induced between words with the same lemma (without using any prior information about the word lemma). For example, their method induces the transformation between played and playing as suffix:ed:ing. This feature indicates TENSE:PAST to turn off and TENSE:PRES to turn on.3 We train the morphological transformation prediction tool of Soricut and Och (2015) on the news corpus (same as the one used for training word clusters) for each language. An edge is introduced between two words that exhibit a morphological transformation feature from one word to another as indicated by the tool’s output. Motivation for the Model. To motivate our model, consider the words played and playing. They have a common attribute POS:VERB but they differ in tense, showing TENSE:PAST and TENSE:PRES resp. Typical graph-propagation algorithms model similarity (Zhu, 2005) and thus propagate all at- tributes along the edges. However, we want to model if an attribute should propagate or change across an edge. For example, having a shared cluster feature, is an indication of similar POS tag (Clark, 2003; Koo et al., 2008; Turian et al., 2010), but a sur- face morphological transformation feature like suf- fix:ed:ing possibly indicates a change in the tense of the word. Thus, we will model attributes prop- agation/transformation as a function of the features shared on the edges between words. The features described in this section are specially suitable for languages that exhibit concatenative morphology, like English, German, Greek etc. and might not work very well with languages that exhibit non- concatenative morphology i.e, where root modifica- tion is highly frequent like in Arabic and Hebrew. 2We only include those suffix and prefix which appear at least twice in the seed lexicon. TENSE:PAST: 1 → -1, TENSE:PRESENT: -1 → 1 (§3). 3Our model will learn the following transformation: However, it is important to note that our framework is not limited to just the features described here, but can incorporate any arbitrary information over word pairs (§8). 3 Graph-based Label Propagation Let W = We now describe our model. {w1, w2, . . . , wW} be the vocabulary with W words and A = {a1, a2, . . . , aA} be the set of lexical attributes that words in W can ex- press; e.g. W = {played, playing, . . .} and A = {NUM:SING, NUM:PLUR, TENSE:PAST, . . .}. Each word type w ∈ W is associated with a vec- tor aw ∈ [−1, 1]A, where ai,w = 1 indicates that word w has attribute i and ai,w = −1 indicates its absence; values in between are treated as degrees of uncertainty. For example, TENSE:PASTplayed = 1 and TENSE:PASTplaying = −1.4 The vocabulary W is divided into two disjoint subsets, the labeled words L for which we know their aw’s (obtained from seed lexicon)5 and the un- labeled words U whose attributes are unknown. In general U (cid:29) L. The words in W are organized into a directed graph with edges E between words. Let, vector φ(w, v) ∈ [0, 1]F denote the features on the directed edge between words w and v, with 1 indicating the presence and 0 the absence of fea- ture fk ∈ F, where, F = {f1, f2, . . . , fF} are the set of possible binary features shared between two words in the graph. For example, the features on edges between played and playing from Fig. 1 are:  1, 1, 0, . . . φk(played, playing) = iffk = suffix:ed:ing iffk = prefix:pl iffk = suffix:ly We seek to determine which subsets of A are valid for each word w ∈ W. We learn how a particular attribute of a node is a function of that particular attribute of its neighboring nodes and features on the edge connecting them. Let ai,w be an attribute of word w and let ai,w be the empirical estimate of that 4We constrain ai,w ∈ [−1, 1] as its easier to model the flip- ping of an attribute value from −1 to 1 as opposed to [0, 1]. 5We use labeled, seed, and training lexicon to mean the same thing interchangeably. Figure 2: Word graph with edges between words showing the labeled (grey) and the unlabeled (white) word nodes. Only nodes connected via solid edges are visible to each other, dotted edges block visibility. This figure demonstrates interaction between nodes during model estimation (left), label propagation (center), and paradigm projection (right). Attribute-value vectors of the words are shown in angled brackets. The solid edge in the right figure shows the closest attribute paradigm to which the empirical vector is projected. attribute. We posit that ai,w can be estimated from the neighbors N (w) of w as follows: ai,w = tanh (φ(w, v) · θi) × ai,v  (cid:88) v∈N (w)  (1) where, θi ∈ RF is weight vector of the edge fea- tures for estimating attribute ai. ‘·’ represents dot product betwen two vectors. We use tanh as the non- linearity to make sure that ai,w ∈ [−1, 1]. The set of such weights θ ∈ RA×F for all attributes are the model parameters that we learn. Our graph resem- bles the Ising model, which is a lattice model pro- posed for describing intermolecular forces (Ising, 1925), and eq. 1 solves the naive mean field approx- imation of the Ising model (Wang et al., 2007). Intuitively, one can view the node to node mes- sage function from v to w: φ(w, v)·θi×ai,v as either (1) supporting the value ai,v when φ(w, v) · θi > 0; (2) inverting ai,v when φ(w, v) · θi < 0; or (3) dampening or neutering ai,v when φ(w, v) · θi ≈ 0. Returning to our motivation, if w = played and v = playing, a feature indicating the suffix sub- stitution suffix:ed:ing should have a highly nega- tive weight for TENSE:PAST, indicating a change in value. This is because TENSE:PAST = -1 for play- ing, and a negative value of φ(w, v) · θi will push it to positive for played. It should be noted that this framework for con- structing lexicons does not explicitly distinguish between morpho-syntactic paradigms, but simply identifies all possible attribute-values a word can If we consider an example like “games” take. and two attributes, the syntactic part-of-speech, POS, and number, NUM, games can either be 1) {POS:VERB, NUM:SING}, as in John games the system; or {POS:NOUN, NUM:PLUR}, as in The games have started. Our framework will mereley return that all the above attribute-values are possi- ble, which implies that the singluar noun and plu- ral verb interpretations are valid. One possible way to account for this is to make full morphological paradigms the “attributes” in or model. But this leads to slower runtimes and sparser learning. We leave as future work extensions to full paradigm pre- diction. Our framework has three critical components, each described below: (1) model estimation, i.e., learning θ; (2) label propagation to U; and option- ally (3) paradigm projection to known valid morpho- logical paradigms. The overall procedure is illus- trated in Figure 2 and made concrete in Algorithm 1. 3.1 Model Estimation We estimate all individual elements of an attribute vector using eq. 1. We define loss as the squared loss between the empirical and observed attribute vectors <1, -1, …, -1><0, 0, …, 0><0.2, 0.1, …, 0.9><1, -1, …, -1><0.2, 0.1, …, 0.9><-1, -1, …, -1><1, 1, …, 1><1, -1, …, 1><1, 1, …, -1> Data: W, L, U, A, F, P Result: θ, labeled U // model estimation for w ∈ L do 1 while not convergence do 2 loss ← (cid:107)aw − aw(cid:107)2 3 2 Update θ using ∂loss 4 ∂θ // label propagation 5 while not convergence do 6 7 for w ∈ U do aw ← aw mindist ← ∞, closest ← ∅ for p ∈ P do // paradigm projection 8 for w ∈ U do 9 10 11 12 13 mindist ← dist, closest ← p dist ← (cid:107)aw − p(cid:107)2 if dist < mindist then 2 14 aw ← closest Algorithm 1: Graph-based semi-supervised label propagation algorithm. on every labeled node in the graph, thus the total loss can be computed as:(cid:88) w∈L (cid:107)aw − aw(cid:107)2 2 (2) We train the edge feature weights θ by minimiz- ing the loss function in eq. 2. In this step, we only use labeled nodes and the edge connections between labeled nodes. As such, this is strictly a supervised learning setup. We minimize the loss function using online adaptive gradient descent (Duchi et al., 2011) with (cid:96)2 regularization on the feature weights θ. This is the first step in Algorithm 1 (lines 1–4). 3.2 Label Propagation In the second step, we use the learned weights of the edge features to estimate the attribute val- ues over unlabeled nodes iteratively. The attribute vector of all unlabeled words is initialized to null, ∀w ∈ U, aw = (cid:104)0, 0, . . . , 0(cid:105). In every iteration, an unlabeled node estimates its empirical attributes by looking at the corresponding attributes of its labeled and unlabeled neighbors using eq. 1, thus this is the semi-supervised step. We stop after the squared euclidean distance between the attribute vectors at two consecutive iterations for a node becomes less than 0.1 (averaged over all unlabeled nodes). This is the second step in Algorithm 1 (lines 5–7). After convergence, we can directly obtain attributes for a word by thresholding: a word w is said to possess an attribute ai if ai,w > 0. 3.3 Paradigm Projection Since a word can be labeled with multiple lexical at- tributes, this is a multi-label classification problem. For such a task, several advanced methods that take into account the correlation between attributes have been proposed (Ghamrawi and McCallum, 2005; Tsoumakas and Katakis, 2006; Furnkranz et al., 2008; Read et al., 2011), here we have adopted the binary relevance method which trains a classi- fier for every attribute independently of the other at- tributes, for its simplicity (Godbole and Sarawagi, 2004; Zhang and Zhou, 2005). However, as the decision for the presence of an attribute over a word is independent of all the other attributes, the final set of attributes obtained for a word in §3.2 might not be a valid paradigm.6 For ex- ample, a word cannot only exhibit the two attributes POS:NOUN and TENSE:PAST, since the presence of the tense attribute implies POS:VERB should also be true. Further, we want to utilize the inherent correlations between attribute labels to obtain bet- ter solutions. We thus present an alternative, simpler method to account for this problem. To ensure that we obtain a valid attribute paradigm, we project the empirical attribute vector obtained after propagation to the space of all valid paradigms. We first collect all observed and thus valid at- tribute paradigms from the seed lexicon (P = {aww ∈ L}). We replace the empirical at- tribute vector obtained in §3.2 by a valid attribute paradigm vector which is nearest to it according to euclidean distance. This projection step is inspired from the decoding step in label-space transforma- tion approaches to multilabel classification (Hsu et al., 2009; Ferng and Lin, 2011; Zhang and Schnei- der, 2011). This is the last step in Algorithm 1 (lines 8–14). We investigate for each language if paradigm 6A paradigm is defined as a set of attributes. L (k) 3.4 8.1 6.9 58.5 5.9 4.1 14.4 3.9 1.9 8.5 4.8 W (k) 130 309 253 507 259 1,006 372 358 451 510 305 E (m) 13 27 26 51 26 100 30 26 25 28 26 A 83 57 51 122 61 50 100 40 85 52 41 P Prop (k) 118 285 251 403 246 976 251 236 245 239 268 811 53 862 4,789 352 412 2,025 409 490 568 265 eu bg hr cs da en fi el hu it sv Table 2: Graph statistics for different languages, showing the approximate number of labeled seed nodes (L), la- beled and unlabeled nodes (W), edges between words (E), the number of unique attributes (A), attribute paradigms (P) and size of the constructed lexicon (Prop). k: thousands, m: millions. projection is helpful (§4.1). Intrinsic Evaluation 4 To ascertain how our graph-propagation framework predicts morphological attributes for words, we pro- vide an intrinsic evaluation where we compare pre- dicted attributes to gold lexicons that have been ei- ther read off from a treebank or derived manually. 4.1 Dependency Treebank Lexicons The universal dependency treebank (McDonald et al., 2013; De Marneffe et al., 2014; Agi´c et al., 2015) contains dependency annotations for sentences and morpho-syntactic annotations for words in context for a number of languages.7 A word can display dif- ferent attributes depending on its role in a sentence. In order to create morpho-syntactic lexicon for ev- ery language, we take the union of all the attributes that the word realizes in the entire treebank. Al- though, it is possible that this lexicon might not con- tain all realizable attributes if a particular attribute or paradigm is not seen in the treebank (we address this issue in §4.2). The utility of evaluating against treebank derived lexicons is that it allows us to eval- uate on a large set of languages. In particular, in the universal dependency treebanks v1.1 (Agi´c et al., 7We use version 1.1 released in May 2015. 2015), 11 diverse languages contain the morphology layer, including Romance, Germanic and Slavic lan- guages plus isolates like Basque and Greek. We use the train/dev/test set of the treebank to cre- ate training (seed),8 development and test lexicons for each language. We exclude words from the dev and test lexicon that have been seen in seed lexicon. For every language, we create a graph with the fea- tures described in §2 with words in the seed lexicon as labeled nodes. The words from development and test set are included as unlabeled nodes for the prop- agation stage.9 Table 2 shows statistics about the constructed graph for different languages.10 We perform feature selection and hyperparame- ter tuning by optimizing prediction on words in the development lexicon and then report results on the test lexicon. The decision whether paradigm projec- tion (§3.3) is useful or not is also taken by tuning performance on the development lexicon. Table 3 shows the features that were selected for each lan- guage. Now, for every word in the test lexicon we obtain predicted lexical attributes from the graph. For a given attribute, we count the number of words for which it was correctly predicted (true positive), wrongly predicted (false positive) and not predicted (false negative). Aggregating these counts over all attributes (A), we compute the micro-averaged F1 score and achieve 74.3% on an average across 11 languages (cf. Table 4). Note that this systemati- cally underestimates performance due to the effect of missing attributes/paradigms that were not ob- served in the treebank. Propagated Lexicons. The last column in Table 2 shows the number of words in the propagated lexi- con, and the first column shows the number of words in the seed lexicon. The ratio of the size of propa- gated and seed lexicon is different across languages, which presumably depends on how densely con- nected each language’s graph is. For example, for 8We only include those words in the seed lexicon that occur at least twice in the training set of the treebank. 9Words from the news corpus used for word clustering are also used as unlabeled nodes. 10Note that the size of the constructed lexicon (cf. Table 2) is always less than or equal to the total number of unlabeled nodes in the graph because some unlabeled nodes are not able to collect enough mass for acquiring an attribute i.e, ∀a ∈ A : aw < 0 and thus they remain unlabeled (cf. §3.2). Clus Suffix Prefix MorphTrans Proj (cid:88) eu (cid:88) bg (cid:88) (cid:88) hr (cid:88) cs da (cid:88) en (cid:88) (cid:88) fi (cid:88) el hu (cid:88) (cid:88) it sv (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) Table 3: Features selected and the decision of paradigm projection (Proj) tuned on the development lexicon for each language. (cid:88)denotes a selected feature. English the propagated lexicon is around 240 times larger than the seed lexicon, whereas for Czech, its 8 times larger. We can individually tune how densely connected graph we want for each language depend- ing on the seed size and feature sparsity, which we leave for future work. Selected Edge Features. The features most fre- quently selected across all the languages are the word cluster and the surface morphological transfor- mation features. This essentially translates to hav- ing a graph that consists of small connected com- ponents of words having the same lemma (discov- ered in an unsupervised manner) with semantic links connecting such components using word cluster fea- tures. Suffix features are useful for highly inflected languages like Czech and Greek, while the prefix feature is only useful for Czech. Overall, the se- lected edge features for different languages corre- spond well to the morphological structure of these languages (Dryer, 2013). Corpus Baseline. We compare our results to a corpus-based method of obtaining morpho-syntactic lexicons. We hypothesize that if we use a morpho- logical tagger of reasonable quality to tag the entire wikipedia corpus of a language and take the union of all the attributes for a word type across all its occur- rences in the corpus, then we can acquire all possible attributes for a given word. Hence, producing a lex- icon of reasonable quality. Moore (2015) used this technique to obtain a high quality tag dictionary for words Corpus Propagation 57.5 3409 73.6 2453 71.6 1054 14532 80.8 78.1 1059 72.0 3142 2481 68.2 82.4 1093 70.9 1004 81.7 1244 3134 80.7 74.3 3146 54.0 66.4 69.7 79.1 68.2 57.2 58.2 72.2 64.9 78.8 69.8 67.1 eu bg hr cs da en fi el hu it sv avg. Table 4: Micro-averaged F1 score (%) for prediction of lexical attributes on the test set using our propagation algorithm (Propagation) and the corpus-based baseline (Corpus). Also, shown are the no. of words in test set. words 115,218 39,856 135,386 96,820 F1 87.5 71.9 79.7 79.7 cs fi hu avg. Table 5: Micro-averaged F1 score (%) for prediction of lexical attributes on the test lexicon of human-curated lexicons. POS-tagging. We thus train a morphological tagger (detail in §5.1) on the training portion of the depen- dency treebank and use it to tag the entire wikipedia corpus. For every word, we add an attribute to the lexicon if it has been seen at least k times for the word in the corpus, where k ∈ [2, 20]. This thresh- old on the frequency of the word-attribute pair helps prevent noisy judgements. We tune k for each lan- guage on the development set and report results on the test set in Table 4. We call this method the Cor- pus baseline. It can be seen that for every language we outperform this baseline, which on average has an F1 score of 67.1%. 4.2 Manually Curated Lexicons We have now showed that its possible to automat- ically construct large lexicons from smaller seed lexicons. However, the seed lexicons used in §4.1 have been artifically constructed from aggregating attributes of word types over the treebank. Thus, it word lowercase(word) {1,2,3}-g suffix∗ {1,2,3}-g prefix∗ exchange cluster∗ capitalization digit punctuation Table 6: Features used to train the morphological tagger on the universal dependency treebank. ∗:on for word off- sets {-2, -1, 0, 1, 2}. Conjunctions of the above are also included. can be argued that these constructed lexicons might not be complete i.e, the lexicon might not exhibit all possible attributes for a given word. On the other hand, manually curated lexicons are unavailable for many languages, inhibiting proper evaluation. To test the utility of our approach on manually cu- rated lexicons, we investigate publicly available lex- icons for Finnish (Pirinen, 2011), Czech (Hajic and Hladk´a, 1998) and Hungarian (Tr´on et al., 2006). We eliminate numbers and punctuation from all lex- icons. For each of these languages, we select 10000 words for training and the rest of the word types for evaluation. We train models obtained in §4.1 for a given language using suffix, brown and morpholog- ical transformation features with paradigm projec- tion. The only difference is the source of the seed lexicon and test set. Results are reported in Table 5 averaged over 10 different randomly selected seed set for every language. For each language we ob- tain more than 70% F1 score and on an average ob- tain 79.7%. Critically, the F1 score on human cu- rated lexicons is higher for each language than the treebank constructed lexicons, in some cases as high as 9% absolute. This shows that the average 74.3% F1 score across all 11 languages is likely underesti- mated. 5 Extrinsic Evaluation We now show that the automatically generated lex- icons provide informative features that are useful in two downstream NLP tasks: morphological tagging (§5.1) and syntactic dependency parsing (§5.2). 5.1 Morphological Tagging Morphological tagging is the task of assigning a morphological reading to a token in context. The morphological reading consists of features such as part of speech, case, gender, person, tense etc. None Seed Propagation 85.2 84.1 95.9 94.2 93.2 92.5 96.8 97.1 97.3 96.4 94.8 94.4 94.0 92.8 94.2 93.4 93.5 91.7 97.1 96.8 95.4 96.5 94.5 93.5 84.4 94.6 93.6 97.1 97.1 94.7 93.6 94.6 92.3 97.1 96.5 94.2 eu bg hr cs da en fi el hu it sv avg. Table 7: Macro-averaged F1 score (%) for morphologi- cal tagging: without using any lexicon (None), with seed lexicon (Seed), with propagated lexicon (Propagation). (Oflazer and Kuruoz, 1994; Hajic and Hladk´a, 1998). The model we use is a standard atomic se- quence classifier, that classifies the morphological bundle for each word independent of the others (with the exception of features derived from these words). Specifically, we use a linear SVM model classifier with hand tuned features. This is similar to com- monly used analyzers like SVMTagger (Gim´enez and Marquez, 2004) and MateTagger (Bohnet and Nivre, 2012). Our taggers are trained in a language independent manner (Hajic, 2000; Smith et al., 2005; Muller et al., 2013). The list of features used in training the tagger are listed in Table 6. In addition to the stan- dard features, we use the morpho-syntactic attributes present in the lexicon for every word as features in the tagger. As shown in Muller and Schuetze (2015), this is typically the most important feature for mor- phological tagging, even more useful than clusters or word embeddings. While predicting the contex- tual morphological tags for a given word, the mor- phological attributes present in the lexicon for the current word, the previous word and the next word are used as features. We use the same 11 languages from the univer- sal dependency treebanks (Agi´c et al., 2015) that contain morphological tags to train and evaluate the morphological taggers. We use the pre-specified train/dev/test splits that come with the data. Ta- ble 7 shows the macro-averaged F1 score over all None Seed Propagation 62.9 60.5 79.3 78.3 74.7 72.8 78.3 78.4 70.1 67.5 74.4 74.4 67.9 66.1 75.8 75.0 71.1 67.6 83.1 82.4 69.7 70.1 73.5 72.0 62.3 78.8 74.7 78.4 69.4 74.1 67.4 75.6 69.0 82.8 70.1 73.0 eu bg hr cs da en fi el hu it sv avg. Table 8: Labeled accuracy score (LAS, %) for depen- dency parsing: without using any lexicon (None), with seed (Seed), with propagated lexicon (Propagation). attributes for each language on the test lexicon. The three columns show the F1 score of the tagger when no lexicon is used; when the seed lexicon derived from the training data is used; and when label prop- agation is applied. Overall, using lexicons provides a significant im- provement in accuracy, even when just using the seed lexicon. For 9 out of 11 languages, the high- est accuracy is obtained using the lexicon derived from graph propagation. In some cases the gain is quite substantial, e.g., 94.6% → 95.9% for Bulgar- ian. Overall there is 1.0% and 0.3% absolute im- provement over the baseline and seed resp., which corresponds roughly to a 15% and 5% relative re- duction in error. It is not surprising that the seed lexicon performs on par with the derived lexicon for some languages, as it is derived from the train- ing corpus, which likely contains the most frequent words of the language. 5.2 Dependency Parsing We train dependency parsers for the same 11 uni- versal dependency treebanks that contain the mor- phological layer (Agi´c et al., 2015). We again use the supplied train/dev/test split of the dependency treebank to develop the models. Our parsing model is the transition-based parsing system of Zhang and Nivre (2011) with identical features and a beam of size 8. We augment the features of Zhang and Nivre Figure 3: Micro-average F1 score on test lexicon while using varying seed sizes for cs, hu and fi. (2011) in two ways: using the context-independent morphological attributes present in the different lex- icons; and using the corresponding morphological taggers from §5.1 to generate context-dependent at- tributes. For each of the above two kinds of features, we fire the attributes for the word on top of the stack and the two words on at the front of the buffer. Ad- ditionally we take the cross product of these features between the word on the top of the stack and at the front of the buffer. Table 8 shows the labeled accuracy score (LAS) for all languages. Overall, the generated lexicon gives an improvement of absolute 1.5% point over the baseline (5.3% relative reduction in error) and 0.5% over the seed lexicon on an average across 11 languages. Critically this improvement holds for 10/11 languages over the baseline and 8/11 lan- guages over the system that uses seed lexicon only. 6 Further Analysis In this section we further investigate our model and results in detail. Size of seed lexicon. We first test how the size of the seed lexicon affects performance of attribute prediction on the test set. We use the manually constructed lexicons described in §4.2 for experi- ments. For each language, instead of using the full seed lexicon of 10000 words, we construct sub- sets of this lexicon by taking 1000 and 5000 ran- domly sampled words. We then train models ob- tained in §4.1 on these lexicons and plot the perfor- mance on the test set in Figure 3. On average across Attributes POS:Verb, VForm:Fin, Mood:Ind, Tense:Pres, Num:Sing, POS:Noun POS:Verb, VForm:Fin, Mood:Ind, Tense:Past, VForm:Part POS:Verb, VForm:Fin, Mood:Ind, Tense:Past, VForm:Part, Voice:Pass Word study (seed) studied taught tavola (seed) POS:Noun, Gender:Fem, Num:Sing POS:Noun, Gender:Masc, Num:Plur tavoli divano POS:Noun, Gender:Masc, Num:Sing en it Table 9: Attributes induced for words which are semantically or syntactically related to a word in the seed lexicon for English and Italian. VFORM:GER Clus:105 Clus:77 Clus:44 suffix:ing:{null} suffix:ping:{null} suffix:ing:er NUM:PLUR + Clus:19 + Clus:97 + Clus:177 - - - suffix:ies:y suffix:gs:g suffix:ons:on + + + - - - Table 10: Highest (upper half) and lowest (lower half) weighted features (with their sign) for predicting a given attribute of English words. three languages, we observe that the absolute perfor- mance improvement from 1000 to 5000 seed words is ≈10% whereas it reduces to ≈2% from 5000 to 10000 words. Feature analysis. Table 10 shows the highest and the lowest weighted features for predicting a given attribute of English words. The highest weighted features for both VFORM:GER and NUM:PLUR are word clusters, indicating that word clusters exhibit strong syntactic and semantic coherence. More interestingly, it can be seen that for predicting VFORM:GER i.e, continuous verb forms, the lowest weighted features are those morphological transfor- mations that substitute “ing” with something else. Thus, if there exists an edge between the words studying and study, containing the feature: suf- fix:ing:{null}, the model would correctly predict that studying is VFORM:GER as study is not so and the negative feature weight can flip the label values. The same observation holds true for NUM:PLUR. Feature ablation. One key question is which of the features in our graph are important for project- ing morphological attribute-values. Table 3 suggests that this is language specific, which is intuitive, as cs 87.5 S + C + MT S + C 86.5 S + MT 85.7 C + MT 75.7 S + C + MT + P 86.7 hu 79.9 78.8 77.0 57.4 66.0 fi 71.6 68.2 68.7 62.2 61.3 Table 11: Feature ablation study for induced lexicons evaluated on manually curated gold lexicons. Reported scores are micro-averaged F1 score (%) for prediction of lexical attributes. S = suffix; P = prefix; C = clusters; and MT = morphological transformations. morphology can be represented more or less regu- larly through the surface form depending on the lan- guage. To understand this, we did a feature ablation study for the three languages with manually curated lexicons (§4.2) using the same feature set as before: clusters, suffix and morphological transformations with paradigm projection. We then leave out each feature to measure how performance drops. Unlike §4.2, we do not average over 10 runs but use a sin- gle static graph where features (edges) are added or removed as necessary. Table 11 contains the results. Critically, all fea- tures are required for top accuracy across all lan- guages and leaving out suffix features has the most detrimental effect. This is not surprising considering all three language primarily express morphological properties via suffixes. Furthermore, suffix features help to connect the graph and assist label propaga- tion. Note that the importance of suffix features here is in contrast to the evaluation on treebank derived lexicons in §4.1, where suffix features were only se- lected for 4 out of 11 languages based on the devel- opment data (Table 3), and not for Hungarian and Finnish. This could be due to the nature of the lex- icons derived from treebanks versus complete lexi- cons constructed by humans. Additionally, we also added back prefix features and found that for all languages, this resulted in a drop in accuracy, particularly for Finnish and Hun- garian. The primary reason for this is that prefix fea- tures often create spurious edges in the graph. This in and of itself is not a problem for our model, as the edge weights should learn to discount this feature. However, the fact that we sample edges to make in- ference tractable means that more informative edges could be dropped in favor of those that are only con- nected via a prefix features. Prediction examples. Table 9 shows examples of predictions made by our model for English and Ital- ian. For each language, we first select a random word from the seed lexicon, then we pick one syn- tactic and one semantically related word to the se- lected word from the set of unlabeled words. For e.g., in Italian tavola means table, whereas tavoli is the plural form and divano means sofa. We correctly identify attributes for these words. 7 Related Work We now review the areas of related work. Lexicon generation. Eskander et al. (2013) con- struct morpho-syntactic lexicons by incrementally merging inflectional classes with shared morpholog- ical features. Natural language lexicons have often been created from smaller seed lexcions using var- ious methods. Thelen and Riloff (2002) use pat- terns extracted over a large corpus to learn semantic lexicons from smaller seed lexicons using bootstrap- ping. Alfonseca et al. (2010) use distributional simi- larity scores across instances to propagate attributes using random walks over a graph. Das and Smith (2012) learn potential semantic frames for unknown predicates by expanding a seed frame lexicon. Sen- timent lexicons containing semantic polarity labels for words and phrases have been created using boot- strapping and graph-based learning (Banea et al., 2008; Mohammad et al., 2009; Velikovich et al., 2010; Takamura et al., 2007; Lu et al., 2011). Graph-based learning. In general, graph-based semi-supervised learning is heavily used in NLP (Talukdar and Cohen, 2013; Subramanya and Taluk- dar, 2014). Graph-based learning has been used for class-instance acquisition (Talukdar and Pereira, 2010), text classification (Subramanya and Bilmes, 2008), summarization (Erkan and Radev, 2004), structured prediction problems (Subramanya et al., 2010; Das and Petrov, 2011; Garrette et al., 2013) etc. Our work differs from most of these approaches in that we specifically learn how different features shared between the nodes can correspond to either the propagation of an attribute or an inversion of the attribute value (cf. equ 1). In terms of the ca- pability of inverting an attribute value, our method is close to Goldberg et al. (2007), who present a framework to include dissimilarity between nodes and Talukdar et al. (2012), who learn which edges can be excluded for label propagation. In terms of featurizing the edges, our work resembles previous work which measured similarity between nodes in terms of similarity between the feature types that they share (Muthukrishnan et al., 2011; Saluja and Navr´atil, 2013). Our work is also related to graph- based metric learning, where the objective is to learn a suitable distance metric between the nodes of a graph for solving a given problem (Weinberger et al., 2005; Dhillon et al., 2012). Morphology. High morphological complexity ex- acerbates the problem of feature sparsity in many NLP applications and leads to poor estimation of model parameters, emphasizing the need of mor- phological analysis. Morphological analysis en- compasses fields like morphological segmentation (Creutz and Lagus, 2007; Demberg, 2007; Snyder and Barzilay, 2008; Poon et al., 2009; Narasimhan et al., 2015), and inflection generation (Yarowsky and Wicentowski, 2000; Wicentowski, 2004). Such models of segmentation and inflection generation are used to better understand the meaning and re- lations between words. Our task is complementary to the task of morphological paradigm generation. Paradigm generation requires generating all possible morphological forms of a given base-form according to different linguistic transformations (Dreyer and Eisner, 2011; Durrett and DeNero, 2013; Ahlberg et al., 2014; Ahlberg et al., 2015; Nicolai et al., 2015; Faruqui et al., 2016), whereas our task requires iden- tifying linguistic transformations between two dif- ferent word forms. Low-resourced languages. Our algorithm can be used to generate morpho-syntactic lexicons for low- resourced languages, where the seed lexicon can be constructed, for example, using crowdsourcing (Callison-Burch and Dredze, 2010; Irvine and Kle- mentiev, 2010). Morpho-syntactic resources have been developed for east-european languages like Slovene (Dzeroski et al., 2000; Erjavec, 2004), Bulgarian (Simov et al., 2004) and highly agglu- tinative languages like Turkish (Sak et al., 2008). Morpho-syntactic lexicons are crucial components in acousting modeling and automatic speech recog- nition, where they have been developed for low- resourced languages (Huet et al., 2008; Besacier et al., 2014). One alternative method to extract morphosyntac- tic lexicons is via parallel data (Das and Petrov, 2011). However, such methods assume that both the source and target langauges are isomorphic with respect to morphology. This can be the case with attributes like coarse part-of-speech or case, but is rarely true for other attributes like gender, which is very language specific. 8 Future Work There are three major ways in which the current model can be possibly improved. Joint learning and propagation. In the current model, we are first learning the weights in a su- pervised manner (§3.1) and then propagating labels across nodes in a semi-supervised step with fixed feature weights (§3.2). These can also be performed jointly: perform one iteration of weight learning, propagate labels using these weights, perform an- other iteration of weight learning assuming empir- ical labels as gold labels and continue to learn and propagate until convergence. This joint learning would be slower than the current approach as prop- agating labels across the graph is an expensive step. Multi-label classifcation. We are currently using the binary relevance method which trains a binary classifier for every attribute independently (Godbole and Sarawagi, 2004; Zhang and Zhou, 2005) with paradigm projection as a post-processing step (§3.3). Thus we are accounting for attribute correlations only at the end. We can instead model such cor- relations as constraints during the learning step to obtain better solutions (Ghamrawi and McCallum, 2005; Tsoumakas and Katakis, 2006; Furnkranz et al., 2008; Read et al., 2011). Richer feature set. In addition our model can ben- efit from a richer set of features. Word embeddings can be used to connect word node which are similar in meaning (Mikolov et al., 2013). We can use ex- isting morphological segmentation tools to discover the morpheme and inflections of a word to connect it to word with similar inflections which might be bet- ter than the crude suffix or prefix features. We can also use rich lexical resources like Wiktionary11 to extract relations between words that can be encoded on our graph edges. 9 Conclusion We have presented a graph-based semi-supervised method to construct large annotated morpho- syntactic lexicons from small seed lexicons. Our method is language independent and we have con- structed lexicons for 11 different languages. We showed that the lexicons thus constructed help im- prove performance in morphological tagging and de- pendency parsing, when used as features. Acknowledgement This work was performed when the first author was an intern at Google. We thank action editor Alexander Clark, and the three anonymous review- ers for their helpful suggestions in preparing the manuscript. We thank David Talbot for his help in developing the propagation framework and help- ful discussions about evaluation. We thank Avneesh Saluja, Chris Dyer and Partha Pratim Talukdar for their comments on drafts of this paper. References [Agi´c et al.2015] Zeljko Agi´c, Maria Jesus Aranzabe, Aitziber Atutxa, Cristina Bosco, Jinho Choi, Marie- Catherine de Marneffe, Timothy Dozat, Rich´ard Farkas, Jennifer Foster, Filip Ginter, Iakes Goe- naga, Koldo Gojenola, Yoav Goldberg, Jan Hajic, Juha Anders Traerup Johannsen, Jenna Kanerva, 11https://www.wiktionary.org/ Kuokkala, Veronika Laippala, Alessandro Lenci, Kris- ter Lind´en, Nikola Ljubesi´c, Teresa Lynn, Christopher Manning, H´ector Alonso Mart´ınez, Ryan McDonald, Anna Missila, Simonetta Montemagni, Joakim Nivre, Hanna Nurmi, Petya Osenova, Slav Petrov, Jussi Piit- ulainen, Barbara Plank, Prokopis Prokopidis, Sampo Pyysalo, Wolfgang Seeker, Mojgan Seraji, Natalia Sil- veira, Maria Simi, Kiril Simov, Aaron Smith, Reut Tsarfaty, Veronika Vincze, and Daniel Zeman. 2015. Universal dependencies 1.1. LINDAT/CLARIN digi- tal library at Institute of Formal and Applied Linguis- tics, Charles University in Prague. [Ahlberg et al.2014] Malin Ahlberg, Markus Forsberg, and Mans Hulden. 2014. Semi-supervised learning of morphological paradigms and lexicons. In Proc. of EACL. [Ahlberg et al.2015] Malin Ahlberg, Markus Forsberg, 2015. Paradigm classification In Proc. of and Mans Hulden. in supervised learning of morphology. NAACL. [Alfonseca et al.2010] Enrique Alfonseca, Marius Pasca, and Enrique Robledo-Arnuncio. 2010. Acquisition of instance attributes via labeled and related instances. In Proc. of SIGIR. [Arisoy et al.2010] Ebru Arisoy, Murat Sarac¸lar, Brian Roark, and Izhak Shafran. 2010. Syntactic and sub- lexical features for Turkish discriminative language models. In Proc. of ICASSP. [Banea et al.2008] Carmen Banea, Janyce M. Wiebe, and Rada Mihalcea. 2008. A bootstrapping method for building subjectivity lexicons for languages with scarce resources. In Proc. of LREC. [Bengio et al.2006] Yoshua Bengio, Olivier Delalleau, and Nicolas Le Roux. 2006. Label propagation and quadratic criterion. In Semi-Supervised Learning. MIT Press. [Besacier et al.2014] Laurent Besacier, Etienne Barnard, Alexey Karpov, and Tanja Schultz. 2014. Automatic speech recognition for under-resourced languages: A survey. Speech Communication, 56:85–100. [Bohnet and Nivre2012] Bernd Bohnet and Joakim Nivre. 2012. A transition-based system for joint part-of- speech tagging and labeled non-projective dependency parsing. In Proc. of EMNLP. [Callison-Burch and Dredze2010] Chris Callison-Burch and Mark Dredze. 2010. Creating speech and lan- guage data with amazon’s mechanical turk. In Proc. of NAACL Workshop on Creating Speech and Language Data with Amazon’s Mechanical Turk. [Clark2003] Alexander Clark. 2003. Combining dis- tributional and morphological information for part of speech induction. In Proc. of EACL. [Creutz and Lagus2007] Mathias Creutz and Krista La- gus. 2007. Unsupervised models for morpheme seg- mentation and morphology learning. ACM Transac- tions on Speech and Language Processing (TSLP), 4(1):3. [Das and Petrov2011] Dipanjan Das and Slav Petrov. 2011. Unsupervised part-of-speech tagging with bilin- gual graph-based projections. In Proc. of ACL. [Das and Smith2012] Dipanjan Das and Noah A. Smith. 2012. Graph-based lexicon expansion with sparsity- inducing penalties. In Proc. of NAACL. [De Marneffe et al.2014] Marie-Catherine De Marneffe, Timothy Dozat, Natalia Silveira, Katri Haverinen, Filip Ginter, Joakim Nivre, and Christopher D. Man- ning. 2014. Universal stanford dependencies: A cross-linguistic typology. In Proceedings of LREC. [Demberg2007] Vera Demberg. 2007. A language- independent unsupervised model for morphological segmentation. In Proc. of ACL. [Denis and Sagot2009] Pascal Denis and Benoıt Sagot. 2009. Coupling an annotated corpus and a mor- phosyntactic lexicon for state-of-the-art POS tagging with less human effort. In Proc. of PACLIC. [Dhillon et al.2012] Paramveer S. Dhillon, Partha Taluk- dar, and Koby Crammer. 2012. Metric learning for graph-based domain adaptation. In Proc. of COLING. [Dreyer and Eisner2011] Markus Dreyer and Jason Eis- ner. 2011. Discovering morphological paradigms from plain text using a Dirichlet process mixture model. In Proc. of EMNLP. [Dryer2013] Matthew S. Dryer. 2013. Prefixing vs. Suf- fixing in Inflectional Morphology. Max Planck Insti- tute for Evolutionary Anthropology. [Duchi et al.2011] John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive subgradient methods for on- line learning and stochastic optimization. The Journal of Machine Learning Research, 12:2121–2159. [Dukes and Habash2010] Kais Dukes and Nizar Habash. 2010. Morphological annotation of quranic Arabic. In Proc. of LREC. [Durrett and DeNero2013] Greg Durrett and John DeN- ero. 2013. Supervised learning of complete morpho- logical paradigms. In Proc. of NAACL. [Dzeroski et al.2000] Saso Dzeroski, Tomaz Erjavec, and Jakub Zavrel. 2000. Morphosyntactic tagging of Slovene: Evaluating taggers and tagsets. In Proc. of LREC. [Erjavec2004] Tomaz Erjavec. 2004. Multext-east ver- sion 3: Multilingual morphosyntactic specifications, lexicons and corpora. In Proc. of LREC. [Erkan and Radev2004] Gunes Erkan and Dragomir R. Radev. 2004. Lexrank: Graph-based lexical centrality as salience in text summarization. Journal of Artificial Intelligence Research, 22(1):457–479. [Eskander et al.2013] Ramy Eskander, Nizar Habash, and Owen Rambow. 2013. Automatic extraction of mor- phological lexicons from morphologically annotated corpora. In Proc. of EMNLP. [Faruqui and Pad´o2010] Manaal Faruqui and Sebastian Pad´o. 2010. Training and evaluating a German named entity recognizer with semantic generalization. In Proc. of KONVENS. [Faruqui et al.2016] Manaal Faruqui, Yulia Tsvetkov, Graham Neubig, and Chris Dyer. 2016. Morpholog- ical inflection generation using character sequence to sequence learning. arXiv:1104.2086. [Ferng and Lin2011] Chun-Sung Ferng and Hsuan-Tien 2011. Multi-label classification with error- Lin. correcting codes. In Proc. of ACML. [Furnkranz et al.2008] Johannes Eyke Hullermeier, Eneldo Loza Menc´ıa, and Klaus Brinker. 2008. Multilabel classification via calibrated label ranking. Machine learning, 73(2):133–153. Furnkranz, [Garrette et al.2013] Dan Garrette, Jason Mielens, and Ja- son Baldridge. 2013. Real-world semi-supervised learning of POS-taggers for low-resource languages. In Proc. of ACL. [Ghamrawi and McCallum2005] Nadia Ghamrawi and Andrew McCallum. 2005. Collective multi-label clas- sification. In Proc. of CIKM. [Gim´enez and Marquez2004] Jes´us Gim´enez and Llu´ıs Marquez. 2004. Svmtool: A general POS tagger gen- erator based on support vector machines. In Proc. of LREC. [Godbole and Sarawagi2004] Shantanu Godbole and Sunita Sarawagi. 2004. Discriminative methods for multi-labeled classification. In Proc. of KDD. [Goldberg et al.2007] Andrew B. Goldberg, Xiaojin Zhu, and Stephen J. Wright. 2007. Dissimilarity in graph- based semi-supervised classification. In Proc. of AIS- TATS. [Goldberg et al.2009] Yoav Goldberg, Reut Tsarfaty, Meni Adler, and Michael Elhadad. 2009. Enhancing unlexicalized parsing performance using a wide cov- erage lexicon, fuzzy tag-set mapping, and EM-HMM- based lexical probabilities. In Proc. of EACL. [Green and DeNero2012] Spence Green and John DeN- ero. 2012. A class-based agreement model for gen- In Proc. of erating accurately inflected translations. ACL. [Hajic and Hladk´a1998] Jan Hajic and Barbora Hladk´a. 1998. Tagging inflective languages: Prediction of morphological categories for a rich, structured tagset. In Proc. of COLING. [Hajic2000] Jan Hajic. 2000. Morphological tagging: Data vs. dictionaries. In Proc. of NAACL. [Hsu et al.2009] Daniel Hsu, Sham Kakade, John Lang- ford, and Tong Zhang. 2009. Multi-label prediction via compressed sensing. In Proc. of NIPS. [Huet et al.2008] St´ephane Huet, Guillaume Gravier, and Pascale S´ebillot. 2008. Morphosyntactic resources for automatic speech recognition. In Proc. of LREC. [Irvine and Klementiev2010] Ann Irvine and Alexandre Klementiev. 2010. Using mechanical turk to anno- tate lexicons for less commonly used languages. In Proc. of NAACL Workshop on Creating Speech and Language Data with Amazon’s Mechanical Turk. [Ising1925] Ernst Ising. 1925. Beitrag zur theorie des ferromagnetismus. Zeitschrift fur Physik A Hadrons and Nuclei, 31(1):253–258. [Kneser and Ney1993] Reinhard Kneser and Hermann Ney. 1993. Improved clustering techniques for class- based statistical language modelling. In Proc. of Eu- rospeech. [Kokkinakis et al.2000] Dimitrios Kokkinakis, Maria Toporowska-Gronostaj, and Karin Warmenius. 2000. Annotating, disambiguating & automatically extend- ing the coverage of the Swedish SIMPLE lexicon. In Proc. of LREC. [Koo et al.2008] Terry Koo, Xavier Carreras, and Michael Collins. 2008. Simple semi-supervised dependency parsing. In Proc. of ACL. [Kubler et al.2009] Sandra Kubler, Ryan McDonald, and Joakim Nivre. 2009. Dependency parsing. Synthesis Lectures on Human Language Technologies. Morgan & Claypool Publishers. [Lu et al.2011] Yue Lu, Malu Castellanos, Umeshwar Dayal, and ChengXiang Zhai. 2011. Automatic con- struction of a context-aware sentiment lexicon: An op- timization approach. In Proc. of WWW. [Martin et al.1998] Sven Martin, Jorg Liermann, and Her- mann Ney. 1998. Algorithms for bigram and trigram word clustering. Speech communication, 24(1):19–37. [McDonald et al.2013] Ryan McDonald, Joakim Nivre, Yvonne Quirmbach-Brundage, Yoav Goldberg, Di- panjan Das, Kuzman Ganchev, Keith B. Hall, Slav Petrov, Hao Zhang, Oscar Tackstrom, Claudia Bedini, N´uria B. Castell´o, and Jungmee Lee. 2013. Univer- sal dependency annotation for multilingual parsing. In Proc. of ACL. [Mikolov et al.2013] Tomas Mikolov, Wen-tau Yih, and 2013. Linguistic regularities in In Proc. of Geoffrey Zweig. continuous space word representations. NAACL. [Minkov et al.2007] Einat Minkov, Kristina Toutanova, and Hisami Suzuki. 2007. Generating complex mor- phology for machine translation. In Proc. of ACL. [Mohammad et al.2009] Saif Mohammad, Cody Dunne, and Bonnie Dorr. 2009. Generating high-coverage semantic orientation lexicons from overtly marked words and a thesaurus. In Proc. of EMNLP. [Moore2015] Robert Moore. 2015. An improved tag dic- tionary for faster part-of-speech tagging. In Proc. of EMNLP. [Muller and Schuetze2015] Thomas Muller and Hinrich Schuetze. 2015. Robust morphological tagging with word representations. In Proceedings of NAACL. [Muller et al.2013] Thomas Muller, Helmut Schmid, and Hinrich Schutze. 2013. Efficient higher-order CRFs for morphological tagging. In Proc. of EMNLP. [Muthukrishnan et al.2011] Pradeep Muthukrishnan, Dragomir Radev, and Qiaozhu Mei. 2011. Simultane- ous similarity learning and feature-weight learning for document clustering. In Proc. of TextGraphs. [Narasimhan et al.2015] Karthik Narasimhan, Regina Barzilay, and Tommi Jaakkola. 2015. An unsuper- vised method for uncovering morphological chains. Transactions of the Association for Computational Linguistics, 3:157–167. [Nicolai et al.2015] Garrett Nicolai, Colin Cherry, and Grzegorz Kondrak. 2015. Inflection generation as dis- criminative string transduction. In Proc. of NAACL. [Niessen and Ney2004] Sonja Niessen and Hermann Ney. 2004. Statistical machine translation with scarce re- sources using morpho-syntactic information. Compu- tational Linguistics, 30(2). [Oflazer and Kuruoz1994] Kemal Oflazer `Ilker Kuruoz. 1994. Tagging and morphological disam- biguation of Turkish text. In Proc. of ANLP. and Owoputi, [Owoputi et al.2013] Olutobi Brendan O’Connor, Chris Dyer, Kevin Gimpel, Nathan Schneider, and Noah A. Smith. Improved part-of-speech tagging for online conversational text with word clusters. In Proc. of NAACL. 2013. [Pirinen2011] Tommi A Pirinen. 2011. Modularisation of finnish finite-state language description—towards wide collaboration in open source development of a morphological analyser. In Proc. of NODALIDA. [Poon et al.2009] Hoifung Poon, Colin Cherry, and Kristina Toutanova. 2009. Unsupervised morpholog- ical segmentation with log-linear models. In Proc. of NAACL. [Ratnaparkhi1996] Adwait Ratnaparkhi. 1996. A max- In imum entropy model for part-of-speech tagging. Proc. of EMNLP. [Read et al.2011] Jesse Read, Bernhard Pfahringer, Ge- off Holmes, and Eibe Frank. Classifier chains for multi-label classification. Machine Learn- ing, 85(3):333–359. 2011. [Sak et al.2008] Has¸im Sak, Tunga Gungor, and Murat Sarac¸lar. 2008. Turkish language resources: Morpho- logical parser, morphological disambiguator and web corpus. In Proc. of ANLP. [Saluja and Navr´atil2013] Avneesh Jirı Navr´atil. 2013. Graph-based unsupervised learning of word similarities using heterogeneous feature types. In Proc. of TextGraphs. Saluja and [Schmid1994] Helmut Schmid. 1994. Probabilistic part- In Proc. of of-speech tagging using decision trees. the International Conference on New Methods in Lan- guage Processing. [Simov et al.2004] Kiril Ivanov Simov, Petya Osenova, Sia Kolkovska, Elisaveta Balabanova, and Dimitar Doikoff. 2004. A language resources infrastructure for Bulgarian. In Proc. of LREC. [Smith et al.2005] Noah A. Smith, David A. Smith, and Roy W. Tromble. 2005. Context-based morpholog- In Proc. of ical disambiguation with random fields. EMNLP. [Snyder and Barzilay2008] Benjamin Snyder and Regina Barzilay. 2008. Unsupervised multilingual learning for morphological segmentation. In Proc. of ACL. [Soricut and Och2015] Radu Soricut and Franz Och. 2015. Unsupervised morphology induction using word embeddings. In Proc. of NAACL. [Subramanya and Bilmes2008] Amarnag Subramanya and Jeff Bilmes. 2008. Soft-supervised learning for text classification. In Proc. of EMNLP. [Subramanya and Talukdar2014] Amarnag Subramanya 2014. Graph-based Synthesis Lectures on and Partha Pratim Talukdar. semi-supervised learning. Artificial Intelligence and Machine Learning, 8(4). [Subramanya et al.2010] Amarnag Subramanya, Slav Petrov, and Fernando Pereira. 2010. Efficient graph- based semi-supervised learning of structured tagging models. In Proc. of EMNLP. [Tackstrom et al.2012] Oscar Tackstrom, Ryan McDon- ald, and Jakob Uszkoreit. 2012. Cross-lingual word clusters for direct transfer of linguistic structure. In Proc. of NAACL. [Takamura et al.2007] Hiroya Takamura, Takashi Inui, and Manabu Okumura. 2007. Extracting semantic In Proc. of orientations of phrases from dictionary. NAACL. [Talukdar and Cohen2013] Partha Pratim Talukdar and William Cohen. 2013. Scaling graph-based semi- supervised learning to large number of labels using count-min sketch. In Proc. of AISTATS. [Talukdar and Pereira2010] Partha Pratim Talukdar and Fernando Pereira. 2010. Experiments in graph-based semi-supervised learning methods for class-instance acquisition. In Proc. of ACL. [Talukdar et al.2012] Partha Pratim Talukdar, Derry Wi- jaya, and Tom Mitchell. 2012. Acquiring temporal constraints between relations. In Proc. of CIKM. [Thelen and Riloff2002] Michael Thelen and Ellen Riloff. 2002. A bootstrapping method for learning semantic lexicons using extraction pattern contexts. In Proc. of ACL. [Tr´on et al.2006] Viktor Tr´on, P´eter Hal´acsy, P´eter Re- brus, Andr´as Rung, P´eter Vajda, and Eszter Simon. 2006. Morphdb.hu: Hungarian lexical database and morphological grammar. In Proc. of LREC. [Tsoumakas and Katakis2006] Grigorios Tsoumakas and Ioannis Katakis. 2006. Multi-label classification: An overview. Dept. of Informatics, Aristotle University of Thessaloniki, Greece. [Turian et al.2010] Joseph Turian, Lev Ratinov, and Yoshua Bengio. 2010. Word representations: a simple and general method for semi-supervised learning. In Proc. of ACL. [Uszkoreit and Brants2008] Jakob and Thorsten Brants. 2008. Distributed word clus- tering for large scale class-based language modeling in machine translation. In Proc. of ACL. Uszkoreit [Velikovich et al.2010] Leonid Velikovich, Sasha Blair- Goldensohn, Kerry Hannan, and Ryan McDonald. 2010. The viability of web-derived polarity lexicons. In Proc. of NAACL. [Wang et al.2007] Fei Wang, Shijun Wang, Changshui 2007. Semi-supervised Zhang, and Ole Winther. mean fields. In Proc. of AISTATS. [Weinberger et al.2005] Kilian Q. Weinberger, John Blitzer, and Lawrence K. Saul. 2005. Distance metric learning for large margin nearest neighbor classification. In Proc. of NIPS. [Wicentowski2004] Richard Wicentowski. 2004. Multi- lingual noise-robust supervised morphological analy- sis using the wordframe model. In Proc. of SIGPHON. [Yarowsky and Wicentowski2000] David Yarowsky and Richard Wicentowski. 2000. Minimally supervised morphological analysis by multimodal alignment. In Proc. of ACL. [Zhang and Nivre2011] Yue Zhang and Joakim Nivre. 2011. Transition-based dependency parsing with rich non-local features. In Proc. of ACL. [Zhang and Schneider2011] Yi Zhang and Jeff G. Schnei- der. 2011. Multi-label output codes using canonical correlation analysis. In Proc. of AISTATS. [Zhang and Zhou2005] Min-Ling Zhang and Zhi-Hua Zhou. 2005. A k-nearest neighbor based algorithm for multi-label classification. In Proc. of IEEE Con- ference on Granular Computing. [Zhu2005] Xiaojin Zhu. 2005. Semi-supervised Learning with Graphs. Ph.D. thesis, Carnegie Mellon Univer- sity, Pittsburgh, PA, USA. AAI3179046.
1808.09891
3
1808
2018-09-03T14:23:37
A Quantum Many-body Wave Function Inspired Language Modeling Approach
[ "cs.CL" ]
The recently proposed quantum language model (QLM) aimed at a principled approach to modeling term dependency by applying the quantum probability theory. The latest development for a more effective QLM has adopted word embeddings as a kind of global dependency information and integrated the quantum-inspired idea in a neural network architecture. While these quantum-inspired LMs are theoretically more general and also practically effective, they have two major limitations. First, they have not taken into account the interaction among words with multiple meanings, which is common and important in understanding natural language text. Second, the integration of the quantum-inspired LM with the neural network was mainly for effective training of parameters, yet lacking a theoretical foundation accounting for such integration. To address these two issues, in this paper, we propose a Quantum Many-body Wave Function (QMWF) inspired language modeling approach. The QMWF inspired LM can adopt the tensor product to model the aforesaid interaction among words. It also enables us to reveal the inherent necessity of using Convolutional Neural Network (CNN) in QMWF language modeling. Furthermore, our approach delivers a simple algorithm to represent and match text/sentence pairs. Systematic evaluation shows the effectiveness of the proposed QMWF-LM algorithm, in comparison with the state of the art quantum-inspired LMs and a couple of CNN-based methods, on three typical Question Answering (QA) datasets.
cs.CL
cs
A Quantum Many-body Wave Function Inspired Language Modeling Approach Peng Zhang1, Zhan Su1, Lipeng Zhang2, Benyou Wang3, Dawei Song4 ∗ 1 School of Computer Science and Technology, Tianjin University, Tianjin, China 2 School of Computer Software, Tianjin University, Tianjin, China 3 Department of Information Engineering, University of Padova, Padova, Italy 4 School of Computer Science and Technology, Beijing Institute of Technology, Beijing, China {pzhang,suzhan,lpzhang}@tju.edu.cn [email protected];[email protected] 8 1 0 2 p e S 3 ] L C . s c [ 3 v 1 9 8 9 0 . 8 0 8 1 : v i X r a ABSTRACT The recently proposed quantum language model (QLM) aimed at a principled approach to modeling term dependency by applying the quantum probability theory. The latest development for a more effective QLM has adopted word embeddings as a kind of global dependency information and integrated the quantum-inspired idea in a neural network architecture. While these quantum-inspired LMs are theoretically more general and also practically effective, they have two major limitations. First, they have not taken into ac- count the interaction among words with multiple meanings, which is common and important in understanding natural language text. Second, the integration of the quantum-inspired LM with the neu- ral network was mainly for effective training of parameters, yet lacking a theoretical foundation accounting for such integration. To address these two issues, in this paper, we propose a Quantum Many-body Wave Function (QMWF) inspired language modeling approach. The QMWF inspired LM can adopt the tensor product to model the aforesaid interaction among words. It also enables us to reveal the inherent necessity of using Convolutional Neu- ral Network (CNN) in QMWF language modeling. Furthermore, our approach delivers a simple algorithm to represent and match text/sentence pairs. Systematic evaluation shows the effectiveness of the proposed QMWF-LM algorithm, in comparison with the state of the art quantum-inspired LMs and a couple of CNN-based methods, on three typical Question Answering (QA) datasets. KEYWORDS Language modeling, quantum many-body wave function, convolu- tional neural network ACM Reference Format: Peng Zhang1, Zhan Su1, Lipeng Zhang2, Benyou Wang3, Dawei Song4 . 2018. A Quantum Many-body Wave Function Inspired, Language Modeling Approach. In The 27th ACM International Conference on Information and ∗Corresponding authors: P. Zhang and D. Song. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. CIKM '18, October 22 -- 26, 2018, Torino, Italy © 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-6014-2/18/10...$15.00 https://doi.org/10.1145/3269206.3271723 Knowledge Management (CIKM '18), October 22 -- 26, 2018, Torino, Italy. ACM, New York, NY, USA, 10 pages. https://doi.org/10.1145/3269206.3271723 1 INTRODUCTION It is essential to model and represent a sequence of words for many Information Retrieval (IR) or Natural Language Processing (NLP) tasks. In general, Language Modeling (LM) approaches utilize proba- bilistic models to measure the uncertainty of a text (e.g., a document, a sentence, or some keywords). Based on different probability mea- sures, there are roughly two different categories of LM approaches, namely traditional LMs [39] based on the classical probability the- ory, and quantum-inspired LMs [31, 40] motivated by the quantum probability theory, which can be considered as a generalization of the classical one [20, 30]. Recently, Sordoni, Nie and Bengio proposed a Quantum Lan- guage Modeling (QLM) approach, which aims to model the term dependency in a more principled manner [31]. In traditional LMs, modeling word dependency will increase the number of parameters to be estimated for compound dependencies (e.g., n-gram LM for IR) [28]), or involve computing additional scores from matching compound dependencies in the final ranking function (e.g., Markov Random Field based LM [21]). To solve these problems, QLM es- timates a density matrix, which has a fixed dimensionality and encodes the probability measurement for both single words and compound words. In addition to its theoretical benefits, QLM has been applied to ad-hoc information retrieval task and achieved effective performance. In order to further improve the practicality of the quantum lan- guage models, a Neural Network based Quantum-like Language Model (NNQLM) was proposed [40]. NNQLM utilizes word embed- ding vectors [22] as the state vectors, based on which a density matrix can be directly derived and integrated into an end-to-end Neural Network (NN) structure. NNQLM has been effectively ap- plied in a Question Answering (QA) task. In NNQLM, a joint repre- sentation based on the density matrices can encode the similarity information of each question-answer pair. A Convolutional Neural Network (CNN) architecture is adopted to extract useful similarity features from such a joint representation and shows a significant improvement over the original QLM on the QA task. Despite the progress in the quantum-inspired LMs from both theoretical and practical perspectives, there are still two major limitations, in terms of the representation capacity and seamless in- tegration with neural networks. First, both QLM and NNQLM have not modeled the complex interaction among words with multiple meanings. For example, suppose we have two polysemous words A and B, in the sense that A has two meanings A1 and A2, while B has two meanings B1 and B2. If we put them together and form a compound word, this compound word will have four possible states (A1B1, A1B2, A2B1, A2B2), each corresponding to a combination of specific meanings of different words. If we have more words, such an interaction will become more complex. However, in QLM and NNQLM, a compound word is modeled as a direct addition of the representation vectors or subspaces of the single words involved. Therefore, it is challenging to build a language modeling mecha- nism which has the representation capacity towards the complex interactions among words as described above. Second, although in NNQLM the neural network structure can help quantum-inspired LM with effective training, the fundamen- tal connection between the quantum-inspired LM and the neural network remains unclear. In other words, the integration of NN and QLM so far has not been in a principled manner. Hence, we need to investigate and explain the intrinsic rationality of neural network in quantum-inspired LM. It is challenging, yet important to bridge quantum-inspired idea, language modeling, and neural network structure together, and develop a novel LM approach with both theoretical soundness and practical effectiveness. In order to address the above two challenges, we propose a new language modeling framework inspired by Quantum Many- body Wave Function (QMWF). In quantum mechanics, the wave function can model the interaction among many spinful particles (or electrons), where each particle is laying on multiple states si- multaneously, and each state corresponds to a basis vector [6, 23]. Therefore, by considering a word as a particle, different meanings (or latent/embedded concepts) as different basis vectors, the interac- tion among words can be modeled by the tensor product of different basis vectors for different words. It is then natural to use such a QMWF formalism to represent the complex interaction system for a sequence of natural language words. In addition, we show that the convolutional neural network ar- chitecture can be mathematically derived in our quantum-inspired language modeling approach. Since the tensor product is performed in QMWF based LM, the dimensionality of the tensor will be expo- nentially increased, yielding a quantum many-body problem. To solve this problem, the tensor decomposition can be used to solve a high-dimensional tensor [18]. With the help of tensor decom- position, the projection of the global representation to the local representation of a word sequence can result in a convolutional neural network architecture. In turn, for the convolutional neural network, it can be interpreted as a mapping form a global semantic space to the local semantic space. Hence, our QMWF inspired Language Modeling (QMWF-LM) approach also delivers a feasible and simple algorithm to represent a text or a sentence and match the text/sentence pairs, in both word-lever and character-level. We implement our approach in the Question Answering task. The experiments have shown that the proposed QMWF-LM can not only outperform its quantum LM counterparts (i.e., QLM and NNQLM), but also achieve better performance in comparison with typical CNN-based approaches on three QA datasets. Our main contributions can be summarized as follows: (1) We propose a Quantum Many-body Wave Function based Language Modeling (QMWF-LM) approach, which is able to represent complex interaction among words, each with multi- ple semantic basis vectors (for multiple meanings/concepts). (2) We show a fundamental connection between QMWF based language modeling approach and the convolutional neural network architecture, in terms of the projection between the global representation to the local one of a word sequence. (3) The proposed QMWF-LM delivers an efficient algorithm to represent and match the text/sentence pairs, in both word- lever and character-level, as well as achieves effective per- formance on a number of QA datasets. 2 QUANTUM PRELIMINARIES In this section, we first describe some basis notations and concepts of the quantum probability theory. Then, we briefly explain the quantum many-body wave function. 2.1 Basic Notations and Concepts The formalism of quantum theory is actually based on vector spaces using Dirac notations. In line with previous studies on the quantum- inspired language models [29, 31, 40], we restrict our problem to vectors spaces over real numbers in R. A wave function in quantum theory is a mathematical descrip- tion of the quantum state of a system. A state vector is denoted by a unit vector ψ⟩ (called as a ket), which can be considered as a column vector (cid:174)ψ ∈ Rn (for better understanding). The transpose of ψ⟩ is denoted as ⟨ψ (called as bra), which is a row vector. The state vector can be considered as a ray in a Hilbert space (i.e., ψ⟩ ∈ H), which has a set of orthonormal basis vectors ei⟩ (i = 1, . . . , n). A state vector ψ⟩ can be a superposition of the basis vectors: n where ai is a probability amplitude and ai ei⟩ ψ⟩ = i =1 2 i repre- sents a probability of the sum to 1. For example, suppose we have a two basis vectors 0⟩ and 1⟩, which can be considered as (1, 0)T and (0, 1)T , respectively. Then, we have a state vector = 1, since a i a 2 i (1) ψ⟩ = a1 0⟩ + a2 1⟩ In Eq. 1, the probability amplitude ai can be calculated by the It means that the corresponding quantum system ψ⟩ is a superposed state, i.e., it is in the two states 0⟩ and 1⟩ simultaneously. In the natural language processing tasks, such a superposed state can be used to model the multiple semantic meanings of a word [3]. inner product ⟨eiψ⟩. The inner product ⟨eiψ⟩ is a projection of ψ⟩ onto ei⟩. As illus- trated in Fig.1, the projection measurement can be formulated as (2) where p(eiψ) denotes the probability of the quantum elementary event ei⟩ 1 given the system ψ⟩. 1More strictly, the outer product of ei ⟩ is called as the quantum elementary event. i = ⟨eiψ⟩2 2 p(eiψ) = a ai = ⟨eiψ⟩ 3 QUANTUM MANY-BODY WAVE FUNCTION INSPIRED LANGUAGE MODELING 3.1 Basic Intuitions and Architecture In Physics, Quantum Many-body Wave Function (QMWF) can model the interaction among many particles and the associated basis vectors. In the language scenario, by considering a word as a particle, different meanings (or latent/embedded concepts) as different basis vectors, the interaction among words (or word meanings) can be modeled by the tensor product of basis vectors, via the many-body wave function. A tensor product of different basis vectors generates a compound meaning for a compound word. Based on such an analogy, QMWF representation can model the probability distribution of compound meanings in natural language. Such a representation depends on basis vectors. The choices of basis vectors can be one-hot vectors (representing single words), or embedding vectors (representing latent meanings or concepts). The probabilities are encoded in a tensor, as we can see from Eq. 3. Each entry in a tensor is the probability amplitude of the compound meaning, or can be considered as a coefficient/weight. As shown in Fig. 2, given a word sequence and a set of basis vectors, there are local and global representations (see details in Section 3.2). Intuitively, the local representation is constructed by the current word sequence (e.g., a sentence), and the global representation corresponds to the information of a large corpora (e.g., a collection of data). In classical language modeling approaches, there are also local and global information, as well as the interplay between them. For example, in n-grams, the probability/statistics of each term can be estimated from the current piece of text (as local information), and also be smoothed with the statistics from a large corpora (as global information). Based on QMWF representation, in Section 3.2.3, we describe the projection from the global representation to the local one. Such projection can model the interplay between the local information and the global one, and enable us to focus on the high-dimensional tensors, which encode the probability distribution of the compound meanings. In Fig. 2, we can observe that, the high-dimensional tensor T can be reduced by the tensor decomposition, the tensors A (for probabilities in local representation) and T (for probabilities in global representation) are kept. Therefore, the projection can also be considered as an interplay between global and local tensors (see Section 3.2.3 for details). The high-dimensional tensor T can be reduced by the tensor decomposition. With the help of the tensor decomposition, the above projection from the global representation (as a global se- mantic space) to the local one can be realized by a convolutional neural network architecture(see Section 3.3). Intuitively, each de- composed subspace of the high-dimensional tensor corresponds to a convolutional channel. Together with a product pooling technique, a CNN architecture can be constructed. Then, an algorithm based on a CNN architecture is revealed based on the above intuitions. 3.2 Language Representation and Projection via Many-body Wave Function 3.2.1 Local Representation by Product State. Suppose we have a word sequence S (e.g., a sentence) with the length N : S = [x1, x2, ..., xN ]. Figure 1: Projection of ψ⟩ on its basis It turns out that the projection measurement based on inner product plays an essential role in the probability measurement, We will further illustrate such a concept in our quantum many-body wave function inspired LM approach. Note that, in a broad sense, the wave function is a state vector ψ⟩. In a narrow sense, the wave function is a projection on a basis, e.g., ψ(x) = ⟨xψ⟩, where x can be a basis ei, and ψ(x) is the probability amplitude. In this paper, we will use the description of wave function in the broad sense. 2.2 Quantum Many-Body Wave Functions What we mentioned above is a single system which corresponds to a single particle in a Hilbert space. A quantum many-body system consists of N particles, each one with a wave function residing in a finite dimensional Hilbert space Hi for i ∈ [N] := {1 . . . N}. We set the dimensions of each Hilbert space Hi for all i, i.e., ∀i : dim(Hi) = M and the orthonormal basis of the Hilbert space as {eh⟩}M h=1. The Hilbert space of a many-body system is a tensor product of the spaces: H := ⊗N i =1Hi, and the corresponding state vector ψ⟩ ∈ H is ψ⟩ = Ah1 ...hN eh1⟩ ⊗ · · · ⊗ ehN ⟩ (3) M h1, ...,hN =1 where eh1⟩ ⊗ · · · ⊗ ehN ⟩ is a basis vector of the M N dimensional Hilbert space H, and Ah1 ...hN is a specific entry in a tensor A hold- ing all the probability amplitude. The tensor A can be considered as N -dimensional array A ∈ RM×···×M . For example, a system includes two spinful particles, which are qubit states superposed as two basis vectors e1⟩ = 0⟩ = (1, 0)T and e2⟩ = 1⟩ = (0, 1)T . Therefore, we can get four basis vectors e1⟩ ⊗ e1⟩ = 00⟩ (abbreviation of 0⟩ ⊗ 0⟩ = (1, 0, 0, 0)T ), 01⟩ = (0, 1, 0, 0)T , 10⟩ = (0, 0, 1, 0)T and 11⟩ = (0, 0, 0, 1)T , and the state ψ of this system can be represented as 2 ψ⟩ = aij ei⟩ ⊗ ej⟩ i, j=1 = a11 00⟩ + a12 01⟩ + a21 10⟩ + a22 11⟩ where aij is a probability amplitude and be considered as a specific entry in a tensor A ∈ R2×2. 2 ij ij a = 1. Each aij can (4) ⟩𝑒𝑒1⟩𝑒𝑒2𝑎𝑎2𝑎𝑎1⟩𝜓𝜓 Figure 2: Outline of quantum many-body wave function inspired language modeling approach M hi =1 M h1, ...,hN =1 For each word xi in S, based on Eq. 1, we define its state vector as: ps where ψ sentence. We can expand the product state ψ S ⟩ is the product state of the QMWF representation of a S ⟩ as follows: ps xi⟩ = αi,hi ϕhi⟩ (5) ψ ps S ⟩ = Ah1 ...hN ϕh1⟩ ⊗ . . . ⊗ ϕhN ⟩ (8) where each basis vector ϕhi⟩ (hi = 1, . . . , M) is corresponding to a specific semantic meaning (or a latent concept), and αi,hi is its associated probability amplitude. Different from the notation αi in Eq. 1, the notation αi,hi in Eq.5 is for the convenience to be represented in a tensor depicted latter. For a better understanding, as an example, the state vectors for words x1 and x2 can be represented by (cid:26) x1⟩ = α1,1 ϕ1⟩ + α1,2 ϕ2⟩ + α1,3 ϕ3⟩ x2⟩ = α2,1 ϕ1⟩ + α2,2 ϕ2⟩ + α2,3 ϕ3⟩ (6) where N = 2, M = 3 and hi is from 1 to 3, i.e., three basis vectors ϕhi⟩ are involved, each corresponding to a word meaning. For the basis vectors ϕhi⟩, there can be different choices, e.g., one-hot vectors or embedded vectors. Different basis vectors yield different interpretations for the semantic meanings. We will adopt the embedding space when we instantiate this framework in the question answering task (see Section 4). If we use such a space, the probability amplitude αi,hi is the feature value (after normalization) of the word xi on the hi Next, we show how to use the tensor product to model the inter- action among word meanings. For a sentence S = [x1, x2, ..., xN ], its wave function can be represented as: th dimension of the embedding space. ψ ps S ⟩ = x1⟩ ⊗ . . . ⊗ xN ⟩ (7) where ϕh1⟩ ⊗ . . . ⊗ ϕhN ⟩ is the new basis vectors with M N dimen- sion, and each new basis vector corresponds a compound meaning by the tensor product of the word meanings ϕhi⟩. A is a M N di- mensional tensor and each entry Ah1 ...hN ) encodes i =1 αi,hi the probability of the corresponding compound meaning. (=N Eq. 8 can represent the interaction among words as we discussed in Introduction. For example, for two words x1 and x2 in Eq. 6, suppose x1 only has two meanings corresponding to the basis vec- tors ϕ1⟩ and ϕ2⟩, while x2 has two meanings corresponding to ϕ2⟩ and ϕ3⟩. Then, A1,3(= α1,1α2,3) represents the probability with the basis vector ϕ1⟩ ⊗ ϕ3⟩. Intuitively, this implies that the underlying meaning (ϕ1⟩) of word x1 and the meaning (ϕ3⟩) of x2 is interacted and form a compound meaning ϕ1⟩ ⊗ ϕ3⟩. Now, we can see that this product state representation is actu- ally a local representation for a word sequence. In other words, given the basis vectors, the probability amplitudes can be estimated from the current word sequence. In fact, A is a rank-1 N -order tensor, which includes only M × N free parameters αi,hi , rather than M N parameters to be estimated. In addition, given only a word sequence, the valid compound meanings are not too many. In summary, this rank-1 tensor actually encodes the local distributions of these compound meanings for the given sentence. 3.2.2 Global Representation for All Possible Compound Meanings. As aforementioned in Section 3.1 , we need a global distribution of all the possible compound meanings, given a set of basis vectors. Intuitively, a global distribution is useful in both classical LM and ൿΨ𝑠𝑝𝑠QMWFRepresentationText SequenceProjectionTensor DecompositionProduct PoolingCNNXConvolutional Neural Network Local RepresentationۧΨ𝑠𝒯=෍𝑟=1𝑅𝑡𝑟∙𝒆𝒓,𝟏⨂𝒆𝒓,𝟐…⨂𝒆𝒓,𝑵Global RepresentationΨ𝑠𝑝𝑠Ψ𝑠ConvConvConv𝒆𝒓,𝟏𝒆𝒓,𝟐𝒆𝒓,𝑵…=෍𝒯ℎ1,…,ℎ𝑁×𝒜ℎ1,…,ℎ𝑁 M h1, ...,hN =1 quantum-inspired LM, since we often have unseen words, word meanings or the compound meanings, in a text. To represent such a global distribution of state vectors, we define a quantum many-body wave function as follows: ψS⟩ = Th1 ...hN ϕh1⟩ ⊗ . . . ⊗ ϕhN ⟩ (9) ps The difference between ψ where ϕh1⟩ ⊗ . . . ⊗ ϕhN ⟩ is the basis state (corresponding to a compound meaning) with M N dimension, and Th1 ...hN is the cor- responding probability amplitude. This wave function represents a semantic meaning space with a sequence of N uncertain words, which does not rely on a specific sentence showed in Eq. 8. The probability amplitudes in tensor T can be trained in a large corpora. S ⟩ in Eq. 8 and ψS⟩ in Eq. 9 is the different tensors A and T . A encodes the local distribution of compound meanings (for the current sentence) and T encodes the global distribution (for a large corpora). Moreover, A is essentially rank-1, while T has a higher rank. In fact, solving T is an intractable problem which is referred as a quantum many-body problem. 3.2.3 Projection from Global to Local Representation. Section 2.1 has emphasized the role of projection in the probability measure- ment. Now, we show the projection of the global semantic repre- sentation ψS⟩ on its product state ψ S ⟩ as a local representation for the given sentence, to calculate the probability amplitudes in the tensor. S ψS⟩. Inspired by a recent work [18], this projection will eliminate the high-dimensional basis vectors of the wave function: Such a projection can be modeled by the inner product ⟨ψ ps ps which reveals the interplay between the global tensor T and local tensor A. This is similar to the idea in the classical LM, where the local statistics in a text will be smoothed by collection statistics. 3.3 Projection Realized by Convolutional Neural Network As shown in Eq. 10, the high-dimensional tensor T is still an un- solved issue. Now, we first describe the tensor decomposition to solve this high-dimensional tensor. Then, with the decomposed vectors, we will show that the convolutional neural network can be considered as a projection or a mapping process from the global semantics to local ones. 3.3.1 Tensor Decomposition. In general, Tensor decomposition can be regarded as a generalization of Singular Value Decomposition M h1, ...,hN =1 Th1 ...hN Th1 ...hN N N i =1 i =1 Th1 ...hN ϕh1 . . . ϕhN ⟩⟩ ⟨xiϕhi⟩i αi,hi (10) Th1 ...hN × Ah1 ...hN ⟨ψ = ps S ψS⟩ = ⟨x1 . . . xN M M M h1, ...,hN =1 h1, ...,hN =1 = = h1, ...,hN =1 Figure 3: An illustration of the singular value decomposition of a matrix with dimension M × N in (a) and the CP decom- position of a three order tensor in (b). R r =1 (SVD) from matrices to tensors and can help to solve high-dimensional problems (see Fig. 3). There are many methods to decompose a high- dimensional tensor, such as Canonical Polyadic Decomposition (CP decomposition [13]), Tucker Decomposition, etc. The CP decompo- sition with weights is: T = tr · er,1 ⊗ er,2 ⊗ . . . ⊗ er, N (11) where tr is the weight coefficient for each rank-1 tensor and er,i = (er,i,1, . . . , er,i,M)T (i = 1, . . . , N ) is a unit vector with M-dimension. R is the rank of T , which is defined as the smallest number of rank-1 tensors that generate T as their sum. The decomposed vector er,i with a low dimension will play a key role in the later derivation. A set of vectors er,i(i = 1, . . . , N) can be a subspace of the high-dimensional tensor T . 3.3.2 Towards Convolutional Neural Network. We will show that the projection from the global representation ψS⟩ to the local one ψ S ⟩ can be realized by a Convolutional Neural Network (CNN) with product pooling [7]. To see this, we can put the CP decompo- sition Eq. 11 of T in Eq. 10, and obtain: ps ⟨ψ ps S ψS⟩ = er,i,hi · αi,hi) (12) The above equation provides a connection between the quantum- inspired LM and the CNN design. The CNN interpretations of Eq. 12 are summarized in Table 1 and also illustrated in Fig. 4. xi = (αi,h1 , . . . , αi,hM )T . The convolution function isM Given a sequence with N words, each is represented by an vector hi =1 er,i,hi · , which is the inner product < xi , er,i > between xi and er,i. αi,hi The input vector xi is a kind of local information and its entries actually are the values in the local tensor A. The entries in the αi,hi vector er,i decomposed from the global tensor T , are now parame- ters to be trained in the convolutional layer. Such an inner product, can be considered as a mapping from the global information er,i to the local representation xi. After that, the product pooling layer (i.e., R r =1 tr N ( M i =1 hi =1 +⋯+𝐴𝐴𝑚𝑚×𝑛𝑛𝑉𝑉𝑘𝑘×𝑛𝑛𝑈𝑈𝑚𝑚×𝑘𝑘====�𝑖𝑖=1𝑘𝑘𝜎𝜎𝑖𝑖𝒖𝒖𝑖𝑖⨂𝒗𝒗𝑖𝑖+⋯+=+𝒯𝒯=�𝑟𝑟=1𝑅𝑅𝑡𝑡𝑟𝑟𝒆𝒆𝑟𝑟,1⨂𝒆𝒆𝑟𝑟,2⨂𝒆𝒆𝑟𝑟,3(𝒂𝒂)(𝒃𝒃) Figure 4: Realization of QMWF-LM via convolution neural network with product pooling Table 1: CNN Interpretation of Projection Σr,i =M Πr =N xi = (αi,h1 , . . . , αi,hM )T R hi =1 er,i,hi · αi,hi i =1 Σr,i r =1 tr · Πr Input Convolution Product pooling Output  for all the N words. r , see Table 1) multiplies all the mapping results Σr,i =< xi , er,i > As mentioned above, a set of N decomposed vectors corresponds to a subspace of the high-dimensional tensor. The rank R is the number of decomposed subspace, and this number corresponds to the number of convolution channels. In Fig. 4, different color means different channels of convolution. Following the input layer, a convolution layer with R channels calculates weighted sums of the representation vectors xi and the vectors er,i (as kernel weights). In Eq. 12, one can sum R products Πr with weights tr to obtain the projection ⟨ψ S ψS⟩. Then, a vector v = (v1, . . . , vR)T can be used to represent a sequence of words, where vr = tr · Πr (r = 1, . . . , R). 3.3.3 Algorithm. Based on the above ideas, a practical algorithm can be obtained with four parts as follows, also shown in Fig. 4: ps • Input layer The input to our model, a sequence of words S, is composed of N words or patches [x1, ..., xN ]. Each word xi will be represented by a vector (αi,h1 , ..., αi,hM )T . Then, we will get a representation matrix S ∈ RN×M . • Convolution layer For each word or patch, the convolution (r = 1, . . . , R), where R is the number of convolution channels. • Product pooling layer We apply the product pooling on the results of the convolution. It multiplies a number (N ) of • Output Finally, we represent a sequence S using a vector v = (v1, . . . , vR)T ∈ RR. is computed as follows: Σr,i = M Σr,i to get the Πr =N i =1 Σr,i, where Πr ∈ R. hi =1 er,i,hi · αi,hi The above algorithm can model the sentence representation and can be applied in natural language processing tasks such as classification or matching between sentence pairs. It is worth noting that the decomposition of a symmetric tensor can make the unit vectors er as same as each order, which means for a convolutional kernel, er,1 = er,2 = . . . = er, N . In this way, we will get a property about convolutional neural networks, i.e., the weight sharing. 4 APPLICATIONS Question Answering (QA) tasks aim to rank the answers from a candidate answer pool, given a question. The ranking is based on the matching scores between question and answer sentences. The key points are to build effective representations of the question and answer sentences and measure their matching score over such representations. In this paper, we model the question and answer sentences with quantum many-body wave functions and apply the algorithm in Section 3.3.3 to obtain question and answer sentences and match pairs of them. Compared with the ad-hoc retrieval task, the question in the QA task is usually a piece of fluent natural language instead of a phrase or multiple keywords. The candidate answers are also shorter than the documents in ad-hoc retrieval. There is often less number of overlapping words between the question and answer sentences in the QA task, where semantic matching via neural network is widely used. In this paper, we apply the proposed QMWF based LM with neural network implementation in QA tasks. It should be noted that our model is also applicable to other LM based ranking tasks. 4.1 Quantum Many-Body Representation As introduced in Section 3.2, each word vector x⟩ locates at the M dimensional Hilbert space. The product state representation of a specific sentence is represented by the wave function in Eq. 7, and the global representation of an arbitrary sentence with the same length is using the wave function in Eq. 9. As introduced in Section 3.2.3, the projection onto the product state of a sentence is formulated in Eq.10. The process of projection can be implemented by a convolution and a product pooling which has been introduced 𝒆𝑹,𝟏,𝒉𝟏𝒆𝑹,𝟏,𝒉𝟐…𝒆𝑹,𝟏,𝒉𝑴𝒆𝒓,𝟐,𝒉𝟏𝒆𝒓,𝟐,𝒉𝟐𝒆𝟐,𝟏,𝒉𝟏𝒆𝟐,𝟏,𝒉𝟐…𝒆𝟐,𝟏,𝒉𝑴𝒆𝟐,𝟐,𝒉𝟏𝒆𝟐,𝟐,𝒉𝟐𝛼1,ℎ1𝛼1,ℎ2…𝛼1,ℎ𝑀𝛼2,ℎ1𝛼2,ℎ2…𝛼2,ℎ𝑴…………𝛼𝑁,ℎ1𝛼𝑁,ℎ𝟐…𝛼𝑁,ℎ𝑴𝒆𝟏,𝟏,𝒉𝟏𝒆𝟏,𝟏,𝒉𝟐…𝒆𝟏,𝟏,𝒉𝑴𝒆𝟏,𝟐,𝒉𝟏𝒆𝟏,𝟐,𝒉𝟐…𝒆𝟏,𝟐,𝒉𝑴𝑥1𝑥2𝑥𝑁…Kernel weights .Representation MatrixChannel 1…R…𝑣𝑅…𝑣1𝑣2……Product poolingOutput in Section 3.3.2. As a text has different granularity, we can utilize two kinds of methods to obtain our input matrix S. Word-level Based Input. We can utilize the expressive ability of pre-trained embedding. We think each dimension of word em- bedding is corresponding to a latent concept and a basis vector. Let αi,hi be the coefficient with respect to the corresponding basis vector, reflecting that the words can reside in specific concept with a certain probability. Given a sentence S = [x1, . . . , xN ], where xi is a single word represented by a vector (αi,1, . . . , αi,M)T . Then, this sentence can be represented as a matrix in S ∈ RN×M . Character-level Based Input. Inspired by the work [16] that using character-level convolution. A sentence is represented by a sequence of characters: Sc = [x1, ..., xN ]. The first part is a look-up table. We utilize the CNN with max pooling to obtain the representa- tion in word level. We define the matrix Z = [z1, ..., zN ] as a input matrix where each column contains a vector zm ∈ Rdk that is the concatenation of a sequence of k char embeddings. N = N − k + 1, d is the dimension of char embedding and k is the window size of convolution. Each output of convolution is (αi,h1 , . . . , αi,hM )T . Then, we can obtain the input matrix S ∈ RN×M . Based on word-level and character-level, a representation ma- trix S can be obtained. Then, a sentence is represented by v = (v1, . . . , vR)T ∈ RR based on the algorithm in Section 3.3.3. 4.2 Matching via Many-body Wave Function Representation on QA Let Q = [q1, q2 . . . qNQ ] and A = [a1, a2 . . . aNA] be the sentence of the question and answer, respectively. As introduced above, we have: i =1 hi =1 R)T and va = (va1 , . . . , va q q 1 , . . . , v Then, we have vq = (v R)T for the vector representation of the question and answer, respectively. The matching score is defined as the projection from the answer state to the question state, which is an inner product ⟨vq , va⟩. 5 LITERATURE REVIEW Quantum theory is one of the most remarkable discoveries in Sci- ence. It not only can explain the behavior and movement of mi- croscopic particles or electrons, but also have been widely applied in the macro-world problems. For instance, the quantum theory has been applied in social science and economics [12], cognition and decision making [4, 5], language model [1], natural language processing [1, 3], and information retrieval [31, 33, 40].These re- search directions are making use of the mathematical formulation and non-classical probability measurement of quantum theory, not necessarily for quantum computation. In Information Retrieval (IR), van Rijsbergen for the first time proposed to adopt the mathematical formalism of quantum the- ory to unify various IR formal models and provide a theoretical foundation for developing new models [33]. Later, a number of q i ( M = tr · N ( M i = tr · N i =1 hi =1 v va er,i,hi · α ) q i,hi er,i,hi · αa i,hi ) (13) (14) research efforts have been made to build quantum-like IR mod- els [25, 31, 41, 42]. The main inspiration is rooted on the quantum theory as a principled framework for manipulating vector spaces and measuring probability in Hilbert space [20]. Piwowarski et al. [25] proposed a quantum IR framework, which represents the queries and documents as density matrices and subspaces, respec- tively. The information need space can be constructed by the tensor product of term vectors, based on a so-called multi-part system, which corresponds to a product state (see Section 3) of the quantum many-body wave function. However, the issue of the probability amplitudes (forming a high dimensional tensor) have not been ad- dressed systematically. In addition, this framework has not shown the effect of tensor decomposition and its connection with the neural network design. Some quantum-inspired retrieval models are based on the analo- gies between IR problems and quantum phenomena. For instance, by considering the inter-document dependency as a kind of quantum interference phenomena, a Quantum Probability Ranking Princi- ple was proposed [42]. In addition, a quantum-inspired re-ranking method was developed by considering the ranking problem as a filtering process in the photon polarization [41]. These models are novel in terms of their quantum-inspired intuitions. In practice, they adopted the relevance scores of classical retrieval models as the input probabilities, without actually performing a quantum probability measurement (e.g., the projection measurement). Recently, Sordoni et al. [31] proposed a principled Quantum Lan- guage Model (QLM), which generalizes the traditional statistical LM with the quantum probability theory. In QLM, the probability uncertainties of both single and compound words are measured by the projection measurement in Hilbert space. For a text (a query or a document), a density matrix is then estimated based on a Maximal Likelihood Estimation (MLE) solution. Practically, QLM shows an effective performance on the ad-hoc retrieval task. Extending QLM with the idea of quantum entropy minimization, Sordoni et al. pro- posed to learn latent concept embeddings for query expansion in a supervised way [29]. In addition, to capture the dynamic informa- tion need in search sessions, an adaptive QLM was built with an evolution process of the density matrix [19]. More recently, an End- to-End Quantum-like Language Model (named as NNQLM) [40] has been proposed, which built a quantum-like LM into a neural network architecture and showed a good performance on QA tasks. In this paper, we aim to tackle these challenging problems (as identified in the Introduction) of the existing quantum-inspired LMs. Our work is inspired by the recent multidisciplinary research findings across quantum mechanics and machine learning [2] (espe- cially neural network [6, 18]). The two different disciplines, while seemingly to have huge gaps at the first glance, can benefit each other based on rigorous mathematical analysis and proofs. For in- stance, the neural network can help yield a more efficient solution for the quantum many-body problem [6]. The quantum many-body system, on the other hand, can help better explain the mechanism behind the neural network [2, 18]. The neural network based ap- proaches have been shown effective in both the neural IR [8, 9, 11] and QA fields [14, 15, 37]. In this paper, we propose a novel quantum- inspired language modeling approach and apply it in ranking-based QA tasks. We expect that our attempt would potentially open a door for the consequent research across the fields of information retrieval, neural network, and quantum mechanics. we just pick up a couple of basic and typical CNN-based QA models for comparison. 6 EXPERIMENTS 6.1 Datasets We conduct our evaluation on three widely used datasets (summa- rized in Table 2) for the question answering task. • TRECQA is a benchmark dataset used in the Text Retrieval Conference (TREC)'s QA track(8-13) [35]. It contains two training sets, namely TRAIN and TRAIN-ALL. We use TRAIN- ALL, which is a larger and contains more noise, in our ex- periment, in order to verify the robustness of the proposed model. • WIKIQA is an open domain question-answering dataset released by Microsoft Research [36]. We remove all questions with no correct candidate answers. • YahooQA, collected from Yahoo Answers, is a benchmark dataset for community-based question answering. It contains 142627 questions and answers. The answers are generally longer than those in TRECQA and WIKIQA. As introduced in [32], we select the QA pairs containing questions and the best answers of length 5-50 tokens after removing non- alphanumeric characters. For each question, we construct negative examples by randomly sampling 4 answers from the set of answer sentences. 6.2 Algorithms for Comparison QMWF-LM is a quantum inspired language model. The closest approaches to our QMWF-LM are QLM [31] and NNQLM [40]. We treat them as our baselines. • QLM. The question and answer sentences are represented by the density matrices ρq and ρa, respectively. Then the score function is based on the negative Von-Neumann (VN) Divergence between ρq and ρa. • NNQLM-II. This model is an end-to-end quantum language model. We actually compare our model with NNQLM-II, which performs much better than NNQLM-I [40]. The ques- tion and answer sentences are also encoded in the density matrix, but with the embedding vector as the input. The den- sity matrix ρ is trained by a neural network. The matching score is computed by the convolutional neural network over the joint representation of two density matrices ρq and ρa. • QMWF-LM. QMWF-LM is the model introduced in this pa- per. It is inspired by the quantum many-body wave function. QMWF-LM-word is the model whose input matrix is the word embedding. QMWF-LM-char is the model whose input matrix is based on char embedding. Since we utilize the CNN with product pooling to implement the QMWF based LM, we compare our model with a range of CNN-based QA models [10, 26, 27]. Additional CNN-based models include QA-CNN [10], and AP-CNN which is the attentive pooling network. Our focus is to show the potential of the QMWF-inspired LM and its connection with CNN, rather than a comprehensive comparison with all the recent CNN based QA models. Therefore, 6.3 Evaluation Metrics For experiments on TRECQA and WIKIQA, we use the same ma- trix as in [26], namely the MAP (mean average precision) and MRR (mean reciprocal rank). For experiments on YahooQA dataset, we use the same metrics as in [34], namely Precision@1 (P@1) and MRR. P@1 is defined by 1 indicator function and A∗ is the ground truth. N According to Wilcoxon signed-rank test, the symbols α and β denote the statistical significance (with p < 0.05) over QLM and NNQLM-II, respectively, in experimental table. N1 [rank(A∗) = 1] where [·] is the 6.4 Implementation Details and Hyperparameters For QLM and NNQLM, we use the same parameters introduced in [40]. The model is implemented by Tensorflow and the exper- imental machine is based on TITAN X GPU. We train our model for 50 epochs and use the best model obtained in the dev dataset for evaluation in the test set. We utilize the Adam [17] optimizer with learning rate [0.001,0.0001,0.00001]. The batch size is tuned among [80,100,120,140]. The L2 regularization is tuned among [0.0001,0.00001,0.000001]. For QMWF-LM-word, we initialize the input layer with 300-dimensional Glove vectors [24]. For QMWF- LM-char, the initial char embedding is a one-hot vector. In QMWF algorithm, we use the logarithm value for the product pooling, and use two or three words in a patch to capture the phrase information. 6.5 Experimental Results Table 3 reports the results on the TRECQA dataset. The first group shows a comparison of three quantum inspired language models. QMWF-LM-word significantly outperforms QLM by 10.91% on MAP and 12.12% on MRR, respectively. The result of QMWF-LM- word is comparable with that of NNQLM-II. In the second group, we compare our model with a range of CNN-based models against their results reported in the corresponding original papers. We can see that the QMWF-LM-word improves the CNN model in [38] by 5.77% on MAP, and 3.69% on MRR, respectively. Table 4 reports the results on WIKIQA. QMWF-LM-word sig- nificantly outperforms QLM by 35.74% on MAP, and 37.86% on MRR, as well as NNQLM-II by 6.92% on MAP, and 7.74% on MRR. In comparison with CNN models, QMWF-LM-word outperforms QA-CNN and AP-CNN by (1%∼2%) on both MAP and MRR, based on their reported results. The experimental results on YahooQA are shown in Table 5. Our QMWF-LM-word achieves a significant improvement over QLM by 45.57% on P@1 and 23.34% on MRR, respectively. It also out- performs NNQLM-II on P@1 by 23.39% and on MRR by 10.70%, respectively. Compared with the results of other CNN models on YahooQA dataset as reported in [32], QMWF-LM-word shows im- provements over AP-CNN by about 2.67% on P@1 and 2.61% on MRR, respectively. Note that the data preprocessing of YahooQA dataset in our experiments is a little different, as we randomly sample four negative examples from the answers sentence set. Table 2: Statistics of Datasets TREC-QA TRAIN DEV TEST 1229 53417 12.0 100 1517 18.7 82 1148 19.3 #Question #Pairs %Correct WIKIQA TRAIN DEV TEST 873 8672 12.0 126 1130 12.4 243 2351 12.5 YahooQA TRAIN DEV 56432 7082 35880 287015 20 20 TEST 7092 35880 20 Table 3: Experimental Result on TRECQA (raw). α denotes significant improvement over QLM. Model QLM NNQLM-II CNN (Yu et al.) [38] CNN (Severyn) [27] aNMM (Yang et al.) [37] QMWF-LM-char QMWF-LM-word MAP 0.678 0.759 0.711 0.746 0.749 0.715α 0.752 α MRR 0.726 0.825 0.785 0.808 0.811 0.758 α 0.814 α Table 4: Experimental Result on WIKIQA. α and β denote significant improvement over QLM and NNQLM-II, respec- tively. Model QLM NNQLM-II QA-CNN (Santos et al.) [10] AP-CNN (Santos et al.) [10] QMWF-LM-char QMWF-LM-word MAP 0.512 0.650 0.670 0.688 0.657 α 0.695 α β MRR 0.515 0.659 0.682 0.696 0.679 α 0.710 α β Table 5: Experimental Result on YahooQA. α and β denote significant improvement over QLM and NNQLM-II, respec- tively. Model Random guess QLM NNQLM-II QA-CNN (Santos et al.)[10] AP-CNN (Santos et al.)[10] QMWF-LM-char QMWF-LM-word P@1 0.200 0.395 0.466 0.564 0.560 0.513 α β 0.575 α β MRR 0.457 0.604 0.673 0.727 0.726 0.696 α β 0.745 α β As we can see from the results, the performance of QMWF-LM- char is not as good as that of QMWF-LM-word. However, compared with NNQLM-II, QMWF-LM-char has better results on WIKIQA and YahooQA datasets. We will give a further analysis of this phe- nomenon in Section 6.6.2. 6.6 Discussion and Analysis 6.6.1 The Result Analysis. The experimental results show that our proposed model, namely QMWF-LM, has achieved a significant improvement over QLM on three QA datasets, and outperforms NNQLM-II on both WIKIQA and YahooQA datasets. Especially on YahooQA, which is the largest among the three datasets, QMWF-LM significantly outperforms the other two quantum-inspired LM ap- proaches. Note that the original QLM is trained in an unsupervised manner. Therefore, unsurprisingly it under-performs the other two supervised models (i.e., NNQLM and QMWF-LM). NNQLM adopts the embedding vector as its input and uses the convolutional neu- ral network to train the density matrix. However, the interaction among words is not taken into account in NNQLM. The experiment also shows that the proposed model can achieve a comparable and even better performance over a couple of CNN-based QA mod- els. In summary, our proposed model reveals the analogy between the quantum many-body system and the language modeling, and further effectively bridge the quantum many-body wave function inspired LM with the neural network design. 6.6.2 The Comparison between Word embedding and Char embed- ding. In our experiment, the input layer is based on word embedding and char embedding. For char embedding, we treat the text as a kind of raw signal which has been proved effective in modeling sen- tence [16]. As char embedding is initialized by one-hot vector, the semantic information is only based on training dataset. In QA tasks, the semantic matching requires a relatively large data for training the embeddings. Therefore, compared with char embedding, pre- trained word embedding trained by an external large corpus (rather than training data only) is more effective. Influence of Channels in Convolution. As introduced in Sec- 6.6.3 tion 3, the number of convolution channels is corresponding to R which is the rank of a tensor. In our problem, it is not straight- forward to determine the rank of a concerned tensor. We select the optimal R in a range [20, 200] with increment 5. For different datasets, we set a suitable number of channels to obtain the best performance. The number of channels is set to 150 for TRECQA and WIKIQA dataset, and 200 For YahooQA dataset. 6.6.4 Efficiency Analysis. As we utilize convolution neural net- work to implement the operation of tensor decomposition. The efficiency relies on the convolution neural network. In our experi- ment, for QMWF-LM-char, the training epoch is set to be 200, while for QMWF-LM-word, after training 20 epochs, we will obtain the results. 7 CONCLUSIONS AND FUTURE WORK In this paper, we propose a Quantum Many-body Wave Function (QMWF) inspired Language Modeling (QMWF-LM) framework. We have shown that the incorporation of QMWF has enhanced the rep- resentation space of quantum-inspired LM approaches, in the sense that QMWF-LM can model the complex interactions among words with multiple meanings. In addition, inspired by the recent progress on solving the quantum many-body problem and its connection to the neural network, we bridge the gap between the quantum- inspired language modeling and the convolutional neural network. Specifically, a series of derivations (based on projection and ten- sor decomposition) show that the quantum many-body language modeling representation and matching process can be implemented by the convolutional neural network (CNN) with product pooling. This result simplifies the estimation of the probability amplitudes in QMWF-LM. Based on this idea, we provide a simple algorithm in a basic CNN architecture. We implement our approach on the question answering task. Experiments on three QA datasets have demonstrated the effective- ness of our proposed QMWF based LM. It achieves a significant improvement over its quantum-like counterparts, i.e., QLM and NNQLM. It can also achieve effective performance compared with several convolutional neural network based approaches. Further- more, based on the analytical and empirical evidence presented in this paper, we can conclude that the proposed approach has made the first step to bridge the quantum-inspired formalism, language modeling and neural network structure in a principled manner. In the future, the quantum many-body inspired language model should be investigated in more depth from both theoretical and empirical perspectives. Theoretically, a more unified framework to explain another widely-adopted neural network architecture, i.e., Recurrent Neural Network (RNN), can be explored based on the mechanism of quantum many-body language modeling. Practically, we will apply and evaluate QMWF-LM on other IR or NLP tasks with larger scale datasets. 8 ACKNOWLEDGMENTS This work is supported in part by the state key development pro- gram of China (grant No. 2017YFE0111900), Natural Science Foun- dation of China (grant No. U1636203, 61772363), and the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 721321. REFERENCES [1] Ivano Basile and Fabio Tamburini. 2017. Towards Quantum Language Models. In Proc. of EMNLP. 1840 -- 1849. [2] Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd. 2016. Quantum machine learning. arXiv preprint arXiv:1611.09347 (2016). [3] William Blacoe, Elham Kashefi, and Mirella Lapata. 2013. A Quantum-Theoretic Approach to Distributional Semantics.. In Proc. of HLT-NAACL. 847 -- 857. [4] Peter D. Bruza, Zheng Wang, and Jerome R. Busemeyer. 2015. Quantum cognition: a new theoretical approach to psychology. Trends in Cognitive Sciences 19, 7 (2015), 383 -- 393. [5] Jerome R. Busemeyer and Peter D. Bruza. 2013. Quantum Models of Cognition [6] G. Carleo and M. Troyer. 2017. Solving the quantum many-body problem with and Decision. Cambridge University Press. artificial neural networks. Science 355 (2017), 602 -- 606. Deep Learning: A Tensor Analysis. Computer Science (2016). [8] Nick Craswell, W. Bruce Croft, Maarten de Rijke, Jiafeng Guo, and Bhaskar Mitra. 2017. SIGIR 2017 Workshop on Neural Information Retrieval (Neu-IR'17). In Proc. of SIGIR. 1431 -- 1432. [9] Mostafa Dehghani, Hamed Zamani, Aliaksei Severyn, Jaap Kamps, and W. Bruce Croft. 2017. Neural Ranking Models with Weak Supervision. In Proc. of SIGIR. 65 -- 74. [10] Cıcero Nogueira dos Santos, Ming Tan, Bing Xiang, and Bowen Zhou. 2016. [7] Nadav Cohen, Or Sharir, and Amnon Shashua. 2016. On the Expressive Power of [11] Jiafeng Guo, Yixing Fan, Qingyao Ai, and W. Bruce Croft. 2016. A Deep Relevance Attentive pooling networks. CoRR, abs/1602.03609 (2016). Matching Model for Ad-hoc Retrieval. In Proc. of CIKM. 55 -- 64. Press. [12] E. Haven and A. Khrennikov. 2013. Quantum Social Science. Cambridge University [13] Frank L Hitchcock. 1927. The expression of a tensor or a polyadic as a sum of [17] Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic opti- products. Studies in Applied Mathematics 6, 1-4 (1927), 164 -- 189. [14] Baotian Hu, Zhengdong Lu, Hang Li, and Qingcai Chen. 2014. Convolutional neural network architectures for matching natural language sentences. In Proc. of NIPS. 2042 -- 2050. [15] Yoon Kim. 2014. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882 (2014). [16] Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. 2016. Character- Aware Neural Language Models.. In Proc. of AAAI. 2741 -- 2749. mization. arXiv preprint arXiv:1412.6980 (2014). [18] Yoav Levine, David Yakira, Nadav Cohen, and Amnon Shashua. 2017. Deep Learn- ing and Quantum Entanglement: Fundamental Connections with Implications to Network Design. CoRR abs/1704.01552 (2017). http://arxiv.org/abs/1704.01552 [19] Qiuchi Li, Jingfei Li, Peng Zhang, and Dawei Song. 2015. Modeling multi-query retrieval tasks using density matrix transformation. In Proc. of SIGIR. ACM, 871 -- 874. [20] Massimo Melucci and Keith van Rijsbergen. 2011. Quantum Mechanics and Information Retrieval. Springer Berlin Heidelberg, Berlin, Heidelberg, 125 -- 155. [21] Donald Metzler and W. Bruce Croft. 2005. A Markov random field model for term dependencies. In Proc. of SIGIR. 472 -- 479. [22] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Proc. of NIPS. 3111 -- 3119. [23] Michael A. Nielsen and Isaac L. Chuang. 2011. Quantum Computation and Quantum Information: 10th Anniversary Edition (10th ed.). Cambridge University Press, New York, NY, USA. [24] Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proc. of EMNLP. 1532 -- 1543. [25] Benjamin Piwowarski, Ingo Frommholz, Mounia Lalmas, and Keith van Rijsber- gen. 2010. What can quantum theory bring to information retrieval. In Proc. of CIKM. 59 -- 68. [26] Aliaksei Severyn and Alessandro Moschitti. 2015. Learning to rank short text pairs with convolutional deep neural networks. In Proc. of SIGIR. ACM, 373 -- 382. [27] Aliaksei Severyn and Alessandro Moschitti. 2016. Modeling relational informa- tion in question-answer pairs with convolutional neural networks. arXiv preprint arXiv:1604.01178 (2016). [28] Fei Song and W. Bruce Croft. 1999. A General Language Model for Information Retrieval (poster abstract). In Proc. of SIGIR. 279 -- 280. [29] Alessandro Sordoni, Yoshua Bengio, and Jian-Yun Nie. 2014. Learning Concept Embeddings for Query Expansion by Quantum Entropy Minimization.. In Proc. of AAAI, Vol. 14. 1586 -- 1592. [30] Alessandro Sordoni and Jian-Yun Nie. 2013. Looking at vector space and language models for ir using density matrices. In Proc. of QI. Springer, 147 -- 159. [31] Alessandro Sordoni, Jian-Yun Nie, and Yoshua Bengio. 2013. Modeling term dependencies with quantum language models for IR. In Proc. of SIGIR. ACM, 653 -- 662. [32] Yi Tay, Minh C Phan, Luu Anh Tuan, and Siu Cheung Hui. 2017. Learning to Rank Question Answer Pairs with Holographic Dual LSTM Architecture. In Proc. of SIGIR. ACM, 695 -- 704. [33] Cornelis Joost Van Rijsbergen. 2004. The geometry of information retrieval. Cam- bridge University Press. [34] Shengxian Wan, Yanyan Lan, Jiafeng Guo, Jun Xu, Liang Pang, and Xueqi Cheng. 2016. A Deep Architecture for Semantic Matching with Multiple Positional Sentence Representations.. In Proc. of AAAI. 2835 -- 2841. [35] Mengqiu Wang, Noah A Smith, and Teruko Mitamura. 2007. What is the Jeopardy Model? A Quasi-Synchronous Grammar for QA.. In Proc. of EMNLP-CoNLL, Vol. 7. 22 -- 32. [36] Yi Yang, Wen-tau Yih, and Christopher Meek. 2015. WikiQA: A Challenge Dataset for Open-Domain Question Answering.. In Proc. of EMNLP. Citeseer, 2013 -- 2018. [37] Wenpeng Yin, Hinrich Schütze, Bing Xiang, and Bowen Zhou. 2015. Abcnn: Attention-based convolutional neural network for modeling sentence pairs. arXiv preprint arXiv:1512.05193 (2015). [38] Lei Yu, Karl Moritz Hermann, Phil Blunsom, and Stephen Pulman. 2014. Deep learning for answer sentence selection. arXiv preprint arXiv:1412.1632 (2014). Morgan & Claypool Publishers. [39] ChengXiang Zhai. 2008. Statistical Language Models for Information Retrieval. [40] Peng Zhang, Jiabin Niu, Zhan Su, Benyou Wang, Liqun Ma, and Dawei Song. 2018. End-to-End Quantum-like Language Models with Application to Question Answering. In Proc. of AAAI. 5666 -- 5673. [41] Xiaozhao Zhao, Peng Zhang, Dawei Song, and Yuexian Hou. 2011. A novel re- ranking approach inspired by quantum measurement. In Proc. of ECIR. 721 -- 724. [42] Guido Zuccon and Leif Azzopardi. 2010. Using the Quantum Probability Ranking Principle to Rank Interdependent Documents. In Proc. of ECIR. 357 -- 369.
1603.06127
4
1603
2016-05-17T14:08:38
Sentence Pair Scoring: Towards Unified Framework for Text Comprehension
[ "cs.CL", "cs.AI", "cs.LG", "cs.NE" ]
We review the task of Sentence Pair Scoring, popular in the literature in various forms - viewed as Answer Sentence Selection, Semantic Text Scoring, Next Utterance Ranking, Recognizing Textual Entailment, Paraphrasing or e.g. a component of Memory Networks. We argue that all such tasks are similar from the model perspective and propose new baselines by comparing the performance of common IR metrics and popular convolutional, recurrent and attention-based neural models across many Sentence Pair Scoring tasks and datasets. We discuss the problem of evaluating randomized models, propose a statistically grounded methodology, and attempt to improve comparisons by releasing new datasets that are much harder than some of the currently used well explored benchmarks. We introduce a unified open source software framework with easily pluggable models and tasks, which enables us to experiment with multi-task reusability of trained sentence model. We set a new state-of-art in performance on the Ubuntu Dialogue dataset.
cs.CL
cs
Sentence Pair Scoring: Towards Unified Framework for Text Comprehension Petr Baudis, Jan Pichl, Tom´as Vyskocil and Jan Sediv´y FEE CTU Prague Department of Cybernetics Technick´a 2, Prague, Czech Republic [email protected] Abstract We review the task of Sentence Pair Scor- ing, popular in the literature in various forms - viewed as Answer Sentence Se- lection, Semantic Text Scoring, Next Ut- terance Ranking, Recognizing Textual En- tailment, Paraphrasing or e.g. a component of Memory Networks. We argue that all such tasks are similar from the model perspective and propose new baselines by comparing the perfor- mance of common IR metrics and popu- lar convolutional, recurrent and attention- based neural models across many Sen- tence Pair Scoring tasks and datasets. We discuss the problem of evaluating ran- domized models, propose a statistically grounded methodology, and attempt to improve comparisons by releasing new datasets that are much harder than some of the currently used well explored bench- marks. We introduce a unified open source software framework with easily pluggable models and tasks, which enables us to experiment with multi-task reusability of trained sentence models. We set a new state-of-art in performance on the Ubuntu Dialogue dataset. 1 Introduction An NLP machine learning task often involves clas- sifying a sequence of tokens such as a sentence or a document, i.e. approximating a function f1(s) ∈ [0, 1] (where f1 may determine a domain, senti- ment, etc.). But there is a large class of prob- lems that involve classifying a pair of sentences, f2(s0, s1) ∈ R (where s0, s1 are sequences of to- kens, typically sentences). Typically, the function f2 represents some sort of semantic similarity, that is whether (or how much) the two sequences are semantically related. This formulation allows f2 to be a measure for tasks as different as topic relatedness, paraphras- ing, degree of entailment, a pointwise ranking task for answer-bearing sentences or next utter- ance classification. In this work, we adopt the working assumption that there exist certain universal f2 type measures that may be successfuly applied to a wide variety of semantic similarity tasks - in the case of neu- ral network models trained to represent universal semantic comprehension of sentences and adapted to the given task by just fine-tuning or adapting the output neural layer (in terms of architecture or just weights). Our argument for preferring f2 to f1 in this pursuit is the fact that the other sentence in the pair is essentially a very complex label when training the sequence model, which can therefore discern semantically rich structures and dependen- cies. Determining and demonstrating such univer- sal semantic comprehension models across mul- tiple tasks remains a few steps ahead, since the research landscape is fragmented in this regard. Model research is typically reported within the context of just a single f2-type task, each dataset requires sometimes substantial engineering work before measurements are possible, and results are reported in ways that make meaningful model comparisons problematic. Our main aims are as follows. (A) Unify re- search within a single framework that employs task-independent models and task-specific adapta- tion modules. (B) Improve the methodology of model evaluation in terms of statistics, compar- ing with strong non-neural IR baselines, and in- troducing new datasets with better characteristics. (C) Demonstrate the feasibility of pursuing uni- versal, task-independent f2 models, showing that even simple neural models learn universal seman- tic comprehension by employing cross-task trans- fer learning. The paper is structured as follows. In Sec. 2, we outline possible specific f2 tasks and available datasets; in Sec. 3, we survey the popular non- neural and neural baselines in the context of these tasks; finally, in Sec. 4, we present model-task evaluations within a unified framework to estab- lish the watermark for future research as well as gain insight into the suitability of models across a variety of tasks. In Sec. 5, we demonstrate that transfer learning across tasks is helpful to power- fully seed models. We conclude with Sec. 6, sum- marizing our findings and outlining several future research directions. 2 Tasks and Datasets The tasks we are aware of that can be phrased as f2-type problems are listed below. In gen- eral, we primarily focus on tasks that have rea- sonably large and realistically complex datasets freely available. On the contrary, we have explic- itly avoided datasets that have licence restrictions on availability or commercial usage. 2.1 Answer Sentence Selection Given a factoid question and a set of candidate answer-bearing sentences in encyclopedic style, the first task is to rank higher sentences that are more likely to contain the answer to the question. As it is fundamentally an Information Retrival task in nature, the model performance is com- monly evaluated in terms of Mean Average Preci- sion (MAP) and Mean Reciprocial Rank (MRR). This task is popular in the NLP research com- munity thanks to the dataset introduced in (Wang et al., 2007) (which we refer to as wang), with six papers published between February 2015 and 2016 alone and neural models substantially im- proving over classical approaches based primarily on parse tree edits.1 It is possibly the main re- search testbed for f2-style task models. This task has also immediate applications e.g. in Question Answering systems. In the context of practical applications, the so- far standard wang dataset has several downsides we observed when tuning and evaluating our mod- els, illustrated numerically in Fig. 1 - the set of 1http://aclweb.org/aclwiki/index.php? title=Question_Answering_(State_of_the_ art) candidate sentences is often very small and quite uneven (which also makes rank-based measures unstable) and the total number of individual sen- tence pairs as well as questions is relatively small. Furthermore, the validation and test set are very small, which makes for noisy performance mea- surements; the splits also seem quite different in the nature of questions since we see minimum correlation between performance on the validation and test sets, which calls the parameter tuning pro- cedures and epoch selection for early stopping into question. Alternative datasets WikiQA (Yang et al., 2015) and InsuranceQA (Tan et al., 2015) were proposed, but are encumbered by licence restric- tions. Furthermore, we speculate that they may suffer from many of the problems above2 (even if they are somewhat larger). To alleviate the problems listed above, we are introducing a new dataset yodaqa/large2470 based on an extension of the curatedv2 ques- tion dataset (introduced in (Baudis and Sediv´y, 2015), further denoisified by Mechanical Turkers) with candidate sentences as retrieved by the Yo- daQA question answering system (Baudis, 2015) from English Wikipedia and labelled by matching the gold standard answers in the passages.3 Motivated by another problem related to the Yo- daQA system, we also introduce another dataset wqmprop, where s0 are again question sentences, but s1 are English labels of properties that make a path within the Freebase knowledge base that connects an entity linked in the question to the cor- rect answer. This task (Property Selection) can be evaluated identically to the previous task, and so- lutions often involving Convolutional Neural Net- works have been studied in the Question Answer- ing literature (Yih et al., 2015) (Xu et al., 2016). Our sentences have been derived from the We- bQuestions dataset (Berant et al., 2013) extended with the moviesE dataset questions (originally in- troduced in (Baudis and Sediv´y, 2015)); the prop- erty paths are based on the Freebase knowledge graph dump, generated based on entity linking and exploration procedure of YodaQA v1.5.4 2Moreover, InsuranceQA is effectively a classification task rather than a ranking task, which we do not find as ap- pealing in the context of practical applications. 3Note that the wang and yodaqa datasets however share a common ancestry regarding the set of questions and there may be some overlaps, even across train and test splits. Therefore, mixing training and evaluation on wang and yo- daqa datasets within a single model instance is not advisable. 4https://github.com/brmson/ Fig. 1 compares the critical characteristics of the datasets. Furthermore, as apparent below, the baseline performances on the newly proposed datasets are much lower, which suggests that fu- ture model improvements will be more apparent in evaluation. 2.2 Next Utterance Ranking (Lowe et al., 2015) proposed the new large-scale real-world Ubuntu Dialogue dataset for an f2-style task of ranking candidates for the next utterance in a chat dialog, given the dialog context. The tech- nical formulation of the task is the same as for An- swer Sentence Selection, but semantically, choos- ing the best followup has different concerns than choosing an answer-bearing sentence. Recall at top-ranked 1, 2 or 5 utterances out of either 2 or 10 candidates is reported; we also propose reporting the utterance MRR as a more aggregate measure. The newly proposed Ubuntu Dialogue dataset is based on IRC chat logs of the Ubuntu commu- nity technical support channels and contains casu- ally typed interactions regarding computer-related problems.5 While the training set consists of in- dividual labelled pairs, during evaluation 10 fol- lowups to given message(s) are ranked. The se- quences might be over 200 tokens long. Our primary motivation for using this dataset is its size. The numerical characteristics of this dataset are shown in Table 1.6 We use the v2 version of the dataset.7 Research published on this dataset so far relies on simple neural models. (Lowe et al., 2015) (Kadlec et al., 2015) 2.3 Recognizing Textual Entailment and Semantic Textual Similarity One of the classic tasks at the boundary of Natural Language Processing and Artificial Intelligence is the inference problem of Recognizing Textual En- tailment (Dagan et al., 2006) - given a pair of a factual sentence and a hypothesis sentence, we are to determine whether the hypothesis represents a contradiction, entailment or is neutral (cannot be proven or disproven). dataset-factoid-webquestions branch movies 5In a manner, they resemble tweet data, but without the length restriction and with heavily technical jargon, inter- spersed command sequences etc. 6As in past papers, we use only the first 1M pairs (10%) of the training set. 7https://github.com/rkadlec/ ubuntu-ranking-dataset-creator We include two current popular machine learn- ing datasets for this task. The Stanford Natural Language Inference SNLI dataset (Bowman et al., 2015) consists of 570k English sentence pairs with the facts based on image captions, and 10k + 10k of the pairs held out as validation and test sets. The SICK-2014 dataset (Marelli et al., 2014) was in- troduced as Task 1 of the SemEval 2014 confer- ence and in contrast to SNLI, it is geared at specifi- cally benchmarking semantic compositional meth- ods, aiming to capture only similarities on purely language and common knowledge level, without relying on domain knowledge, and there are no named entities or multi-word idioms; it consists of 4500 training pairs, 500 validation pairs and 4927 testing pairs. For the SICK-2014 dataset, we also report re- sults on the Semantic Textual Similarity. This task originates in the STS track of the SemEval con- ferences (Agirre et al., 2015) and involves scoring pairs of sentences from 0 to 5 with the objective of maximizing correlation (Pearson's r) with manu- ally annotated gold standard. 3 Models is a universal As our goal text comprehen- sion model, we focus on neural network models architecture-wise. We assume that the sequence is transformed using N-dimensional word embed- dings on input, and employ models that produce a pair of sentence embeddings E0, E1 from the sequences of word embeddings e0, e1. Unless noted otherwise, a Siamese architecture is used that shares weights among both sentenes. A scorer module that compares the E0, E1 sen- tence embeddings to produce a scalar result is con- nected to the model; for specific task-model con- figurations, we use either the dot-product module 1 (representing non-normalized vector an- E0 · E T gle, as in e.g. (Yu et al., 2014) or (Weston et al., 2014))8 or the MLP module that takes element- wise product and sum of the embeddings and feeds them to a two-layer perceptron with hidden layer of width 2N (as in e.g. (Tai et al., 2015)).9 For the STS task, we follow this by score regression using 8Not normalizing the vectors acts as a regularization for their size. In all our experiments, cosine distance fared much worse. 9The motivation is to capture both angle and euclid dis- tance in multiple weighed sums. Past literature uses absolute difference rather than sum, but both performed equally in our experiments and we adopted sum for technical reasons. Dataset wang yodaqa/large2470 wqmprop Train pairs Val. pairs Test pairs Val.-Test r Ev. #s0 Ev. #s1 per s0 34.9 ±131% 159.2 ±100% 118.753 ±85% 44648 220846 407465 1149 55052 137235 195600 1518 120069 277509 189200 Ubuntu Dialogue v2 1M -0.078 0.348 0.836 0.884 178 1100 3430 38480 10 Figure 1: The Val.-Test column shows inter-trial Pearson's r of validation and test MRRs, averaged across the models we benchmarked (see below). The s0 and s1 statistics are shown for the evaluation (Ev. - validation and test) portion of the datasets. The last column includes relative standard deviation of the number of candidate sentences per question, which corresponds to the variation in the difficulty of the ranking task (as well as variation in expected measure values for individual questions). class interpolation as in (Tai et al., 2015). When training for a ranking task (Answer Sen- tence Selection), we use the bipartite ranking ver- sion of Ranknet (Burges et al., 2005) as the objec- tive; when training for STS task, we use Pearson's r formula as the objective; for binary classification tasks, we use the binary crossentropy objective. 3.1 Baselines In order to anchor the reported performance, we report several basic methods. Weighed word overlaps metrics TF-IDF and BM25 (Robertson et al., 1995) are inspired by IR research and pro- vide strong baselines for many tasks. We treat s0 as the query and s1 as the document, counting the number of common words and weighing them ap- propriately. IDF is determined on the training set. The avg metric represents the baseline method when using word embeddings that proved success- ful e.g. in (Yu et al., 2014) or (Weston et al., 2014), simply taking the mean vector of the word em- bedding sequence and training an U weight matrix N ×2N that projects both embeddings to the same vector space, Ei = tanh(U · ¯ei), where the MLP scorer compares them. During training, p = 1/3 standard (elementwise) dropout is applied on the input embeddings. A simple extension of the above are the DAN Deep Averaging Networks (Iyyer et al., 2015), which were shown to adequately replace much more complex models in some tasks. Two dense perceptron layers are stacked between the mean and projection, relu is used instead of tanh as the non-linearity, and word-level dropout is used in- stead of elementwise dropout. 3.2 Recurrent Neural Networks RNN with memory units are popular models for processing sentenes (Tan et al., 2015) (Lowe et al., 2015) (Bowman et al., 2015). We use a bidi- rectional network with 2N GRU memory units10 (Cho et al., 2014) in each direction; the final unit states are summed across the per-direction GRUs to yield a 2N vector representation of the sen- tence. Like in the avg baseline, a projection matrix is applied on this representation and final vectors compared by an MLP scorer. We have found that applying massive dropout p = 4/5 both on the in- put and output of the network helps to avoid over- fitting even early in the training. 3.3 Convolutional Neural Networks CNN with sentence-wide pooling layer are also popular models for processing sentences (Yu et al., 2014) (Tan et al., 2015) (Severyn and Moschitti, 2015) (He et al., 2015) (Kadlec et al., 2015). We apply a multi-channel convolution (Kim, 2014) with single-token channel of N convolutions and 2, 3, 4 and 5-token channels of N/2 convolu- tions each, relu transfer function, max-pooling over the whole sentence, and as above a projec- tion to shared space and an MLP scorer. Dropout is not applied. 3.4 RNN-CNN Model The RNN-CNN model aims to combine both re- current and convolutional networks by using the memory unit states in each token as the new repre- sentation of the token which is then fed to the con- volutional network. Inspired by (Tan et al., 2015), the aim of this model is to allow the RNN to model long-term dependencies and model contextual rep- resentations of words, while taking advantage of the CNN and pooling operation for crisp selection of the gist of the sentence. We use the same pa- rameters as for the individual models, but with no dropout and reducing the number of parameters by using only N memory units per direction. 10While the LSTM architecture is more popular, we have found the GRU results are equivalent while the number of parameters is reduced. 3.5 Attention-Based Models The idea of attention models is to attend preferren- tially to some parts of the sentence when building its representation (Hermann et al., 2015) (Tan et al., 2015) (dos Santos et al., 2016) (Rocktaschel et al., 2015). There are many ways to model at- tention, we adopt the (Tan et al., 2015) model attn1511 as a conceptually simple and easy to im- plement baseline. It asymmetrically extends the RNN-CNN model by extra links from s0 CNN output to the post-recurrent representation of each s1 token, determining an attention level for each token by weighed sum of the token vector ele- ments, focusing on the relevant s1 segment by transforming the attention levels using softmax and multiplying the token representations by the attention levels before they are fed to the convolu- tional network. Convolutional network weights are not shared between the two sentences and the convolutional network output is not projected before applying the MLP scorer. The CNN used here is single- channel with 2N convolution filters 3 tokens wide. 4 Model Performance 4.1 dataset-sts framework To easily implement models, dataset loaders and task adapters in a modular fashion so that any model can be easily run on any f2-type task, we have created a new software pack- age dataset-sts that integrates a variety of datasets, a Python dataset adapter PySTS and a Python library for easy construction of deep neu- ral NLP models for semantic sentence pair scoring KeraSTS that uses the Keras machine learning li- brary (Chollet, 2015). The framework is available for other researchers as open source on GitHub.11 4.2 Experimental Setting We use N = 300 dimensional GloVe embed- dings matrix pretrained on Wikipedia 2014 + Gi- gaword 5 (Pennington et al., 2014) that we keep adaptable during training; words in the training set not included in the pretrained model are initial- ized by random vectors uniformly sampled from [−0.25, +0.25] to match the embedding standard deviation. Word overlap is an important feature in many f2-type tasks (Yu et al., 2014) (Severyn and Mos- 11https://github.com/brmson/dataset-sts chitti, 2015), especially when the sentences may contain named entities, numeric or other data for which no embedding is available. As a workaround, ensemble of world overlap count and neural model score is typically used to produce the final score. In line with this idea, in the An- swer Sentence Selection wang and large2470 datasets, we use the BM25 overlap baseline as an additional input to the MLP scoring module, and prune the scored samples to top 20 based on BM25.12 Furthermore, we extend the embedding of each input token by several extra dimensions carrying boolean flags - bigram overlap, unigram overlap (except stopwords and interpunction), and whether the token starts with a capital letter or is a number. Particular hyperparameters are tuned primar- ily on the yodaqa/large2470 dataset unless noted otherwise in the respective results table caption. We apply 10−4 L2 regularization and use Adam optimization with standard parameters (Kingma and Ba, 2014). In the answer selection tasks, we train on 1/4 of the dataset in each epoch. After training, we use the epoch with best vali- dation performance; sadly, we typically observe heavy overfitting as training progresses and rarely use a model from later than a couple of epochs. 4.3 Evaluation Methodology We report model performance averaged across 16 training runs (with different seeds). A consid- eration we must emphasize is that randomness plays a large role in neural models both in terms of randomized weight initialization and stochas- tic dropout. For example, the typical methodol- ogy for reporting results on the wang dataset is to evaluate and report a single test run after tun- ing on the dev set,13 but wang test MRR has em- pirical standard deviation of 0.025 across repeated runs of our attn1511 model, which is more than twice the gap between every two successive papers pushing the state-of-art on this dataset! See the ∗- marked sample in Fig. 2 for a practical example of this phenomenon. Furthermore, on more com- plex tasks (Answer Sentence Selection in particu- lar, see Fig. 1) the validation set performance is not 12This reduces the number of (massively irrelevant) train- ing samples, but we observed no adverse effects of that, while it speeds up training greatly and models well a typical In- formation Retrieval scenario where fast pre-scoring of candi- dates is essential. 13Confirmed by personal communication with paper au- thors. a great approximator for test set performance and a strategy like picking the training run with best val- idation performance would lead just to overfitting on the validation set. To allow comparison between models (and with future models), we therefore report also 95% con- fidence intervals for each model performance es- timate, as determined from the empirical standard deviation using Student's t-distribution.14 4.4 Results In Fig. 2 to 4, we show the cross-task performance of our models. We can observe an effect analo- gous to what has been described in (Kadlec et al., 2015) - when the dataset is smaller, CNN models are preferrable, while larger dataset allows RNN models to capture the text comprehension task bet- ter. IR baselines provide strong competition and finding new ways to ensemble them with models should prove beneficial in the future.15 This is especially apparent in the new Answer Sentence Selection datasets that have very large number of sentence candidates per question. The attention mechanism also has the highest impact in this kind of Information Retrieval task. On the Ubuntu Dialog dataset, even the sim- ple LSTM model in our proposed setting beats the baseline performance reported by Lowe, while our RNN-CNN model establishes the new state-of-art, beating the three-hop Memory Network of (Dodge et al., 2015). It is not possible to statistically de- termine the relation of our models to state-of-art on the wang Answer Sentence Selection dataset. Our models clearly yet lag behind the state-of-art on the RTE and STS tasks, where we did not care- fully tune their parameters, but also did not em- ploy data augmentation strategies like synonyme substitution in (Mueller and Thyagarajan, 2016), which might be necessary for good performance on small datasets even when using transfer learn- ing. 5 Model Reusability To confirm the hypothesis that our models learn a generic task akin to some form of text comprehen- 14Over larger number of samples, this estimate converges to the normal distribution confidence levels. Note that the confidence interval determines the range of the true expected evaluation, not evaluation of any measured sample. 15We have tried simple averaging of predictions (as per (Kadlec et al., 2015)), but the benefit was small and incon- sistent. sion, we trained a model on the large Ubuntu Di- alogue dataset (Next Utterance Ranking task) and transferred the weights and retrained the model in- stance on other tasks. We used the RNN model for the experiment in a configuration with dot-product scorer and smaller dimensionality (which works much better on the Ubuntu dataset). This config- uration is shown in the respective result tables as Ubu. RNN and it consistently ranks as the best or among the best classifiers, dramatically outper- foring the baseline RNN model.16 During our experiments, we have noticed that it is important not to apply dropout during re- training if it wasn't applied during the source model training, to balance the dataset labels, and we used the RMSprop training procedure since Adam's learning rate annealing schedule might not be appropriate for weight re-training. We have also tried freezing the weights of some layers, but this never yielded a significant improvement. (Bowman et al., 2015) have shown that such a model transfer is beneficial by reusing an RTE model trained on the SNLI dataset to the SICK- 2014 dataset. We have tried the same, shown as SNLI RNN, and while we see an improvement when reusing it on an RTE task, on other tasks it is the same or worse than the Ubuntu Dialogue based transfer, possibly because the Ubu. task sees more versatile and less clean data. 6 Conclusion We have unified a variety of tasks in a single sci- entific framework of sentence pair scoring, and demonstrated a platform for general modelling of this problem and aggregate benchmarking of these models across many datasets. Promising initial transfer learning results suggest that a quest for generic neural model capable of task-independent text comprehension is becoming a meaningful pur- suit. The open source nature of our framework and the implementation choice of a popular and extensible deep learning library allows for high reusability of our research and easy extensions with further more advanced models. Based on our benchmarks, as a primary model for applications on new f2-type tasks, we can rec- ommend either the RNN-CNN model or transfer learning based on the Ubu. RNN model. 16The RNN configuration used for the transfer, when trained only on the target task, is not shown in the tables but has always been worse than the baseline RNN configuration. Model wang MAP wang MRR l2470 MAP l2470 MRR wqm MAP wqm MRR 0.728 0.753 0.578 0.630 0.649 ±0.011 0.713 ±0.003 0.709 ±0.004 0.696 ±0.006 0.717 ±0.005 0.729 ±0.006 0.732 ±0.006 0.756 0.731 ±0.007 0.832 0.851 0.709 0.765 0.743 ±0.010 0.806 ±0.005 0.787 ±0.007 0.785 ±0.007 0.793 ±0.005 0.810 ±0.009 0.817 ±0.012 0.859 0.814 ±0.008 (Tan et al., 2015) (dos Santos et al., 2016) TF-IDF BM25 RNN w/o BM25 avg DAN RNN CNN RNN-CNN attn1511 ∗attn1511 Ubu. RNN w/o BM25 Ubu. RNN SNLI RNN 0.267 0.314 0.262 ±0.003 0.278 ±0.003 0.282 ±0.004 0.277 ±0.004 0.288 ±0.003 0.288 ±0.004 0.286 ±0.003 0.359 ±0.003 0.291 ±0.002 0.264 ±0.005 0.363 0.491 0.381 ±0.008 0.481 ±0.008 0.490 ±0.010 0.487 ±0.008 0.499 ±0.007 0.503 ±0.010 0.499 ±0.009 0.539 ±0.006 0.515 ±0.004 0.460 ±0.015 0.216 0.194 0.462 ±0.013 0.457 ±0.007 0.653 ±0.068 0.664 ±0.021 0.517 ±0.052 0.701 ±0.008 0.506 ±0.015 0.503 ±0.008 0.682 ±0.065 0.694 ±0.019 0.556 ±0.048 0.729 ±0.005 Figure 2: Model results on the Answer Sentence Selection task, as measured on the wang, yodaqa/large2470 and wqmprop datasets. wqmprop does not use the BM25 ensembling, and CNN is not Siamese. ∗ Demonstration of the problematic single-measurement result reporting in past literature - an outlier sample in our 16-trial attn1511 benchmark that would score as a state of art; in total, three outliers in the trial (12.5%) scored better than (Tan et al., 2015). 6.1 Future Work Due to the very wide scope of the f2-problem scope, we leave some popular tasks and datasets as future work. A popular instance of sen- tence pair scoring is the question answering task of the Memory Networks (supported by the baBi dataset) (Weston et al., 2015). A realis- tic large question Paraphrasing dataset based on the AskUbuntu Stack Overflow forum had been recently proposed (Lei et al., 2015).17 In a multi-lingual context, sentence-level MT Quality Estimation is a meta-task with several available datasets.18 While the tasks of Semantic Textual Similarity (supported by a dataset from the STS track of the SemEval conferences (Agirre et al., 17The task resembles paraphrasing, but is evaluated as an Information Retrieval task much closer to Answer Sentence Selection. 18http://www.statmt.org/wmt15/ quality-estimation-task.html 2015)) and Paraphrasing (based on the Microsoft Research Paraphrase Corpus (Dolan and Brockett, 2005) right now) are available within our frame- work, we do not report the results here as the models lag behind the state-of-art significantly and show little difference in results. Advancing the models to be competitive remains future work. A generalization of our proposed architecture could be applied to the Hypothesis Evidencing task of binary classification of a hypothesis sentence s0 based on a number of memory sentences s1, for example within the MCText (Richardson et al., 2013) dataset. We also did not include several major classes of models in our initial evaluation. Most notably, this includes serial RNNs with at- tention as used e.g. for the RTE task (Rocktaschel et al., 2015), and the skip-thoughts method of sen- tence embedding. (Kiros et al., 2015) We believe that the Ubuntu Dialogue Dataset results demonstrate that the time is ripe to push Model ∗ TF-IDF ∗ RNN ∗ LSTM ∗ MemN2N 3-hop avg DAN RNN CNN RNN-CNN attn1511 MRR 1-2 R@1 1-10 R@1 1-10 R@2 1-10 R@5 0.749 0.777 0.869 0.624 0.793 0.488 0.379 0.552 0.637 0.472 ±0.002 ±0.002 ±0.002 0.578 0.792 ±0.070 ±0.035 0.781 0.907 ±0.003 ±0.002 0.718 0.863 ±0.003 ±0.002 0.788 0.911 ±0.001 ±0.001 0.772 0.903 ±0.004 ±0.002 0.493 ±0.074 0.664 ±0.004 0.587 ±0.004 0.672 ±0.002 0.653 ±0.005 0.587 0.561 0.721 0.608 ±0.002 0.615 ±0.059 0.799 ±0.004 0.721 ±0.005 0.809 ±0.002 0.788 ±0.005 0.763 0.836 0.924 0.836 ±0.003 0.830 ±0.033 0.951 ±0.001 0.907 ±0.003 0.956 ±0.001 0.945 ±0.002 Figure 3: Model results on the Ubuntu Dialogue next utterance ranking task. Models use slightly specific configuration due to much bigger dataset (in terms of both samples and sentence lengths) - only 160 tokens are considered per input, no dropout is applied, RNN use N memory units, projection matrix is only N × N and the dot-product scorer is used for comparison. The attn1511 model furthermore has only N/2 RNN memory units and N/2 CNN filters. ∗ Exact models from (Lowe et al., 2015) reran on the v2 version of the dataset (by personal communication with Ryan Lowe) - note that the results in (Lowe et al., 2015) and (Kadlec et al., 2015) are on dataset v1 and not directly comparable. Model (Mueller and Thyagarajan, 2016) (Lai and Hockenmaier, 2014) (Bowman et al., 2015) LSTM (Bowman et al., 2015) Tran. (Cheng et al., 2016) TF-IDF BM25 avg DAN RNN CNN RNN-CNN attn1511 Ubu. RNN SNLI RNN SICK-2014 SICK-2014 SICK-2014 STS r test 0.882 0.479 0.474 0.621 ±0.017 0.642 ±0.016 0.664 ±0.022 0.762 ±0.006 0.790 ±0.005 0.723 ±0.009 0.799 ±0.009 0.798 ±0.007 3-RTE train 0.842 1.000 0.999 0.770 ±0.020 0.715 ±0.010 0.759 ±0.016 0.927 ±0.008 0.765 ±0.084 0.858 ±0.010 0.931 ±0.017 0.927 ±0.006 3-RTE test 0.842 0.845 0.713 0.808 0.652 ±0.017 0.662 ±0.003 0.732 ±0.010 0.799 ±0.004 0.709 ±0.059 0.767 ±0.004 0.813 ±0.005 0.831 ±0.002 SNLI 3-RTE train SNLI 3-RTE test 0.848 0.776 0.921 0.890 0.735 ±0.014 0.718 ±0.009 0.784 ±0.019 0.710 ±0.008 0.708 ±0.002 0.749 ±0.010 0.811 ±0.037 0.829 ±0.014 0.753 ±0.008 0.774 ±0.004 Figure 4: Model results on the STS and RTE tasks, reporting Pearson's r and 3-class accuracy, respectively. The SNLI Tran. baseline transfers SNLI-learned weights to the SICK-2014 task. the research models further towards the real-world by allowing for wider sentence variability and less explicit supervision. But in particular, we believe that new models should be developed and tested on tasks with long sentences and wide vocabulary. In terms of models, recent work in many NLP domains (dos Santos et al., 2016) (Cheng et al., 2016) (Kumar et al., 2015) clearly points towards various forms of attention modelling to remove the bottleneck of having to compress the full spectrum of semantics into a single vector of fixed dimen- sionality. In this paper, we have shown the benefit of training a model on a single dataset and then applying it on another dataset. One open ques- tion is whether we could jointly train a model on multiple tasks simultaneously (even if they do not share some output layers). Another option would be to include extra supervision similar to the token overlap features that we already employ; for ex- ample, in the new Answer Sentence Selection task datasets, we can explicitly mark the actual tokens representing the answer. Acknowledgments This work was financially supported by the Grant Agency of the Czech Technical University in Prague, grant No. SGS16/ 084/OHK3/1T/13, and the Augur Project of the Fore- cast Foundation. Computational resources were provided by the CESNET LM2015042 and the CERIT Scientific Cloud LM2015085, provided under the programme "Projects of Large Research, Development, and Innovations Infrastruc- tures." We'd like to thank Tom´as Tunys, Rudolf Kadlec, Ryan Lowe, Cicero Nogueira dos santos and Bowen Zhou for help- ful discussions and their insights, and Silvestr Stanko and Jir´ı N´advorn´ık for their software contributions. References Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Wei- wei Guof, Inigo Lopez-Gazpio, Montse Maritxalar, Rada Mihalcea, et al. 2015. Semeval-2015 task 2: Semantic textual similarity, english, spanish and pi- lot on interpretability. Petr Baudis and Jan Sediv´y. 2015. Modeling of the question answering task in the YodaQA system. In Experimental IR Meets Multilinguality, Multimodal- ity, and Interaction, pages 222–228. Springer. Petr Baudis. 2015. YodaQA: A Modular Question An- swering System Pipeline. In POSTER 2015 - 19th International Student Conference on Electrical En- gineering. Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on freebase from question-answer pairs. 1544. In EMNLP, pages 1533– Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large an- notated corpus for learning natural language infer- ence. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguis- tics. Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. 2005. Learning to rank using gradient descent. In Proceedings of the 22nd international conference on Machine learning, pages 89–96. ACM. Jianpeng Cheng, Li Dong, and Mirella Lapata. 2016. Long short-term memory-networks for machine reading. CoRR, abs/1601.06733. KyungHyun Cho, Bart van Merrienboer, Dzmitry Bah- danau, and Yoshua Bengio. 2014. On the properties of neural machine translation: Encoder-decoder ap- proaches. CoRR, abs/1409.1259. Franc¸ois Chollet. 2015. Keras. https://github. com/fchollet/keras. Ido Dagan, Oren Glickman, and Bernardo Magnini. 2006. The PASCAL recognising textual entailment challenge. In Machine learning challenges. evalu- ating predictive uncertainty, visual object classifica- tion, and recognising tectual entailment, pages 177– 190. Springer. Jesse Dodge, Andreea Gane, Xiang Zhang, Antoine Bordes, Sumit Chopra, Alexander Miller, Arthur Szlam, and Jason Weston. 2015. Evaluating prereq- uisite qualities for learning end-to-end dialog sys- tems. CoRR, abs/1511.06931. William B Dolan and Chris Brockett. 2005. Automati- cally constructing a corpus of sentential paraphrases. C´ıcero Nogueira dos Santos, Ming Tan, Bing Xiang, and Bowen Zhou. 2016. Attentive pooling net- works. CoRR, abs/1602.03609. Hua He, Kevin Gimpel, and Jimmy Lin. 2015. Multi- perspective sentence similarity modeling with con- volutional neural networks. Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Su- leyman, and Phil Blunsom. 2015. Teaching ma- chines to read and comprehend. In Advances in Neu- ral Information Processing Systems, pages 1684– 1692. Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daum´e III. 2015. Deep unordered compo- sition rivals syntactic methods for text classification. Rudolf Kadlec, Martin Schmid, and Jan Kleindienst. 2015. Improved deep learning baselines for ubuntu corpus dialogs. arXiv preprint arXiv:1510.03753. Aliaksei Severyn and Alessandro Moschitti. 2015. Learning to rank short text pairs with convolutional deep neural networks. In Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 373–382. ACM. Kai Sheng Tai, Richard Socher, and Christopher D. Manning. 2015. Improved semantic representa- tions from tree-structured long short-term memory networks. CoRR, abs/1503.00075. Ming Tan, Bing Xiang, and Bowen Zhou. 2015. Lstm- based deep learning models for non-factoid answer selection. CoRR, abs/1511.04108. Mengqiu Wang, Noah A Smith, and Teruko Mita- mura. 2007. What is the jeopardy model? a quasi- synchronous grammar for qa. In EMNLP-CoNLL, volume 7, pages 22–32. Jason Weston, Sumit Chopra, and Antoine Bordes. 2014. Memory networks. CoRR, abs/1410.3916. Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. 2015. Towards ai-complete ques- tion answering: A set of prerequisite toy tasks. CoRR, abs/1502.05698. Kun Xu, Yansong Feng, Siva Reddy, Songfang Huang, and Dongyan Zhao. 2016. Enhancing freebase question answering using textual evidence. CoRR, abs/1603.00957. Yi Yang, Wen-tau Yih, and Christopher Meek. 2015. Wikiqa: A challenge dataset for open-domain ques- tion answering. Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. 2015. Semantic parsing via staged query graph generation: Question answering with knowledge base. July. Lei Yu, Karl Moritz Hermann, Phil Blunsom, and Stephen Pulman. 2014. Deep learning for answer sentence selection. CoRR, abs/1412.1632. Yoon Kim. 2014. works for sentence classification. arXiv:1408.5882. Convolutional neural net- arXiv preprint Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Advances in Neural Information Processing Sys- tems, pages 3276–3284. 2015. Ankit Kumar, Ozan Irsoy, Jonathan Su, James Brad- bury, Robert English, Brian Pierce, Peter Ondruska, Ishaan Gulrajani, and Richard Socher. 2015. Ask me anything: Dynamic memory networks for natu- ral language processing. CoRR, abs/1506.07285. Alice Lai and Julia Hockenmaier. 2014. Illinois-lh: A denotational and distributional approach to seman- tics. Proc. SemEval. Tao Lei, Hrishikesh Joshi, Regina Barzilay, Tommi S. Jaakkola, Kateryna Tymoshenko, Alessandro Mos- chitti, and Llu´ıs M`arquez i Villodre. 2015. De- noising bodies to titles: Retrieving similar ques- tions with recurrent convolutional models. CoRR, abs/1512.05726. Ryan Lowe, Nissan Pow, Iulian Serban, and Joelle Pineau. 2015. The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dia- logue systems. CoRR, abs/1506.08909. Marco Marelli, Luisa Bentivogli, Marco Baroni, Raf- faella Bernardi, Stefano Menini, and Roberto Zam- parelli. 2014. Semeval-2014 task 1: Evaluation of compositional distributional semantic models on full sentences through semantic relatedness and textual entailment. SemEval-2014. Jonas Mueller and Aditya Thyagarajan. 2016. Siamese recurrent architectures for learning sentence similar- ity. In Thirtieth AAAI Conference on Artificial Intel- ligence. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Nat- ural Language Processing (EMNLP), pages 1532– 1543. Matthew Richardson, Christopher JC Burges, and Erin Renshaw. 2013. Mctest: A challenge dataset for the open-domain machine comprehension of text. Stephen E Robertson, Steve Walker, Susan Jones, et al. 1995. Okapi at trec-3. Tim Rocktaschel, Edward Grefenstette, Karl Moritz Hermann, Tom´as Kocisk´y, and Phil Blunsom. 2015. Reasoning about entailment with neural attention. CoRR, abs/1509.06664.
1912.04778
1
1912
2019-12-10T15:50:50
GeBioToolkit: Automatic Extraction of Gender-Balanced Multilingual Corpus of Wikipedia Biographies
[ "cs.CL" ]
We introduce GeBioToolkit, a tool for extracting multilingual parallel corpora at sentence level, with document and gender information from Wikipedia biographies. Despite thegender inequalitiespresent in Wikipedia, the toolkit has been designed to extract corpus balanced in gender. While our toolkit is customizable to any number of languages (and different domains), in this work we present a corpus of 2,000 sentences in English, Spanish and Catalan, which has been post-edited by native speakers to become a high-quality dataset for machinetranslation evaluation. While GeBioCorpus aims at being one of the first non-synthetic gender-balanced test datasets, GeBioToolkit aims at paving the path to standardize procedures to produce gender-balanced datasets
cs.CL
cs
GeBioToolkit: Automatic Extraction of Gender-Balanced Multilingual Corpus of Wikipedia Biographies Marta R. Costa-juss`a, Pau Li Lin, Cristina Espana-Bonet∗ TALP Research Center, Universitat Polit`ecnica de Catalunya, Barcelona ∗ DFKI GmBH and Saarland University, Saarbrucken [email protected], [email protected], [email protected] Abstract We introduce GeBioToolkit, a tool for extracting multilingual parallel corpora at sentence level, with document and gender information from Wikipedia biographies. Despite the gender inequalities present in Wikipedia, the toolkit has been designed to extract corpus balanced in gender. While our toolkit is customizable to any number of languages (and different domains), in this work we present a corpus of 2,000 sentences in English, Spanish and Catalan, which has been post-edited by native speakers to become a high-quality dataset for machine translation evaluation. While GeBioCorpus aims at being one of the first non-synthetic gender-balanced test datasets, GeBioToolkit aims at paving the path to standardize procedures to produce gender-balanced datasets. Keywords: corpora, gender bias, Wikipedia, machine translation 1. Introduction Gender biases are present in many natural language pro- cessing applications (Costa-juss`a, 2019). This comes as an undesired characteristic of deep learning architectures where their outputs seem to reflect demographic asymme- tries (Prates et al., 2018). This is of course not due to the architecture itself but to the data used to train a system. Re- cent research is being devoted to correct the asymmetries mainly by data augmentation techniques in fields such as coreference resolution (Rudinger et al., 2018; Zhao et al., 2018; Webster et al., 2018) or abusive language detection (Park et al., 2018). Test sets have been created in those cases, but we are not aware of any test set available for ma- chine translation (MT). From another side, machine translation either neural, sta- tistical or rule-based, usually operates in a sentence-by- sentence basis. However, when translating consistently a document, surrounding sentences may have valuable infor- mation. The translation of pronouns, verb tenses and even content words might depend on other fragments within a document. This affects also the translation of the gender markers, specially when translating from a language with- out these marks (e.g. English) into a language with them (e.g. Catalan). Test sets at sentence level are not useful to evaluate these phenomena. But in the time of claims of human parity in MT, all these phenomena are crucial, and document-level evaluation is needed in order to discrimi- nate among systems (Laubli et al., 2018). Beyond these gender-balanced and document-level needs, the rise of multilingual neural machine translation and the lack of multi-way parallel corpus that can evaluate its abil- ities (e.g. zero-shot), motivates the creation of new multi- lingual corpora. In turn, this motivation prompts the devel- opment of software to automatically create such corpora. In order to create a GeBioToolkit that is able to system- atically extract multilingual parallel corpus at sentence level and with document-level information, we rely on Wikipedia, a free online multilingual encyclopedia written by volunteers. The toolkit is customizable for languages and gender-balance. We take advantage of Wikipedia mul- tilinguality to extract a corpus of biographies, being each biography a document available in all the selected lan- guages. However, given the bias in the representation of males and females also in Wikipedia (Bamman and Smith, 2014) and, to deliver a balanced set, we need to identify and select a subset of documents just after the toolkit performs the extraction of parallel sentences so it can assure parity. Note that our document-level extraction is consistent (all sentences in a document belong to the same personality) but the documents do not keep coherence anymore, since we are removing some sentences within that document. In our experiments in English -- Spanish -- Catalan, GeBioToolkit is able to extract parallel sentences with 87.5% accuracy ac- cording to a human evaluation. Besides providing the tool, we also manually post-edited a small subset of the English (en), Spanish (es) and Cata- lan (ca) outputs to provide a test dataset which is ready- to-use for machine translation applications; to our knowl- edge the first gender-balanced dataset extracted from real texts in the area: GeBioCorpus. With these three languages we aim to cover two linguistic families (Germanic and Ro- mance) which differ in morphology and specifically in gen- der inflection. The choice in languages is intended to allow the evaluation of machine translation outputs in three dif- ferent settings: distant morphologies for a high-resourced language pair (English -- Spanish) and a low-resourced pair (English -- Catalan), and closely related languages (Spanish -- Catalan). The latter responds the challenge recently initi- ated in the WMT International Evaluation1. We used na- tive/fluent speakers to provide post-editions on the final multilingual set in the three languages. The rest of the paper is organized as follows. Section 2. describes some available multilingual datasets used for machine translation evaluation, related work on parallel sentence extraction from Wikipedia and a brief mention 1http://www.statmt.org/wmt19/similar.html to general research lines on gender bias in NLP. Sec- tion 3. describes the architecture of the tool and Section 4. the methodology, evaluation and characteristics of the ex- tracted corpora. Finally, Section 5. summarizes the work and points at several future extensions of GeBioToolkit. 2. Related Work There are several multilingual parallel datasets available to evaluate MT outputs. The corpora covering more lan- guages are JRC-Acquis (Acquis Communautaire) and the TED talks corpus. Arab-Acquis (Habash et al., 2017) is a multilingual dataset for 22 European languages plus Ara- bic with more than 12,000 sentences coming from JRC- Acquis, that is, a collection of legislative texts of the Eu- ropean Union. In order to make the test set equal in all the languages, only sentences that are parallel simultaneously in the 22 languages were extracted (Koehn et al., 2009) and, therefore, the document structure of the data is lost. The Web Inventory of Transcribed and Translated Talks, WIT3(2), includes English subtitles from TED talks and their translations currently in 109 languages. Parallel cor- pora are extracted for several pairs (Cettolo et al., 2012) and test sets are annually prepared for the International Workshop on Spoken Language Translation (IWSLT) eval- uation campaigns. Test sets exist for all the pairs among German, English, Italian, Dutch and Romanian; and from English to Arabic, Basque, Chinese, Czech, Dutch, Farsi, French, German, Hebrew, Italian, Japanese, Korean, Pol- ish, Portuguese-Brazil, Romanian, Russian, Slovak, Slove- nian, Spanish, Thai, Turkish and Vietnamese. In this case the whole talks are aligned at sentence level, so, the docu- ment structure is kept but the set is not equivalent in all the languages. Similarly, the news translation task at the annual workshops and conferences on statistical machine translation (WMT) distributes collections of parallel news to their participants. Test sets have been created over the years for pairs includ- ing English into Chinese, Czech, Estonian, Finnish, French, German, Hindi, Hungarian, Kazakh, Latvian, Spanish, Ro- manian, Russian and Turkish. Again, the document struc- ture is kept in the dataset but, in general, the set is not equiv- alent in all the languages. Wikipedia is widely used in natural language processing and it is an excellent resource for multilingual tasks, par- allel sentence extraction being among them. However, we do not know of any multilingual corpus of biographies ex- tracted from the resource. On the monolingual side, one can find WikiBiography3, a corpus of 1,200 biographies in German with automatic annotations of PoS, lemmas, syn- tactic dependencies, anaphora, discourse connectives, clas- sified named entities and temporal expressions. The authors in Bamman and Smith (2014) also extract 927,403 biogra- phies in this case from the English Wikipedia. The set is pre-processed in order to learn event classes in biographies. Regarding the automatic extraction of parallel corpora, In Wikipedia has been traditionally used as a resource. Adafre and de Rijke (2006), the authors extract parallel sentences based on the available metadata in Wikipedia texts. Both Yasuda and Sumita (2008) and Plamada and Volk (2012) extracted parallel sentences by translating the articles into a common language and consider those sen- tences with a high translation quality to be parallel. The ACCURAT project (S¸tefanescu et al., 2012; Skadin¸a et al., 2012) also devoted efforts in parallel sentence mining in Wikipedia. Later, Barr´on-Cedeno et al. (2015) used the combination of cross-lingual similarity measures to extract domain specific parallel sentences. The most recent initia- tive is the so-called LASER (Artetxe and Schwenk, 2019b), which relies on vector representations of sentences to ex- tract similar pairs. This toolkit has been used to extract the WikiMatrix corpus (Schwenk et al., 2019) which contains 135 million parallel sentences for 1,620 different language pairs in 85 different languages. As far as we are concerned, there is no gender-balanced dataset for machine translation, except for the artificial gold standard created for English -- Spanish (Font and Costa- juss`a, 2019). However, there are a notable number of works towards doing research in the area: from balancing data sets in monolingual tasks (Webster et al., 2018; Rudinger et al., 2018) to evaluating gender bias in several tasks (Basta et al., 2019; Stanovsky et al., 2019). 3. GeBioToolkit 3.1. Base Architecture To extract the corpus previously introduced, we develop GeBioToolkit. The tool retrieves (multi-)parallel sentences for any Wikipedia category and for any arbitrary number of languages at the same time. In its default configuration, the toolkit retrieves gender-balanced corpora. GeBioToolkit is composed by three blocks. The first block, corpus extrac- tor, provides a layer to transform, collect and select entries in the desired languages. The second block, corpus align- ment, finds the parallel sentences within a text and provides a quality check of the parallel sentences given a few restric- tions. The third block, gender classifier, includes a filtering module which classifies the gender of the entry and outputs the final parallel corpus. The gender detection functionality can be activated or deactivated at will, allowing the tool to be used in a more general context, where gender-balanced data is either non-relevant or not needed. Figure 1 depicts its architecture. The tool requires three inputs: (i) a list of the desired lan- guages, (ii) the dump files for the languages4 and (iii) a list of the articles' titles belonging to the category to ex- tract (currently in English). For our purpose of gathering a corpus of biographies, we retrieve the list of articles that belong to the "living people" category by using the PetScan tool5. The corpus extractor module starts by looking for the equivalent articles to those input in the other languages via the Wikipedia interlanguage links. The module also retrieves the multilingual titles providing a dictionary of 2https://wit3.fbk.eu/ 3https://www.h-its.org/en/research/nlp/ wikibiography-corpus/ 4Dumps can be downloaded from https://dumps.wikimedia.org/ 5https://petscan.wmflabs.org/ Figure 1: GeBioToolkit architecture {english entry title: [language, title]} that is used on the file extraction and file selection modules. File extraction retrieves then the selected entries in the previous dictionary from the Wikipedia dump. GeBioToolkit uses a modified version of the wikiextractor6 software to retrieve and store the different Wikipedia entries from each language. Finally, file selection generates a dictionary similar to the one ob- tained before, but it only stores the entries for which the files were successfully retrieved. The corpus alignment module makes use of the text and dictionaries retrieved in the previous step and the LASER toolkit7. LASER (Language-Agnostic SEntence Repre- sentations) allows to obtain sentence embeddings through a multilingual sentence encoder (Schwenk et al., 2019). Translations can be found then as close pairs (tuples) in the multilingual semantic space. In order to perform the par- allel sentence extraction, we follow the margin-based crite- rion introduced in Artetxe and Schwenk (2019a). The mar- gin between two candidate sentences x and y is defined as the ratio between the cosine distance between the two em- bedded sentences, and the average cosine similarity of its nearest neighbors in both directions: margin(x, y) = cos (x,y) , (cid:80) 2k + (cid:80) cos(x,z) z∈N Nk(x) z∈N Nk(y) cos(y,z) 2k where N Nk(x) denotes the k unique nearest neighbors of x in the other language, N Nk(y) the same for y. To extract parallel sentences on more than two languages, let us say i languages, we use a greedy approach with a pivot language L1. We detect all the parallel sentences in the pairs L1 -- Li and then extract the intersection of sen- tences between the language pairs. 6https://github.com/attardi/wikiextractor 7https://github.com/facebookresearch/ LASER 3.2. Gender Detection Module The previous two blocks implement a general approach to parallel sentence extraction following a similar methodol- ogy as that used to extract the WikiMatrix corpus. But for our purpose, we need to specifically deal with gender bias. Wikipedia is known to have a gender bias in its content. Depending on the language and year of the study, the per- centage of biographies of women with respect to the total of biographies ranges from a 13% to a 23% (Reagle and Rhue, 2011; Bamman and Smith, 2014; Wagner et al., 2016). And it is not only this, but also men and women are charac- terised differently (Graells-Garrido et al., 2015; Wagner et al., 2016), showing for instance more man in sports and woman in divorces (Reagle and Rhue, 2011). To allow extracting a gender-balanced dataset, we detect the gender automatically and filter files in order to have 50% of articles for each gender. Following Reagle and Rhue (2011), the gender of the article is extracted as that corresponding to the maximum number of gendered pro- nouns (i.e., he and she in English) mentioned in the article. According to their results, this method of gender inference is overwhelmingly accurate, in a random test set of 500 ar- ticles, it achieved 100% precision with 97.6% recall (12 articles had no pronominal mentions and so gender was not assigned). 3.3. Cleaning Module We analyse the accuracy of the extractions in Section 4.3., but a simple visual inspection already shows a frequent source of noise in the extracted data that can be easily re- moved with a post-processing step. Some of the extracted sentence pairs include information in one language that is lacking in the other one(s). For example, the sentence in Spanish "Mahrez se cas´o con su novia inglesa en 2015 y tuvieron una hija ese mismo ano." is aligned with the sen- tence in English "Mahrez married his English girlfriend <doc docid="Aurelia Arkotxa " wpid="51690640" language="en" topic="C6" gender="Female" > <title>Aurelia Arkotxa </title> <seg id="1">She teaches classics at the University of Bayonne; she was co-founder of the literary magazine and a new newspaper.<\seg> </doc> <doc docid="Catriona Gray " wpid="51838666" language="en" topic="C2" gender="Female"> <title>Catriona Gray </title> <seg id="1">In addition, she obtained a certificate in outdoor recreation and a black belt in Choi Kwang-Do martial arts.<\seg > <seg id="2>Catriona Elisa Magnayon Gray (born 6 January 1994) is a Filipino-Australian model, singer, and beauty pageant titleholder who was crowned Miss Universe 2018.<\seg> <seg id="3">Gray was born in Cairns, Queensland, to a Scottish-born father, Ian Gray, from Fraserburgh, and a Filipina mother, Normita Ragas Magnayon, from Albay.<\seg > </doc> <doc docid="Aurelia Arkotxa" wpid="7789214" language="es" topic="C6" gender="Female" > <title>Aurelia Arkotxa</title > <seg id="1">Ensena cultura cl´asica en la facultad de Bayona; fue cofundadora de una revista literaria y de un diario.<\seg> </doc> <doc docid="Catriona Gray" wpid="8411924" language="es" topic="C2" gender="Female" > <title>Catriona Gray </title > <seg id="1">Adem´as, obtuvo un Certificado en Recreaci´on al Aire Libre y un cintur´on negro en Artes Marciales de Choi Kwang-Do.<\seg> <seg id="2">Catriona Elisa Magnayon Gray (6 de enero de 1994) es una modelo y reina de belleza australiana-filipina, ganadora de Miss Universo 2018 representando a Filipinas.<\seg> <seg id="3">Gray naci´o en Cairns, Queensland de un padre australiano nacido en Escocia, Ian Gray, de y una madre filipina, Normita Ragas Magnayon, de Albay.<\seg> </doc> Table 1: Example of two documents extracted in English (top) and the parallel counterparts in Spanish (bottom) from GeBioCorpus-v2. Rita Johal in 2015.", where the Spanish segment "y tu- vieron una hija ese mismo ano." is not present in English. To avoid this, we filter out sentence pairs with large length ratio (filter samples in which one of the sentences is at least 20% longer than the others). Such filtering can be gen- eralised to distant language pairs by estimating language- dependent length factors (Pouliquen et al., 2003) or consid- ering more elaborated corpus filtering techniques (Koehn et al., 2019). 3.4. File Restructure Module Finally, the extracted parallel sentences are written as an xml file using a document-level mark-up. As said before, output documents do not preserve coherence any more, but document-level characteristics such as lexical consistency are kept and the mark-up allows use the information. Table 1 shows an excerpt of the output file for English and Spanish. For each original biography, we keep the En- glish title as document ID, the original Wikipedia ID, the extracted gender, and in our clean test set (see Section 4.) we also add the topic or category of each document. The docid field links documents among languages. 4. GeBioCorpus We use the GeBioToolkit presented in the above section to extract a multilingual parallel corpus balanced in gender for English, Spanish and Catalan. The motivation for extract- ing this specific dataset is the variation in morphology in English (Germanic language) as compared to Spanish and Catalan (Romance languages). The variation in morphol- ogy is one of the most relevant challenges when solving biases in gender, see examples in (Prates et al., 2018; Font and Costa-juss`a, 2019). 4.1. Data Statistics We extract all the articles belonging to the category "living people" in the 40 largest Wikipedia editions to have a rough idea of the number of biographies available per language. Figure 2 shows the amount of these articles for the 20 lan- guages with the largest number of biographies. The edi- tion with the most available entries is the English one with 922,120 entries. The Spanish Wikipedia contains 148,445 entries (6th largest one) and the Catalan edition 40,983 (20th largest one). All three are highlighted in Figure 2. Even if the Catalan Wikipedia is not as big as the English and Spanish ones, there is a noticeable amount of compara- ble articles between Spanish and Catalan which translates into significant number of parallel sentences -- Schwenk et al. (2019) extracted in WikiMatrix 3,377 k sentences for en -- es, 1,580 k sentences for ca -- es and 210 k sentences for en -- ca from the full editions. GeBioToolkit extracts multilingually aligned parallel sen- tences, so it is interesting to study also the union of lan- guages. The more languages involved, the lesser number or comparable articles one will obtain. Figure 3 shows the number of articles per sets of languages and broken-down by gender. The total number of documents decays when starting with English and Arabic (set with only 2 languages) and one incrementally adds French, German, Italian, Span- ish, Polish, Russian, Portuguese, Japanese and Dutch. With all languages (set with 11 languages), the number of com- parable documents results in 17,285, out of which 13,676 are male bios and 3,609 are female bios. These numbers reconfirm the results by (Reagle and Rhue, 2011; Bamman and Smith, 2014; Wagner et al., 2016) on the underrepre- sentation of women in Wikipedia. Note that by doing the union of different languages and the intersection of its ar- ticles, the amount of documents decays quite abruptly, but the percentual difference between man and woman remains close to be constant. When we consider English, Spanish and Catalan, we re- trieve 31,413 bibliographies. GeBioToolkit selects 81,405 sentences from them, 53,389 sentences are related to male bibliographies and 28,016 to female bibliographies. 47.5% of the male sentences are removed to obtain a gender- balanced corpus. Then, GeBioToolkit performs the length- based cleaning, which filters the corpus down to 16,679 sentences on male bibliographies and 10,730 sentences on female bibliographies. As output, we provide two versions of the cor- pus. GeBioCorpus-v1 contains 16,000 sentences as ex- Figure 2: Number of Wikipedia entries under the "living people" category for the 20 Wikipedia editions with the most number of entries. Figure 3: Number of documents by sets of languages under the Wikipedia category "living people" distributed by gender. See Section 4.1. for the specific languages involved in the sets. Su poes´ıa se caracteriza por un lenguaje coloquial y por la reflexi´on a partir de acontecimientos o situaciones cotidianas. EN In 2008, she was honored by the Angolan Ministry of Culture with a certificate of honor for her services to Angolan children's literature. En 2008, fue honrada por el Ministerio de Cultura de Angola con un certificado de honor por sus servicios a la literatura infantil angolena. ES CA El 2008 va rebre el premi del Ministeri de Cultura angol`es amb un certificat d'honor pels seus serveis a la literatura infantil angolesa. EN His poetry is characterized by a colloquial language and by his reflections regarding every day events or situations. ES CA La seva poesia es caracteritza per un llenguatge col·loquial i per la reflexi´o a partir d'esdeveniments o situacions quotidianes. EN Bridegroom was an actor and songwriter who hosted the TV series "The X Effect". ES CA Bridegroom era un actor i compositor que va participar de la s`erie de televisi´o "The X Effect." EN She was also recognised in 2015 by the British Council for her community work, and by the BBC as part of their "100 Women" series. Tambi´en fue reconocida en 2015 por el British Council por su trabajo comunitario, y por la BBC como parte de su serie "100 Women (BBC)". ES CA Tamb´e va ser reconeguda el 2015 pel British Council pel seu treball comunitari, i per la BBC com a part de la seva s`erie "100 Women (BBC)". Bridegroom era un actor y compositor qui´en particip´o de la serie de televisi´on "El Efecto X. Table 2: Examples of parallel segments extracted for English, Spanish and Catalan from GeBioCorpus-v2. tracted from Wikipedia without any manual post-edition. GeBioCorpus-v2 contains 2,000 sentences with manual post-edition as explained in Section 4.2.. One set excludes the other in addition to excluding other sentences (1730 for female) that we plan to post-edit in the future. See statistics on number of documents, sentences, words and vocabulary broken-down per language and gender in Table 3. Table 2 provides some examples of sentences from GeBioCorpus- v2. 4.2. Manual Post-Editing and Categorization After the extraction of the complete corpus, and in order to provide a high-quality evaluation corpus, we ask na- tive/fluent speakers to post-edit 2,000 sentences belonging GeBioCorpus-v1 En Es Ca Documents Sentences Average sent/doc Words Average words/doc Vocabulary GeBioCorpus-v2 Documents Sentences Average sent/doc Words Average words/doc Vocabulary F 2287 8000 3.5 228.9k 56.9 24.3k F 257 1000 3.9 28.7k 61.6 6.1k M 2741 8000 2.9 235.3k 51.1 24.8k F 2287 8000 3.5 230.1k 56.3 27.1k M 2741 8000 2.9 236.0k 47.3 27.6k F 2287 8000 3.5 240.9k 59.8 27.6k En Es Ca M 339 1000 2.9 27.5k 46.6 6.0k F 257 1000 3.9 28.9k 61.4 6.5k M 339 1000 2.9 28.0k 46.4 6.5k F 257 1000 3.9 30.1k 65.4 6.7k M 2741 8000 2.9 245.7k 53.3 28.0k M 339 1000 2.9 29.4k 49.7 6.6k Table 3: Statistics for the two corpora extracted by GeBioToolkit without (GeBioCorpus-v1) and with (GeBioCorpus-v2) manual post-edition on the raw output. 4.3. Human Evaluation Finally, we perform a human evaluation on the qual- ity of GeBioCorpus-v1, that is, the data as extracted by GeBioToolkit without any post-edition. For this, we ran- domly select 50 sentences in the three languages (English, Spanish and Catalan) and present each tuple to 7 differ- ent native/fluent speakers. These annotators were asked to score a tuple with 1 if the three sentences convey the same meaning and 0 otherwise. On average, evaluators gave 87.5% accuracy and when computing the majority vote among the evaluators accuracy reached 96%. We com- puted Fleiss' kappa (Fleiss and others, 1971) as a measure for the interannotator agreement which resulted in 0.67, which is considered a substantial agreement9. On average, our GeBioToolkit plus filtering by length has 87.5% accu- racy. 5. Conclusions This paper presents two main contributions. From one side, GeBioToolkit, based on LASER, allows to automati- cally extract multilingual parallel corpora at sentence-level which can be customized in number of languages and bal- anced in gender. Document-level information is kept in the corpus and each document is tagged with the ID of the original Wikipedia article, the language and the gen- der of the person is referring to. From another side, we provide a multilingual corpus of biographies in English, Spanish and Catalan, GeBioCorpus. Two versions of this corpus are presented. The first version, GeBioCorpus-v1, contains 16k sentences which have been directly extracted using GeBioToolkit. This version of the corpus is used to make an evaluation of the quality of the extractions pro- duced by our tool. A manual evaluation shows that the ac- curacy in the multilingual parallel sentences is 87.5%. The second version of this corpus, GeBioCorpus-v2, contains Figure 4: Distribution of topic/categories for the manually annotated test set. The distribution is further split by genre (articles of women (F) and men (M)). See Section 4.2. for the categories defined. to both female and male documents. Annotators were asked to either edit segments to make them parallel (if differences were small) or to delete segments that were too different. Also during the process, annotators were asked to provide a topic for the profession of each personality. Categories are based on the Wikipedia list of occupations8, which in- cludes: (C1) Healthcare and medicine, (C2) Arts, (C3) Business, (C4) Industrial and manufacturing, (C5) Law en- forcement, social movements and armed forces, (C6) Sci- ence, technology and education, (C7) Politics, (C8) Reli- gion, and (C9) Sports. This corresponds to the field "topic" added in the header of each document as seen in Table 1. Figure 4 shows the distribution of the 9 topics by gender. Note that the most unbalanced topics are C5 (Law enforce- ment, social movements and armed forces), C8 (Religion) and C9 (Sports). We report other statistics for this test set in Table 3. 8https://en.wikipedia.org/wiki/Lists_of_ 9https://en.wikipedia.org/wiki/Fleiss%27_ occupations kappa 2k sentences which have been post-edited by native speak- ers and categorized with type of profession. In this case, and in addition to the automatic tags of each document (ID, language and gender), each document is tagged with an oc- cupation category. This labels allows to split the corpus in different subsets to evaluate domain-specific translations and gender accuracy for instance. As future improvements to the tool, we will remove the de- pendence on PetScan -- or any external tool to obtain lists of articles -- , and extract all the necessary information from the input Wikipedia dump. We will also study the viability of using Wikidata information instead of the most frequent pronoun in a text in order to classify the gender of an article. Both GeBioToolkit and GeBioCorpus will be made avail- able in github during the review process of this paper10. Acknowledgments The authors want to thank Jordi Armengol, Magdalena Biesialska, Casimiro Carrino, Noe Casas, Guillem Cort`es, Carlos Escolano, Gerard Gallego and Bardia Rafieian for their help in postediting the GeBioCorpus, Eduardo Lip- perheide, Anna Li, Ayyoub Marroun, Laura Termes, Adri`a Garcia, Alba Salomon and Clara Grenzner for the man- ual evaluation and Melissa Steiner, Ekaterina Lapshinova- Koltunski and Pauline Krielke for all the support and fruit- ful discussions. This work is supported in part by the Spanish Ministerio de Econom´ıa y Competitividad, the European Regional De- velopment Fund and the Agencia Estatal de Investigaci´on, through the postdoctoral senior grant Ram´on y Cajal, the contract TEC2015-69266-P (MINECO/FEDER,EU) and the contract PCIN-2017-079 (AEI/MINECO). It is also partially funded by the German Federal Ministry of Edu- cation and Research under the funding code 01IW17001 (Deeplee). Responsibility for the content of this publica- tion is with the authors. 6. Bibliographical References Adafre, S. and de Rijke, M. (2006). Finding Similar Sen- tences across Multiple Languages in Wikipedia. In Pro- ceedings of the 11th Conference of the European Chapter of the Association for Computational Linguistics, pages 62 -- 69. Artetxe, M. and Schwenk, H. (2019a). Margin-based par- allel corpus mining with multilingual sentence embed- dings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3197 -- 3203, Florence, Italy, July. Association for Computa- tional Linguistics. Artetxe, M. and Schwenk, H. (2019b). Massively multi- lingual sentence embeddings for zero-shot cross-lingual transfer and beyond. volume 7, pages 597 -- 610. MIT Press, September. Bamman, D. and Smith, N. A. (2014). Unsupervised Dis- covery of Biographical Structure from Text. Transac- tions of the Association for Computational Linguistics, 2:363 -- 376. 10https://github.com/PLXIV/Gebiotoolkit Barr´on-Cedeno, A., Espana-Bonet, C., Boldoba, J., and M`arquez, L. (2015). A Factory of Comparable Corpora In Proceedings of the 8th Workshop from Wikipedia. on Building and Using Comparable Corpora (BUCC), pages 3 -- 13, Beijing, China, July. Basta, C., Costa-juss`a, M. R., and Casas, N. (2019). Eval- uating the underlying gender bias in contextualized word embeddings. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 33 -- 39, Florence, Italy, August. Association for Computa- tional Linguistics. Cettolo, M., Girardi, C., and Federico, M. (2012). WIT3: Web Inventory of Transcribed and Translated Talks. In Proceedings of the 16th Conference of the European As- sociation for Machine Translation (EAMT), pages 261 -- 268, Trento, Italy, May. Costa-juss`a, M. R. (2019). An analysis of gender bias stud- ies in natural language processing. Nature Machine In- telligence, 1. S¸tefanescu, D., Ion, R., and Hunsicker, S. (2012). Hybrid Parallel Sentence Mining from Comparable Corpora. In Proceedings of the 16th Annual Conference of the Euro- pean Association for Machine Translation (EAMT 2012), Trento, Italy. European Association for Machine Trans- lation . Fleiss, J. et al. (1971). Measuring nominal scale agreement among many raters. Psychological Bulletin, 76(5):378 -- 382. Font, J. E. and Costa-juss`a, M. R. (2019). Equalizing gen- der biases in neural machine translation with word em- beddings techniques. CoRR, abs/1901.03116. Graells-Garrido, E., Lalmas, M., and Menczer, F. (2015). First Women, Second Sex: Gender Bias in Wikipedia. In Proceedings of the 26th ACM Conference on Hypertext &#38; Social Media, HT '15, pages 165 -- 174, New York, NY, USA. ACM. Habash, N., Zalmout, N., Taji, D., Hoang, H., and Alzate, M. (2017). A Parallel Corpus for Evaluating Machine Translation between Arabic and European Languages. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguis- tics: Volume 2, Short Papers, pages 235 -- 241, Valencia, Spain, April. Association for Computational Linguistics. Koehn, P., Birch, A., and Steinberger, R. (2009). 462 Ma- chine Translation Systems for Europe. In Proceedings of the Twelfth Machine Translation Summit, pages 65 -- 72. Association for Machine Translation in the Ameri- cas, AMTA. Koehn, P., Guzm´an, F., Chaudhary, V., and Pino, J. (2019). Findings of the WMT 2019 shared task on parallel cor- pus filtering for low-resource conditions. In Proceedings of the Fourth Conference on Machine Translation (Vol- ume 3: Shared Task Papers, Day 2), pages 54 -- 72, Flo- rence, Italy, August. Association for Computational Lin- guistics. Laubli, S., Sennrich, R., and Volk, M. (2018). Has ma- chine translation achieved human parity? A case for document-level evaluation. In Ellen Riloff, et al., edi- tors, Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Bel- gium, October 31 - November 4, 2018, pages 4791 -- 4796. Association for Computational Linguistics. Park, J. H., Shin, J., and Fung, P. (2018). Reducing Gen- der Bias in Abusive Language Detection. ArXiv e-prints, August. Plamada, M. and Volk, M. (2012). Towards a Wikipedia- the 5th extracted alpine corpus. Workshop on Building and Using Comparable Corpora: Language Resources for Machine Translation in Less- Resourced Languages and Domains, pages 81 -- 87, Istan- bul, Turkey, May. In Proceedings of Pouliquen, B., Steinberger, R., and Ignat, C. (2003). Auto- matic Identification of Document Translations in Large Multilingual Document Collections. In Proceedings of the International Conference on Recent Advances in Nat- ural Language Processing (RANLP-2003), pages 401 -- 408, Borovets, Bulgaria. Prates, M. O. R., Avelar, P. H. C., and Lamb, L. (2018). Assessing Gender Bias in Machine Translation -- A Case Study with Google Translate. ArXiv e-prints, September. Reagle, J. and Rhue, L. (2011). Gender Bias in Wikipedia International Journal of Communica- and Britannica. tion, 5(0). Rudinger, R., Naradowsky, J., Leonard, B., and Van Durme, B. (2018). Gender Bias in Coreference Resolution. In Proceedings of the Annual Meeting of the North Ameri- can Association of Computational Linguistics (NAACL). Schwenk, H., Chaudhary, V., Sun, S., Gong, H., and Guzm´an, F. (2019). Wikimatrix: Mining 135m parallel sentences in 1620 language pairs from wikipedia. CoRR, abs/1907.05791. Skadin¸a, I., Aker, A., Mastropavlos, N., Su, F., Tufis, , D., Verlic, M., Vasil¸jevs, A., Babych, B., Clough, P., Gaizauskas, R., Glaros, N., Paramita, M. L., and Pin- nis, M. (2012). Collecting and using comparable cor- pora for statistical machine translation. In Nicoletta Cal- zolari, et al., editors, Proceedings of the Eighth Inter- national Conference on Language Resources and Eval- uation (LREC 2012), Istanbul, Turkey, May. European Language Resources Association (ELRA). Stanovsky, G., Smith, N. A., and Zettlemoyer, L. (2019). Evaluating gender bias in machine translation. In Pro- ceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1679 -- 1684, Flo- rence, Italy, July. Association for Computational Lin- guistics. Wagner, C., Graells-Garrido, E., Garcia, D., and Menczer, F. (2016). Women through the glass ceiling: gender asymmetries in wikipedia. EPJ Data Science, 5(1):5, Mar. Webster, K., Recasens, M., Axelrod, V., and Baldridge, J. (2018). Mind the GAP: A Balanced Corpus of Gendered Ambiguous Pronouns. ArXiv e-prints, October. Yasuda, K. and Sumita, E. (2008). Method for Building Sentence-Aligned Corpus from Wikipedia. In Proceed- ings of the AAAI Workshop on Wikipedia and Artificial Intelligence: An Evolving Synergy, pages 64 -- 66, Menlo Park, CA. Zhao, J., Wang, T., Yatskar, M., Ordonez, V., and Chang, K.-W. (2018). Gender bias in coreference resolution: Evaluation and debiasing methods. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Lan- guage Technologies, Volume 2 (Short Papers), pages 15 -- 20. Association for Computational Linguistics.
1307.3336
1
1307
2013-07-12T06:20:36
Opinion Mining and Analysis: A survey
[ "cs.CL", "cs.IR" ]
The current research is focusing on the area of Opinion Mining also called as sentiment analysis due to sheer volume of opinion rich web resources such as discussion forums, review sites and blogs are available in digital form. One important problem in sentiment analysis of product reviews is to produce summary of opinions based on product features. We have surveyed and analyzed in this paper, various techniques that have been developed for the key tasks of opinion mining. We have provided an overall picture of what is involved in developing a software system for opinion mining on the basis of our survey and analysis.
cs.CL
cs
International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 OPINION MINING AND ANALYSIS: A SURVEY Arti Buche#1, Dr. M. B. Chandak#2, Akshay Zadgaonkar#3 Computer Science Department, RCOEM India [email protected] [email protected] *Zadgaonkar Software Pvt. Ltd. India 3 [email protected] ABSTRACT The current research is focusing on the area of Opinion Mining also called as sentiment analysis due to sheer volume of opinion rich web resources such as discussion forums, review sites and blogs are available in digital form. One important problem in sentiment analysis of product reviews is to produce summary of opinions based on product features. We have surveyed and analyzed in this paper, various techniques that have been developed for the key tasks of opinion mining. We have provided an overall picture of what is involved in developing a software system for opinion mining on the basis of our survey and analysis. KEYWORDS Opinion Mining, Sentiment Analysis, product reviews, machine learning 1. INTRODUCTION Natural Language Processing (NLP) deals with actual text element processing. The text element is transformed into machine format by NLP. Artificial Intelligence (AI) uses information provided by the NLP and applies a lot of maths to determine whether something is positive or negative. Several methods exist to determine an author’s view on a topic from natural language textual information. Some form of machine learning approach is employed and which has varying degree of effectiveness. One of the types of natural language processing is opinion mining which deals with tracking the mood of the people regarding a particular product or topic. This software provides automatic extraction of opinions, emotions and sentiments in text and also tracks attitudes and feelings on the web. People express their views by writing blog posts, comments, reviews and tweets about all sorts of different topics. Tracking products and brands and then determining whether they are viewed positively or negatively can be done using web. The opinion mining has slightly different tasks and many names, e.g. sentiment analysis, opinion extraction, sentiment mining, subjectivity analysis, affect analysis, emotion analysis, review mining, etc. However, they all come under the umbrella of sentiment analysis or opinion mining. Sentiment classification, feature based sentiment classification and opinion summarization are few main fields of research predominate in sentiment analysis. In recent years, we have witnessed that opinionated postings in social media have helped reshape businesses, and sway public sentiments and emotions, which have profoundly impacted on our social and political systems. Such postings have also mobilized masses for political changes such as those happened in some Arab countries in 2011. It has thus become a necessity to collect and study opinions on the Web. Of course, opinionated documents not only exist on the Web (called DOI : 10.5121/ijnlc.2013.2304 39 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 external data), many organizations also have their internal data, e.g., customer feedback collected from emails and call centres or results from surveys conducted by the organizations. Opinion mining can be useful in several ways. For example, in marketing, it tracks and judges the success rate of an ad campaign or launch of new product, determine popularity of products and services with its versions also tell us about demographics which like or dislike particular features. For example, a review might be about a digital camera might be broadly positive, but be specifically negative about how heavy it is. The vendor gets a much clearer picture of public opinion than surveys or focus groups, if this kind of information is indentified in a systematic way. The technique to detect and extract subjective information in text documents is opinion mining and sentiment analysis. In general, the overall contextual polarity or sentiment of a writer about some aspect can be determined using sentiment analysis. The main challenge in this area is the sentiment classification in which the sentiment may be a judgement, mood or evaluation of an object namely film, book, product, etc which can be in the form of document or sentence or feature that can be labelled as positive or negative. Classifying entire documents according to the opinions towards certain objects is called as sentiment classification. One form of opinion mining in product reviews is also to produce feature-based summary. To produce a summary on the features, product features are first identified, and positive and negative opinions on them are aggregated. Features are product attributes, components and other aspects of the product. The effective opinion summary, grouping feature expressions which are domain synonyms is critical. It is very time consuming and tedious for human users to group typically hundreds of feature expressions that can be discovered from text for an opinion mining application into feature categories. Some automated assistance is needed. Opinion summarization does not summarize the reviews by selecting a subset or rewrite some of the original sentences from the reviews to capture the main points as the classic text summarization. [2] The paper is organized into the following sections: the data sources used for opinion mining, introduces machine learning and sentiment analysis tasks for sentiment classification, text classification, tools available for sentiment classification and the performance evaluation. The last section concludes the study and discusses some future directions for research. 2. DATA SOURCE People and companies across disciplines exploit the rich and unique source of data for varied purposes. The major criterion for the improvement of the quality services rendered and enhancement of deliverables are the user opinions. Blogs, review sites and micro blogs provide a good understanding of the reception level of products and services. 2.1 Blogs The name associated to universe of all the blog sites is called blogosphere. People write about the topics they want to share with others on a blog. Blogging is a happening thing because of its ease and simplicity of creating blog posts, its free form and unedited nature. We find a large number of posts on virtually every topic of interest on blogosphere. Sources of opinion in many of the studies related to sentiment analysis, blogs are used. [3] 40 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 2.2. Review Sites Opinions are the decision makes for any user in making a purchase. The user generated reviews for products and services are largely available on internet. The sentiment classification uses reviewer’s data collected from the websites like www.gsmarena.com (mobile reviews), www.amazon.com (product reviews), www. CNETdownload.com (product reviews), which hosts millions of product reviews by consumers. [1] 2.3. Micro-blogging A very popular communication tool among Internet users is micro-blogging. Millions of messages appear daily in popular web-sites for micro-blogging such as Twitter, Tumblr, Facebook. Twitter messages sometimes express opinions which are used as data source for classifying sentiment. [4] 3. SENTIMENT CLASSIFICATION Sentiment classification or Polarity classification is the binary classification task of labelling an opinionated document as expressing either an overall positive or an overall negative opinion. A technique for analysing subjective information in a large number of texts, and many studies is sentiment classification. A typical approach for sentiment classification is to use machine learning algorithms. 3.1. Machine Learning A system capable of acquiring and integrating the knowledge automatically is referred as machine learning. The systems that learn from analytical observation, training, experience, and other means, results in a system that can exhibit self-improvement, effectiveness and efficiency. Knowledge and a corresponding knowledge organization are usually used by a machine learning system to test the machine interpret and analyse. One of the knowledge acquired, learning algorithms is taxonomy based depending on outcome of the algorithm or type of input available. • Supervised learning generates a function which maps inputs to desired outputs also called as labels because they are training examples labelled by human experts. Since it is a text classification problem, any supervised learning method can be applied, e.g., Naïve Bayes classification, and support vector machines • Unsupervised learning models a set of inputs, like clustering, labels are not known during training. Classification is performed using some fixed syntactic patterns which are used to express opinions. The part-of-speech (POS) tags are used to compose syntactic patterns. Semi-supervised learning generate an appropriate function or classifier in which both labelled and unlabelled examples are combined. [2, 5] • 3.2. Sentiment Analysis Tasks Sentiment analysis tasks mainly consists of classifying the polarity of a given text at the document, sentence or feature/aspect level expressing the opinion as positive, negative or neutral. The sentiment analysis can be performed at one of the three levels: the document level, sentence level, feature level. 41 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 • Document Level Sentiment Classification: In document level sentiment analysis main challenge is to extract informative text for inferring sentiment of the whole document . The learning methods can be confused because of objective statements are rendered by subjective statements and complicate further for document categorization task with conflicting sentiment. [6] • Sentence Level Sentiment Classification: The sentiment classification is a fine-grained level than document level sentiment classification in which polarity of the sentence can be given by three categories as positive, negative and neutral. The challenge faced by sentence level sentiment classification is the identification features indicating whether sentences are on-topic which is kind of co-reference problem [6] • Feature Level Sentiment Classification: Product features are defined as product attributes or components. Analysis of such features for identifying sentiment of the document is called as feature based sentiment analysis. In this approach positive or negative opinion is identified from the already extracted features. It is a fine grained analysis model among all other models [2] 4. TEXT CLASSIFICATION Now a day’s massive volume of online text is available through different websites, internet news feed, emails, cooperate databases and digital library. The main problem is to classify text documents from such massive databases. Using set of training labelled examples statistical text learning algorithms can be trained to approximately classify documents. The news articles and web pages were automatically catalogued by these text classification algorithms. Naïve Bayes Classifier: The Naïve Bayes —well known probabilistic classifier—and describes its application to text. In order to incorporate unlabelled data, the foundation Naïve Bayes was buil d. The task of learning of a generative model is to estimate the parameters using labelled training data only. The estimated parameters are used by the algorithm to classify new documents by calculating which class the generated the given document belongs to. The naive Bayesian classifier works as follows: • Consider a training set of samples, each with the class labels T. There are k classes, C1,C2, . . . ,Ck. Every sample consists of an n-dimensional vector, X = { x1, x2, . . . , xn}, representing n measured values of the n attributes, A1,A2, . . . ,An, respectively. • The classifier will classify the given sample X such that it belongs to the class having the highest posterior probability. That is X is predicted to belong to the class Ci if and only P(Ci X) > P(Cj X) for 1≤ j ≤ m, j≠ i. Thus we find the class that maximizes P(Ci X). The maximized value of P(Ci X) for class Ci is called the maximum posterior hypothesis. By Bayes’ theorem • Only P (X Ci) P (Ci) value needs to be maximized as for all classes value of P(X) is same. If the priori probabilities, P (Ci) of the class are not known, then it is assumed that the classes are likely to be equal, that is, P (C1) = P(C2) = . . . = P(Ck), and we would therefore maximize P(X Ci). Otherwise the value of P(X Ci) P(Ci) is maximized. The priori probabilities of a class are estimated by 42 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 P(Ci) = freq(Ci, T)/T. • To compute P (X Ci) would be computationally expensive as given data sets consist of many attributes. To reduce computation in evaluation of P (X Ci) P (Ci), the conditional class independence of naive assumption is made. The values of the attributes of the class label of the given sample presume to be conditionally independent of one another. Mathematically this means that Estimation of the probabilities P (x1 Ci), P (x2 Ci). . . P (xn Ci) can easily be done from the training set. For sample X, xk refers to the value of attribute Ak. (a) If Ak is categorical, then the number of samples P (xk Ci) of class Ci in T have the value xk for attribute Ak, divided by the number of sample of class Ci, freq (Ci, T), in T. if Ak is continuous-valued then the values have a Gaussian (b) We typically assume that distribution with a mean μ and standard deviation defined by so that p(xk Ci) = g(xk, μ Ci , σ Ci ). We need to compute μ Ci and σ Ci, which are the mean and standard deviation of values of attribute xk for training samples of class Ci. • To predict the class label X, the evaluation of P (X Ci) P (Ci) is done for each class Ci. The class that maximizes the value of P (X Ci) P (Ci) is the class label of X is Ci predicted by the classifier. [7] • Expectation Maximization: Due to high variance in the parameter estimates of the generative model, the Naive Bayes method’s accuracy will suffer because it has small set of labelled training data. This problem can be overcome by augmenting this labelled training data with a large set of unlabelled data and combining the two sets with EM, we can improve the parameter estimates. EM is used for maximum likelihood or maximum posterior estimation in problems with incomplete data and is class of iterative algorithms. Biological data is modelled using probabilistic models, such as HMM (Hidden Markov Model) or Bayesian networks which are efficient and robust procedures for learning parameters from observations. There are various sources for missing values such as in medical diagnosis, missing data for certain tests or gene expression clustering due to intentional omission of gene-to-cluster assignments in the probabilistic model. Such error does not occur in EM algorithm. Consider an example of a simple coin-flip-ping experiment in which we are given a pair of unknown biases θA and θB of coins A and B respectively that is, on any given flip, coin A will land on tails with probability 1– θA and heads with probability θA and similarly for coin B. The goal is to estimate θ = (θA, θB) by repeating the following procedure five times: with equal probability, choose one of the two coins randomly and perform with the selected coin ten independent tosses. Thus, a total of 50 coin tosses are performed. During the experiment, suppose where the identity of the coin used is zi ∈ {A,B},where xi ∈ {0,1,…,10} is the number of heads the track of two vectors x = (x1, x2, …, x5) and z = (z1, z2,…, z5) is kept, during the ith set of tosses 43 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 observed. In the model the parameter estimation setting also known as complete data case in which the values of all relevant random variables which consists of each coin flip and type of coin used for flip are known. Here, a simple way to estimate θA and θB is to return the observed proportions of heads for each coin: and It is known as maximum likelihood estimation which assesses the quality based on the probability assigned to the observed data of statistical model. The formulae are solved for the parameters ) ,that maximize If logP(x, z; θ) is the logarithm of the joint probability obtained for any ( , particular vector of observed head counts x and coin types z. Now consider the parameter estimation problem in which the recorded head counts x are given and z as hidden variables or latent factors is not given. Such parameter estimation setting is known as the incomplete data case. The coin used for each set of tosses is unknown, thus the computation of heads for each coin is no longer possible.This problem, the parameter estimation can be reduced with incomplete data to maximum likelihood estimation with complete data, if there was some way of guessing the correctly used coin from each of five sets. One of the iterative schemes used to obtain completions could work as follows: start from some initial parameters, , determine whether coin A or coin B from each five sets was more likely to have generated the observed flips . Then, assume the guessed coin to be correct, and apply the estimation procedure of regular maximum likelihood to get . Finally, repeat these two steps until convergence. As the quality of the resulting completions improves so the estimated model also improves. The expectation maximization algorithm oscillates between the steps of guessing the model depending on probability distribution over completions of missing data (known as the E -step) and then re-estimating the model parameters using these completions (known as the M-step). The name ‘E-step’ needs only to compute expected statistics over completions rather than explicitly forming probability distribution over completions. Similarly, the name ‘M-step’ consists of model re-estimation which can be thought of as ‘maximization’ of the expected log -likelihood of the data. [8, 9] 5. GROUPING FEATURES Regular expressions: Regular expressions are highly specialized programming language, in which the rules are specified for the set of possible strings that can be matched and the set might contain English sentences, or e-mail addresses etc. String processing tasks which are performed using regular expressions becomes very complicated because regular expressions language is relatively small and restricted. This mechanism was motivated to avoid silly errors by automated systems, particularly machine learning models. For example, opening salutations, such as “Dear Jane”, were falsely assigned with instructions by a machine learning model in some runs of cross-validation tests, possibly due to the frequent occurrences of person names in instructions. With this mechanism, “dear __NAME__”, a normalized form of “Dear Jane”, was compared against all such normalized 44 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 instances in the training data, and false assignment of instructions could be avoided after reviewing emotions assigned to the found training instances, specifically, by confirming more than two-thirds of the found training instances were not assigned with instructions. [11] Clustering: Clustering is the natural technique used to discover hundreds of feature expressions from text for an opinion mining application. Similarity measures used for clustering are usually based on some form of distributional similarity. There are two main kinds of similarity measures those relying on pre-existing knowledge resources (e.g., thesaurus, and semantic networks) and those relying on distributional properties of words in corpora. First, a pre-processing pass could build a list of words and phrases that appear frequently in the review of a particular restaurant but are uncommon in the wider corpus. This should find phrases like the name of a dish that many people are talking about. Second, given the narrow domain of the problem, it should also be possible to hand-build a list of common ideas a reader might want to know about, like service, food, and price. Extracting these combined, specific features should lead to purpose-built vectors that form clusters around relevant concepts. [12] 6. EVALUATION MEASURES All since the problem of grouping feature expressions is a clustering task, two common measures for evaluating clustering are used the study, Entropy and Purity. Below, we briefly describe entropy and purity. Given a data set DS, its gold partition is G = {g1....,…,gj....,…gk}, where k is the given number of clusters. The groups partition DS into k disjoint subsets, DS1,…, DSi, …, DSk. • Entropy: For each resulting cluster, we can measure its entropy using Equation (a), where Pi(gi) is the proportion of gi data points in DSi. The total entropy of the whole clustering (which considers all clusters) is calculated by Equation (b) Purity: Purity measures the extent that a cluster contains only data from one gold- partition. The cluster purity is computed with Equation (c). The total purity of the whole clustering (all clusters) is computed with Equation (d) [2] • ) (a) (b) (c) (d) Similarly for the evaluation of sentiment classification using regular expression is usually measured by precision and recall. Precision is the fraction of relevant retrieved instances, while recall is the fraction of retrieved relevant instances. Therefore precision and recall are based on an understanding and measure of relevance. 45 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 Where TP - number of true positives TN - number of true negatives FP - number of false positives FN - number of false negatives. [11] 7. TOOLS A Red Opal is a tool that enables users to find products based on features. The features from customer reviews are used for scoring each product. Opinions on web are analysed and compared using Opinion observer. The product opinions are displayed feature by feature in graph format. Automation of aggregation sites is done by Review Seer tool. The extracted features are assigned score by Naïve Bayes classifier as positive and negative review. The crawled pages are not classified properly by this tool. Result is displayed in the form of attribute and its score. Product features are extracted in Web Fountain using beginning definite Base Noun Phrase (bBNP) heuristic. The sentiment lexicon and sentiment pattern database are used to assign sentiments to feature. Sentiment extraction patterns are defined in sentiment pattern database and polarity of terms is defined in sentiment lexicon. [1] 8. CONCLUSIONS The challenge in sentiment analysis of product reviews is to produce a summary of opinions based on product features/attributes (also called aspects). People can express features with many different words or phrases. These words and phrases are grouped under the same feature group to produce useful summary. Limited work has been done on grouping of synonym features and clustering. In future, Opinion Mining can be carried out on a set of reviews and set of discovered feature expressions extracted from reviews. The state-of-art for current methods, useful for producing better summary based on feature based opinions as positive, negative or neutral is the Expectation Maximization algorithm based on Naïve Bayesian is the most efficient method. The efficiency of EM algorithm can be increased by augmenting it, to reassign classes of the labelled set. The natural language text can be processed based on machine learning toolkit called as OpenNLP library. The NLP tasks, such as tokenization, part-of-speech (POS) tagging, named entity extraction, parsing, chunking, sentence segmentation, and co reference resolution are provided by Open NLP library. The advanced text processing services are built using these tasks. OpenNLP also includes perceptron and maximum entropy based machine learning. After POS tagging, opinion retrieval can be performed by extracting product candidate feature, related opinion and producing opinion feature pairs. The keywords extracted from Opinion Retrieval Module can be used to perform similarity check with the database dictionary. The similarity check can use semi supervised learning. 46 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 REFERENCES [1] G.Vinodhini and RM.Chandrasekaran, Sentiment Analysis and Opinion Mining: A Survey, Volume 2, Issue 6, June 2012 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering [2] Zhongwu Zhai, Bing Liu, Hua Xu and Hua Xu, Clustering Product Features for Opinion Mining, WSDM’11, February 9–12, 2011, Hong Kong, China. Copyright 2011 ACM 978-1-4503-0493- 1/11/02...$10.00 [3] Singh and Vivek Kumar, A clustering and opinion mining approach to socio-political analysis of the blogosphere, Computational Intelligence and Computing Research (ICCIC), 2010 IEEE International Conference. [4] Alexander Pak and Patrick Paroubek, Twitter as a Corpus for Sentiment Analysis and Opinion Mining, [5] Bing Liu. Sentiment Analysis and Opinion Mining, Morgan & Claypool Publishers, May 2012. [6] V. S. Jagtap and Karishma Pawar, Analysis of different approaches to Sentence-Level Sentiment Classification, International Journal of Scientific Engineering and Technology (ISSN : 2277-1581) Volume 2 Issue 3, PP : 164-170 1 April 2013 [7] K. Ming Leung, Naive Bayesian Classifier,Copyright c 2007 [email protected]. [8] Chuong B Do & Serafim Batzoglou, What is the expectation maximization algorithm?, 2008 Nature Publishing Group http://www.nature.com/naturebiotechnology [9] Kamal Nigam, Andrew Kachites Mccallum, Sebastian Thrun and Tom Mitchell, Text Classification from Labeled and Unlabeled Documents using EM, Machine Learning, 39, 103–134, 2000.2000 Kluwer Academic Publishers. Printed in The Netherlands. [10] Ainur Yessenalina, Yisong Yue and Claire Cardie, Multi-level Structured Models for Document- level Sentiment Classification, Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pages 1046–1056, MIT, Massachusetts, USA, 9-11 October 2010. c 2010 Association for Computational Linguistics [11] Sunghwan Sohn,1,* Manabu Torii,2,* Dingcheng Li,1 Kavishwar Wagholikar,1 Stephen Wu,1 and Hongfang Liu1, A Hybrid Approach to Sentiment Sentence Classification in Suicide Notes, Biomed Insights. 2012; 5(Suppl. 1): 43–50. Published online 2012 January 30. doi: Inform 10.4137/BII.S8961 [12] YuanbinWu, Qi Zhang, Xuanjing Huang, LideWu, Phrase Dependency Parsing for Opinion Mining, Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing, pages 1533–1541, Singapore, 6-7 August 2009. c 2009 ACL and AFNLP [13] Zhai Z, Liu B, Xu H, and Jia P, Grouping Product Features Using Semi-supervised Learning with Soft-Constraints, in Proceedings of COLING. 2010 [14] Khairullah Khan and Baharum B. Baharudin, Identifying Product Features from Customer Reviews using Lexical Concordance, Research Journal of Applied Sciences Engineering and Technology, 2012 [15] Boris Kraychev and Ivan Koychev, Computationally Effective Algorithm for Information Extraction and Online Review Mining, 2010 [16] Akshi Kumar and Teeja Mary Sebastian, Sentiment Analysis: A Perspective on its Past, Present and Future, 2012 [17] Fellbaum C, WordNet: An electronic lexical database. 1998: MIT press Cambridge, MA [18] Lin D. Automatic retreival and clustering of similar words, 1998: Proceedings of ACL 768-774 [19] Dae Hoon Park and Wei Peng, Generate Adjective Sentiment Dictionary for Social Media Sentiment Analysis Using Constrained Nonnegative Matrix Factorization, Proceedings of the Fifth International AAAI Conference on Weblogs and Social Media 2011 [20] Bo Pang, Lillian Lee and Shivakumar Vaithyanathan, Thumbs up? Sentiment classification using machine learning techniques. In Proceedings of the 2002 Conference on Empirical Methods in Natural Language Processing (EMNLP) [21] Ana-Maria Popescu and Oren Etzioni, Extracting Product Features and Opinions from Reviews [22] David Vadas and James R. Curran, Adding Noun Phrase Structure to the Penn Treebank, Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics, pages 240–247 Prague, Czech Republic, June 2007. c 2007 Association for Computational Linguistics [23] David Vadas and James R. Curran, Parsing Noun Phrases in the Penn Treebank, 2011 Association for Computational Linguistics 47 International Journal on Natural Language Computing (IJNLC) Vol. 2, No.3, June 2013 [24] Bo Pang and Lillian Lee, Opinion mining and sentiment analysis, Foundations and Trends in Information Retrieval Vol. 2, No 1-2 (2008) 1–135 2008 Bo Pang and Lillian Lee [25] David Osimo and Francesco Mureddu, Research Challenge on Opinion Mining and Sentiment Analysis, Osimo, D. et al., 2010. The CROSSROAD Roadmap on ICT for Governance and Policy Modeling [26] Bakhtawar Seerat and Farouque Azam, Opinion Mining: Issues and Challenges (A survey), International Journal of Computer Applications (0975 – 8887) Volume 49– No.9, July 2012 [27] Nidhi Mishra and C.K.Jha, PhD., Classification of Opinion Mining Techniques, International Journal of Computer Applications (0975 – 8887) Volume 56– No.13, October 2012 [28] Nilesh M. Shelke, Shriniwas Deshpande, PhD. and Vilas Thakre, PhD., Survey of Techniques for Opinion Mining, International Journal of Computer Applications (0975 – 8887) Volume 57– No.13, November 2012 [29] Gamgarn Somprasertsri and Pattarachai Lalitrojwong, Mining Feature-Opinion in Online Customer Reviews for Opinion Summarization, Journal of Universal Computer Science, vol. 16, no. 6 (2010), 938-955 submitted: 15/9/09, accepted: 4/3/10, appeared: 28/3/10 © [30] Michael Wiegand and Dietrich Klakow, Predictive Features in Semi-Supervised Learning for Polarity Classification and the Role of Adjectives Authors Arti Buche, Dr. M. B. Chandak and Akshay Zadgaonkar.Arti Buche is pursuing Masters in Technology in Computer Science and Engineering from Shri. Ramdeobaba College of Engineering and Management, Nagpur. 48
1712.01807
1
1712
2017-12-05T18:34:56
Improving the Performance of Online Neural Transducer Models
[ "cs.CL", "eess.AS", "stat.ML" ]
Having a sequence-to-sequence model which can operate in an online fashion is important for streaming applications such as Voice Search. Neural transducer is a streaming sequence-to-sequence model, but has shown a significant degradation in performance compared to non-streaming models such as Listen, Attend and Spell (LAS). In this paper, we present various improvements to NT. Specifically, we look at increasing the window over which NT computes attention, mainly by looking backwards in time so the model still remains online. In addition, we explore initializing a NT model from a LAS-trained model so that it is guided with a better alignment. Finally, we explore including stronger language models such as using wordpiece models, and applying an external LM during the beam search. On a Voice Search task, we find with these improvements we can get NT to match the performance of LAS.
cs.CL
cs
IMPROVING THE PERFORMANCE OF ONLINE NEURAL TRANSDUCER MODELS Tara N. Sainath, Chung-Cheng Chiu, Rohit Prabhavalkar, Anjuli Kannan, Yonghui Wu, Patrick Nguyen, Zhifeng Chen {tsainath,chungchengc,prabhavalkar,anjuli,yonghui,drpng,zhifengc}@google.com Google, Inc., USA 7 1 0 2 c e D 5 ] L C . s c [ 1 v 7 0 8 1 0 . 2 1 7 1 : v i X r a ABSTRACT Having a sequence-to-sequence model which can operate in an online fashion is important for streaming applications such as Voice Search. Neural transducer is a streaming sequence-to-sequence model, but has shown a significant degradation in performance compared to non- streaming models such as Listen, Attend and Spell (LAS). In this paper, we present various improvements to NT. Specifically, we look at increasing the window over which NT computes attention, mainly by looking backwards in time so the model still remains online. In addition, we explore initializing a NT model from a LAS-trained model so that it is guided with a better alignment. Finally, we explore including stronger language models such as using wordpiece models, and applying an external LM during the beam search. On a Voice Search task, we find with these improvements we can get NT to match the performance of LAS. 1. INTRODUCTION Sequence-to-sequence models have become popular in the automatic speech recognition (ASR) community [1, 2, 3, 4], as they allow for one neural network to jointly learn an acoutic, pronunciation and language model, greatly simplifying the ASR pipeline. In this paper, we focus on attention-based sequence-to-sequence models, as our previous study [5] showed these models performed better than alternatives such as Connectionist Temporal Classification (CTC) [6] and Recurrent Neural Network Transducer (RNN-T) [7]. Attention-based models consist of three modules. First, an en- coder, represented by a multi-layer recurrent neural network (RNN), models the acoustics. Second, a decoder, which consists of multiple RNN layers, predicts the output sub-word unit sequence. Finally, an attention layer selects frames in the encoder representation that the decoder should attend to when predicting each sub-word unit. Attention-based models, such as Listen, Attend and Spell (LAS) have typically been explored in "full-sequence" mode, meaning at- tention is computed by seeing the entire input sequence [2, 4]. Thus, during inference, the model can produce the first output token only after all input speech frames have been consumed. While such a mode of operation might be suitable for many applications, these models cannot be used for "streaming" speech recognition, such as voice search, where the output text should be generated as soon as possible after words are spoken [8]. Recently, neural transducer (NT) [3] was proposed as a limited- sequence streaming attention-based model, which consumes a fixed number of input frames (a chunk), and outputs a variable number of labels before it consumes the next chunk. While the model is attractive for streaming applications, in previous work NT showed a large degradation over other online sequence-to-sequence models such as RNN-T [9] and full-sequence unidirectional attention-based models [3, 4], particularly as the chunk-size was decreased [4]. In the present work, we study various improvments to the stream- ing NT model1 – both in terms of model structure, as well as in the training procedure – that are aimed at improving its performance to be as close as possible to the non-streaming full-sequence unidirectional LAS model, which serves as an upper-bound of sorts. Specifically, we allow attention in NT to be computed looking back many previous chunks, as this does not introduce additional latency. Further, we find that allowing the model to look-ahead by 5 frames is extremely beneficial. Finally, we allow NT to be initialized from a pre-trained LAS model, which we find is a more effective strategy than having the model learn from scratch. Our NT experiments are conducted on a 12,500 hour Voice Search task. We find that with look-back and look-ahead, NT is more than 20% relative worse than LAS in terms of word error rate (WER). However, we find that by pretraining with LAS, we can get NT with a chunk size of 10 (450ms latency) to match the performance of LAS, but a chunk size of 5 (300ms latency) still degrages by 3% relative. Our analysis of the NT model indicates that many of the errors made compared to LAS are language modeling (LM) errors. Thus, we explore various ideas to incorporate a stronger language model (LM) into NT, to allow us to reduce the chunk size. This includes exploring incorporating an LM from the encoder side via multi-head attention, training the NT model with word pieces [10] to get a stronger LM into the decoder [11] and also explicitly incorporating an external LM via shallow fusion [12]. We find that our best performing NT system with a chunk size of 5 (300 ms latency) only degrades performance by 1% relative to an unidirectional LAS system. 2. ORIGINAL NEURAL TRANSDUCER ALGORITHM In this section, we describe the basic NT model introduced in Jaitly et al. [3]. which is shown in Figure 1. Given an input se- quence of frame-level features (e.g., log-mel-filterbank energies), x = {x1, x2, . . . , xT}, and an output sequence of sub-word units (e.g., graphemes, or phonemes) y = {y1, y2, . . . yN}, attention models assume that the probability distribution of each sub-word unit is conditioned on the previous history of sub-word unit predictions, y<i, and the input signal. Full-sequence attention models, such as LAS [2] compute the probability of the output prediction y<i for each step i given the entire input acoustic sequence x, making it unsuitable for streaming recognition applications. The Neural Transducer (NT) model [3] is a limited-sequence attention model that addresses this issue by limiting attention to fixed-size blocks of the encoder space. 1In this work, we consider streaming to mean the system has a maximum allowable delay of 300ms, which is considered reasonable [8]. current block. We refer the reader to [4] for more details about the attention and speller. 3. IMPROVING PERFORMANCE OF BASIC NEURAL TRANSDUCER ALGORITHM In this section, we describe various improvements to the basic algo- rithm and model described in the previous section. 3.1. Training grapheme-based models using Word Alignments Training with NT requires knowing which sub-word units occur in each chunk, and thus an alignment is needed. Our previous work with NT [4] used context-independent phonemes, for which an alignment was available. In this work, we train our model with graphemes, which does not have an alignment. However, we have a word level alignment and we use this information to emit all graphemes in the chunk corresponding to when a word has finished. 3.2. Extending Attention Range In the original NT paper, attention was computed by only looking at encoder features in the current block b, as shown in Equation 2. However, as shown in [4], making the attention window longer allows NT to approach the performance of LAS, but at the cost of removing the online nature of the task. However, we can still maintain a streaming, online system by computing attention by looking back over k previously blocks. This is particularly important because we emit graphemes at word boundaries. Furthermore, similar to our streaming systems [13], we allow a lookahead of 150 ms (5 30-ms frames) between the input frames and the output prediction. With these changes, the listener is now shown by Equation 3. h(b−1)W +1...bW = Listen(x(b−k)W +1...bW +5) (3) 3.3. Pre-training with LAS Attention-based models learn an alignment (represented via an atten- tion vector), jointly with the acoustic model (encoder) and language model (decoder). One hypothesis we have for NT lagging behind LAS is that during training, the attention mechanism is limited in the window over which it can compute attention. This problem is exacer- bated by the fact that we emit graphemes only at word boundaries. However, we can see from attention plots in LAS [2] that once the attention mechanism is learned, it appears to be fairly monotonic. Since NT and LAS are parameterized exactly the same (except for an extra <epsilon> output target), we can train a LAS model with this extra target (which is ignored as it does not appear in the LAS target sequence) and used it to initialize NT. Our intuition is that since LAS learns a good attention mechanism that is relatively monotonic, it can be used to initialize NT and NT will not take a large hit in accuracy compared to LAS. 3.4. Incorporating a Stronger Language Model As we make the chunk-size smaller, looking at the errors it appears that most of the errors are due to language modeling errors. Therefore, we explore if we can incorporate a stronger LM into the decoding and/or training process. Fig. 1: Neural Transducer Attention Model. Given the input sequence, x, of length T , and a block size of length W , the input sequence is divided equally into blocks of length B = (cid:100) T W (cid:101), except for the last block which might contain fewer than B frames. The NT model examines each block in turn, starting with the left-most block (i.e., the earliest frames). In this model, attention is only computed over the frames in each block. Within a block, the NT model produces a sequence of k outputs, yi, . . . , yi+k; it is found to be useful to limit the maximum number of outputs that can be pro- duced within a block to M symbols, so that 0 ≤ k ≤ M. Once it has produced all of the required labels within a block, the model outputs an <epsilon> symbol, which signifies the end of block processing. The model then proceeds to compute attention over the next block, and so on, until all blocks have been processed. The <epsilon> symbol is analogous to the blank symbol in connectionist temporal classification (CTC) [6]. In particular, we note that a block must output a minimum of one symbol (<epsilon>), before proceeding to the next block. The model computes P (y1,...,(S+B)x1...T ), which outputs a se- quence which is length B longer than the LAS model since the model must produce an <epsilon> at every block. Within each block b ∈ B, the model computes the following probability in Equation 1, where yeb = <epsilon> is the symbol at the end of each block. In other words, the prediction yi at the current step, i, is based on the previous predictions y1...e(i−1), similar to LAS, but in this case using acoustic evidence only up to the current block, x1...bW : P (y(eb−1+1)...ebx1...bW , y1...eb−1 ) = eb(cid:89) P (yix1...bW , y1...e(i−1) ) (1) i=e(b−1)+1 Like LAS, NT also consists of a listener, an attender and a speller to define a probability distribution over the next sub-word unit conditioned on the acoustics and the sequence of previous predictions. The listener module of the NT computes an encoding vector in the current block only: h(b−1)W +1...bW = Listen(x(b−1)W +1...bW ) (2) which is implemented as a unidirectional RNN. The goal of the attender and speller is to take the output of the listener (i.e., h) and produce a probability distribution over sub-word units. The attention and speller modules operate similar to LAS, but only work on the partial output, h1...bW , of the encoder up until the 3.4.1. Wordpiece Models To increase the memory and linguistic span of the decoder, we emit wordpieces instead of graphemes [14]. In this approach, words a broken up, deterministically, into sub-word units, called wordpieces. For instance, the phrase "Jet makers feud" can be broken up into (" J" , "et", " makers", " fe", "ud") some words may be broken down into sub-units while common words ("makers") are modeled as a single unit. Wordpieces are position-dependent, so we mark the beginning of each word with a special marker " ". The wordpiece inventory is trained to maximize the likelihood of the training text. Wordpieces achieve a balance between the flexibility of characters and efficiency of words. Sequence-to-sequence models that predict wordpieces have been successful in both machine translation [14] and speech [11, 15]. Since these models are trained to predict wordpieces, rather than graphemes, a much stronger decoder LM is used. We hypothesize that by predict- ing wordpieces, we can reduce chunk size as well with NT. 3.4.2. Incorporating external LM Language models have been successfully incorporated into sequence- to-sequence models to guide the beam search to output a more likely set of candidates [16, 17]. In this work, we explore if incorporating an external LM into the beam search can aid NT. Following a similar approach to [16, 18], we look at doing a log-linear interpolation between the LAS model and an FST-based LM trained to go from graphemes to words at each step of the beam search, also known as shallow fusion [17]. In this equation p(yx) is the score from the LAS model, which is combined with a score coming from an external LM pLM (x) weighted by an LM weight λ, and a coverage term to promote longer transcripts [16] and weighted by η. ∗ y = arg min y − log p(yx) − λ log pLM (x) − ηcoverage (4) 4. EXPERIMENTAL DETAILS Our experiments are conducted on a ∼12,500 hour training set con- sisting of 15 million English utterances. The training utterances are anonymized and hand-transcribed, and are representative of Google's voice search traffic. This data set is created by artificially corrupting clean utterances using a room simulator, adding varying degrees of noise and reverberation such that the overall SNR is between 0dB and 30dB, with an average SNR of 12dB [19]. The noise sources are from YouTube and daily life noisy environmental recordings. We re- port results on a set of ∼14,800 anonymized, hand-transcribed Voice Search utterances extracted from Google traffic. All experiments use 80-dimensional log-mel features, computed with a 25-ms window and shifted every 10ms. Similar to [13, 20], at the current frame, t, these features are stacked with 2 frames to the left and downsampled to a 30ms frame rate. The encoder network architecture consists of 5 unidirectional long short-term memory [21] (LSTM) layers, with the size specified in the results section. Additive attention is used for all experiments [22]. The decoder network is a 2 layer LSTM with 1,024 hidden units per layer. All networks are trained to predict 74 graphemes unless otherwise noted. All neural networks are trained with the cross-entropy criterion, using asynchronous stochastic gradient descent (ASGD) optimiza- tion [23] with Adam [24] and are trained using TensorFlow [25]. 5. RESULTS 5.1. Getting NT To Work Online 5.1.1. Attention Window Our first set of experiments analyzes the behavior of NT as we vary the window used to compute attention. For these experiments, we use an encoder which consists of five layers of 768 uni-directional LSTM cells and a decoder with two layers of 768 LSTM cells. As can be seen in Table 1, when we only allow the NT model to compute attention within a chunk of size 10, performance is roughly 25% worse in terms of WER compared to the LAS model which differs only in the window over which attention is computed. Allowing the model to compute attention over the last 20 chunks in addition to the current chunk, however, slightly improves performance of the NT system. Finally, if we allow a 5 frame look-ahead 2, the results improve but NT is still roughly 13% relative worse compared to LAS. Based on the results in Table 1, since the proposed changes improve performance, all future NT results in the paper use a look-back of 20 chunks and a look-ahead of 5 frames. System LAS NT, attention within chunk NT, look back + look ahead Chunk Size WER 11.7 14.6 14.4 13.2 - 10 10 10 Table 1: WER for NT, Varying Chunks Looked Over 5.1.2. Initialization from LAS, Single-head attention Next, we analyze the behavior of NT, for both a chunk size of 5 and 10, when we pretrain with LAS. For these experiments, we compare two different encoder/decoder sizes. Table 2 shows that when NT is pre-trained with LAS, at a chunk size of 10 (i.e., 450 ms latency) we can match the performance of LAS. However, a chunk size of 5 (300ms latency), which is our requirement for allowed streaming delay, still lags behind LAS by 3% relative for the larger model. System LAS NT, scratch NT, pretrained 9.8 11.1 9.9 14.5 NT, pretrained 10.1 Table 2: WER for NT, Pretrained from LAS - 10 10 5 5 NT, scratch Chunk 5x1024 2x1024 5x768 2x768 11.7 13.2 11.4 - - 5.1.3. Initialization from LAS, Multi-head attention Next, we compare the behavior of LAS vs. NT when the system uses multi-head attention [26], which has been shown to give state-of-the- art ASR performance for LAS [27]. The MHA model uses a 5x1400 encoder with 4 attention heads, and a 2x1024 decoder. Table 4 shows that the performance of NT does not improve from single to multi- head attention, even though the LAS system does. One hypothesis is that multi-head attention computes attention from multiple points in 2It is important to note that the 5 frame look-ahead with a chunk size of 10 is not the same as a 15 frame window, as the 5 frame look ahead is with respect to the end of the chunk boundary, and all other frames used to compute attention occur before the chunk boundary. LAS, MHA school closing in parma for tomorrow how to multiply two numbers with decimals NT-Ch5, MHA what closing in parma for tomorrow how to multiply two numbers with this most NT-Ch5, MHA, WPM school closing in parma for tomorrow how to multiply two numbers with decimals how far is it from albuquerque new how far is it from albuquerque new how far is it from albuquerque new mexico to fountain hills arizona is under the arm warmer or colder than in mouth temperature mexico to to fountain hills arizona is under the arm warmer or colder than a mouse temperature mexico to fountain hills arizona is under the arm warmer or colder than in mouth temperature Table 3: Representative errors made by different systems, indicated in red. the encoder space that come after the current prediction, which are ignored by streaming models such at NT. System Chunk LAS NT NT - 10 5 Single Attention - WER MHA - WER 5x1400,2x1024 5x1024,2x1024 9.8 9.9 10.1 8.0 9.8 10.3 Table 4: WER for NT with MHA To understand the loss in performance caused by NT compared to LAS, we analyzed sentences where LAS was correct and NT incorrect, denoted in the first two columns of Table 3 as "LAS-MHA" and "NT-Ch5,MHA". The table shows that a lot of the NT errors are due to language modeling errors. In the next section, we look at a few simple ways of incorporating an LM into the system. 5.2. Incorporating the LM 5.2.1. Wordpieces Our next set of results looks at incorporating wordpieces into the LAS and NT models, which provide a stronger LM from the decoder side. For these experiments, we used 32,000 wordpieces. Table 5 shows that with wordpieces, the NT and LAS models are now much closer compared to graphemes. In addition, there is very little difference between NT with a chunk size of 5 and 10. One hypothesis is that since wordpieces are now longer units, each attention head focused on by neural transducer corresponds to a much longer subword unit (potentially a word) compared to the NT grapheme MHA system. Therefore, the MHA WPM feeds a much stronger set of context vectors to the decoder compared to NT grapheme model. This can also be visually observed by looking at the attention plots for the grapheme vs. wordpiece systems in Figure 2. The plot shows that the attention vectors for wordpieces span a much longer left context window compared to graphemes. System Chunk WER LAS 8.6 8.6 NT NT 8.7 - 10 5 Table 5: WER for NT with MHA + WPM 5.2.2. WPM + LM Finally, we investigate incorporating an external LM into the MHA+WPM LAS and NT models. In these experiments, a n- gram FST LM, trained on 32K wordpieces, is used. This LM is trained on 1 billion text queries, a much larger set compared to the 15 million utterances seen by the LAS/NT models. Table 6 shows the the FST LM does not give any additional improvement for both NT Fig. 2: Attention Plots for NT-MHA with (a) Graphemes, (b) WPM. The two attention plots also correspond to different utterances. and LAS. It has been observed in [18] that the perplexity of a WPM RNN-LM is much lower than a WPM FST. Since the decoder of the LAS and NT models is an RNN-LM, it is possible there is nothing more to gain by incorporating the WPM FST. In the future, we will repeat this with a WPM RNN-LM trained on text data. System Chunk No LM with LM LAS NT NT 8.6 8.6 8.7 8.6 8.6 8.7 - 10 5 Table 6: WER for NT, Incorporating External LM Finally, it should be noted that after including both WPM and ex- ternal LM, the last column of Table 3, namely "NT-Ch5,MHA,WPM" illustrates that many of the previous sentences are now fixed and match the LAS hypothesis. With the proposed LM improvements, NT with a chunk size of 5 has comparable performance to LAS, while meeting the allowable delay of 300ms. 6. CONCLUSIONS In this paper, we presented various improvements to NT. Specifically, we showed we could improve performance by increasing the attention window and pre-training NT with LAS. With these improvements, a single-head NT model could come very close to the performance of LAS while a multi-head attention NT model still degraded over LAS. By incorporating a stronger LM through wordpieces, multi-head NT could effetively match the performance of LAS. 7. ACKNOWLEDGEMENTS The authors would like to thank Navdeep Jaitly, Michiel Bacchiani and Gabor Simko for helpful discussions. [20] H. Sak, A. Senior, K. Rao, and F. Beaufays, "Fast and Accu- rate Recurrent Neural Network Acoustic Models for Speech Recognition," in Proc. Interspeech, 2015. [21] S. Hochreiter and J. Schmidhuber, "Long Short-Term Memory," Neural Computation, vol. 9, no. 8, pp. 1735–1780, Nov 1997. [22] D. Bahdanau, K. Cho, and Y. Bengio, "Neural Machine Trans- lation by Jointly Learning to Align and Translate," CoRR, vol. abs/1409.0473, 2014. [23] J. Dean, G.S. Corrado, R. Monga, K. Chen, M. Devin, Q.V. Le, M.Z. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang, and A.Y. Ng, "Large Scale Distributed Deep Networks," in Proc. NIPS, 2012. [24] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," in Proc. of ICLR, 2015. [25] M. Abadi et al., "TensorFlow: Large-Scale Machine Learn- ing on Heterogeneous Distributed Systems," Available on- line: http://download.tensorflow.org/paper/whitepaper2015.pdf, 2015. [26] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, "Attention Is All You Need," CoRR, vol. abs/1706.03762, 2017. [27] C. Chen, T. N. Sainath, Y. Wu, R. Prabhavalkar, P. Nguyen, Z. Chen, A. Kannan, R. J. Weiss, K. Rao, N. Jaitly, B. Li, and J. Chorowski, "State-of-the-art speech recognition with sequence-to-sequence models," in submitted to Proc. ICASSP, 2018. 8. REFERENCES [1] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and Y. Ben- gio, "Attention-Based Models for Speech Recognition," in Proc. NIPS, 2015. [2] W. Chan, N. Jaitly, Q. V. Le, and O. Vinyals, "Listen, attend and spell," CoRR, vol. abs/1508.01211, 2015. [3] N. Jaitly, D. Sussillo, Q. V. Le, O. Vinyals, I. Sutskever, and S. Bengio, "An Online Sequence-to-sequence Model Using Partial Conditioning," in Proc. NIPS, 2016. [4] R. Prabhavalkar, T. N. Sainath, B. Li, K. Rao, and N. Jaitly, "An Analysis of "Attention" in Sequence-to-Sequence Models," in Proc. Interspeech," in Proc. Interspeech, 2017. [5] R. Prabhavalkar, K. Rao, T. N. Sainath, B. Li, L. Johnson, and N. Jaitly, "A Comparison of Sequence-to-sequence Models for Speech Recognition," in Proc. Interspeech, 2017. [6] A. Graves, S. Fernandez, F. Gomez, and J. Schmidhuber, "Con- nectionist Temporal Classification: Labeling Unsegmented Se- quenece Data with Recurrent Neural Networks," in Proc. ICML, 2006. [7] A. Graves, "Sequence transduction with recurrent neural net- works," CoRR, vol. abs/1211.3711, 2012. [8] M. Shannon, G. Simko, S. Chan, and C. Parada, "Improved End-of-Query Detection for Streaming Speech Recognition," . [9] E. Battenberg, J. Chen, R. Child, and A. Coates et. al., "Explor- ing Neural Transducers for End-to-End Speech Recognition," in Proc. ASRU, 2017. [10] Mike Schuster and Kaisuke Nakajima, "Japanese and Korean voice search," 2012 IEEE International Conference on Acous- tics, Speech and Signal Processing, 2012. [11] K. Rao, R. Prabhavalkar, and H. Sak, "Exploring Architectures, Data and Units for Streaming End-to-End Speech Recognition with RNN-Transducer," in Proc. ASRU, 2017. [12] J. K. Chorowski and N. Jaitly, "Towards Better Decoding and Language Model Integration in Sequence to Sequence Models," in Proc. Interspeech, 2017. [13] G. Pundak and T. N. Sainath, "Lower Frame Rate Neural Network Acoustic Models," in Proc. Interspeech, 2016. [14] Y. Wu, M. Schuster, and et. al., "Google's neural machine trans- lation system: Bridging the gap between human and machine translation," CoRR, vol. abs/1609.08144, 2016. [15] William Chan, Yu Zhang, Quoc Le, and Navdeep Jaitly, "Latent Sequence Decompositions," in ICLR, 2017. [16] J. Chorowski and N. Jaitly, "Towards Better Decoding and Language Model Integration in Sequence to Sequence Models," in Proc. Interspeech, 2017. [17] A. Sriram, H. Jun, S. Satheesh, and A. Coates, "Cold fu- sion: Training seq2seq models together with language models," CoRR, vol. abs/1708.06426, 2017. [18] A. Kannan, Y. Wu, P. Nguyen, T. N. Sainath, Z. Chen, and R. Prabhavalkar, "An analysis of incorporating an external lan- guage model into a sequence-to-sequence model," in submitted to Proc. ICASSP, 2018. [19] C. Kim, A. Misra, K. Chin, T. Hughes, A. Narayanan, T. N. Sainath, and M. Bacchiani, "Generated of large-scale simulated utterances in virtual rooms to train deep-neural networks for far- field speech recognition in google home," in Proc. Interspeech, 2017.
1606.06125
2
1606
2016-07-08T07:14:44
Introducing a Calculus of Effects and Handlers for Natural Language Semantics
[ "cs.CL", "cs.PL" ]
In compositional model-theoretic semantics, researchers assemble truth-conditions or other kinds of denotations using the lambda calculus. It was previously observed that the lambda terms and/or the denotations studied tend to follow the same pattern: they are instances of a monad. In this paper, we present an extension of the simply-typed lambda calculus that exploits this uniformity using the recently discovered technique of effect handlers. We prove that our calculus exhibits some of the key formal properties of the lambda calculus and we use it to construct a modular semantics for a small fragment that involves multiple distinct semantic phenomena.
cs.CL
cs
Introducing a Calculus of Effects and Handlers for Natural Language Semantics Jirka Mars´ık and Maxime Amblard LORIA, UMR 7503, Universit´e de Lorraine, CNRS, Inria, Campus Scientifique, F-54506 Vandoeuvre-l`es-Nancy, France {jirka.marsik, maxime.amblard}@loria.fr Abstract. In compositional model-theoretic semantics, researchers as- semble truth-conditions or other kinds of denotations using the lambda calculus. It was previously observed [26] that the lambda terms and/or the denotations studied tend to follow the same pattern: they are in- stances of a monad. In this paper, we present an extension of the simply- typed lambda calculus that exploits this uniformity using the recently discovered technique of effect handlers [22]. We prove that our calculus exhibits some of the key formal properties of the lambda calculus and we use it to construct a modular semantics for a small fragment that involves multiple distinct semantic phenomena. Keywords: compositionality, side effects, monads, handlers, deixis, con- ventional implicature 1 Introduction The prevailing methodology of formal semantics is compositionality in the sense of Frege: denotations of complex phrases are functions of the denotations of their immediate constituents. However, several phenomena have been identified that challenge this notion of compositionality. Examples include anaphora, pre- supposition, quantification, deixis and conventional implicature. In all of these examples, simple models of denotation (i.e. noun phrases are individuals, sen- tences are truth-values) run into complications as the denotations can depend on external values (anaphora, deixis) or on something which is not an immediate constituent (presupposition, quantification, conventional implicature). Among the solutions to these challenges, we find (at least) two types of solu- tions. First, we have those that relax the condition of compositionality. Notably, the denotation of a complex phrase is no longer a function per se of the denota- tions of its immediate subconstituents. Rather, it is some other formally defined process.1 Examples of this approach include: 1 This kind of distinction is the same distinction as the one between a mathematical function and a function in a programming language, which might have all kinds of side effects and therefore not be an actual function. -- the incremental algorithm used to build discourse representation structures in DRT, as presented in [12] -- the λµ calculus, used in [6] to analyze quantification, since, due to the lack of confluence, function terms do not denote functions over simple denotations -- the use of exceptions and exception handlers in [18] to model presuppositions in an otherwise compositional framework -- the parsetree interpretation step in the logic of conventional implicatures of [23] that builds the denotation of a sentence by extracting implicatures from the denotations of its subparts (including the non-immediate ones) The other approach is to enrich the denotations so that they are parame- terized by the external information they need to obtain and contain whatever internal information they need to provide to their superconstituents. Here are some examples of this style: -- any kind of semantic indices (e.g. the speaker and addressee for deixis, the current world for modality), since they amount to saying that a phrase de- notes an indexed set of simpler meanings -- the continuized semantics for quantification [1] in which denotations are functions of their own continuations • and more generally, any semantics using type raising or generalized quan- tifiers for noun phrase denotations -- the dynamic denotations of [7] that are functions of the common ground and their continuation -- compositional event semantics, such as the one in [25], that shift the deno- tations of sentences from truth-values to predicates on events We want to find a common language in which we could express the above tech- niques. Our inspiration comes from computer science. There, a concept known as monad has been used: -- in denotational semantics to give the domain of interpretation for program- ming languages that involve side effects [21]. -- in functional programming to emulate programming with side effects via term-level encodings of effectful programs [29]. These two principal applications of monads align with the two approaches we have seen above. The one where we change our calculus so it no longer defines pure functions (e.g. is non-deterministic, stateful or throws exceptions) and the one where we use a pure calculus to manipulate terms (denotations) that encode some interaction (e.g. dynamicity, continuations or event predication). Monad is a term from category-theory. Its meaning is relative to a category. For us, this will always be the category whose objects are types and whose arrows are functions between different types. A monad is formed by a functor and a pair of natural transformations that satisfy certain laws. In our case, this means that a monad is some type constructor (the functor part) and some combinators (the natural transformations) that follow some basic laws. To give an example of this, we can think of the functor T (α) = (α → o) → o together with combinators such as the type raising η(x) = λP. P x as a monad of quantification. The relationship between side effects in functional programming and com- putational semantics has been developed in several works [27,28],2 stretching as far back as 1977 [10]. The usefulness of monads in particular has been discov- ered by Shan in 2002 [26]. Since then, the problem that remained was how to compose several different monads in a single solution. Charlow used the popular method of monad morphisms3 to combine several monads in his dissertation [4]. Giorgolo and Asudeh have used distributive laws to combine monads [8], while Kiselyov has eschewed monads altogether in favor of applicative functors which enjoy easy composability [13]. Our approach follows the recent trend in adopting effects and handlers to combine side effects [2,11] and to encode effectful programs in pure functional programming languages [14,3]. The idea is that we can represent each of the relevant monads using an al- gebra. We can then combine the signatures of the algebras by taking a disjoint union. The free algebra of the resulting signature will serve as a universal repre- sentation format for the set of all terms built from any of the source algebras and closed under substitution. Then, we will build modular interpreters that will give meanings to the operators of the algebras in terms of individuals, truth-values and functions. In Sect. 2, we will introduce a formal calculus for working with the algebraic terms that we will use in our linguistic denotations. In Sect. 3, we will incremen- tally build up a fragment involving several of the linguistic phenomena and see the calculus in action. Before we conclude in Sect. 5, we will also discuss some of the formal properties of the calculus in Sect. 4. 2 Definition of the Calculus Our calculus is an extension of the simply-typed lambda calculus (STLC). We add terms of a free algebra into our language and a notation for writing han- dlers, composable interpreters of these terms. An operator of the free algebra corresponds to a particular interaction that a piece of natural language can have with its context (e.g. a deictic expression might request the speaker's identity using some operator speaker in order to find its denotation). A handler gives an interpretation to every occurrence of an operator within a term (e.g. direct speech introduces a handler for the operator speaker that essentially rebinds the current speaker to some other entity). 2 Side effects are to programming languages what pragmatics are to natural languages: they both study how expressions interact with the worlds of their users. It might then come as no surprise that phenomena such as anaphora, presupposition, deixis and conventional implicature yield a monadic description. 3 Also known as monad transformers in functional programming. Having sketched the general idea behind our calculus, we will now turn our attention to the specifics. We start by defining the syntactic constructions used to build the terms of our language. 2.1 Terms First off, let X be a set of variables, Σ a typed signature and E a set of operation symbols. In the definition below, we will let M , N . . . range over terms, x, y, z. . . range over variables from X , c, d. . . range over the names of constants from Σ and op, opi. . . range over the operation symbols in E. The terms of our language are composed of the following: M, N ::= λx. M M N x c op Mp (λx. Mc) η M L op1: M1, . . . , opn: Mn, η: Mη M N − ◦M C M [abstraction] [application] [variable] [constant] [operation] [injection] [handler] [extraction] [exchange] The first four constructions -- abstraction, application, variables and con- stants -- come directly from STLC with constants. The next four deal with the algebraic expressions used to encode computa- tions. Let us sketch the behaviors of these four kinds of expressions. The operation (op) and injection (η) expressions will serve as the construc- tors for our algebraic expressions. Algebraic expressions are usually formed by operation symbols and then variables as atoms. Instead of variables, our alge- braic expressions use terms from our calculus for atoms. The η constructor can thus take an ordinary term from our calculus and make it an atomic algebraic expression. The operation symbols op are then the operations of the algebra. The other three expression types correspond to functions over algebraic ex- pressions. -- The most useful is the handler L M.4 It is an iterator for the type of algebraic expressions. The terms M1,. . . ,Mn and Mη in L op1: M1, . . . , opn: Mn, η: Mη M are the clauses for the constructors op1,. . . ,opn and η, respectively. We will use handlers to define interpretations of operation symbols in algebraic ex- pressions. -- The cherry− If an algebraic expression is of the form η M , applying − ◦operator allows us to extract terms out of algebraic expressions. ◦ to it will yield M . 4 Pronounced "banana". See [20] for the introduction of banana brackets. -- The exchange operator C permits a kind of commutation between the λ- binder and the operation symbols. We will see its use later. 2.2 Types We now give a syntax for the types of our calculus along with a typing relation. In the grammar below, α, β, γ. . . range over types, ν ranges over atomic types from some set T and E, E′. . . range over effect signatures (introduced below). The types of our language consist of: α, β, γ ::= α → β ν FE(α) [function] [atom] [computation] The only novelty here is the FE(α) computation type. This is the type of algebraic expressions whose atoms are terms of type α and whose operation symbols come from the effect signature E. We call them computation types and we call terms of these types computations because our algebraic expressions will always represent some kind of program with effects. Effect signatures are similar to typing contexts. They are partial mappings from the set of operation symbols E to pairs of types. We will write the elements of effect signatures the following way -- op : α ֌ β ∈ E means that E maps op to the pair of types α and β.5 When dealing with effect signatures, we will often make use of the disjoint union operator ⊎. The term E1 ⊎ E2 serves as a constraint demanding that the domains of E1 and E2 be disjoint and at the same time it denotes the effect signature that is the union of E1 and E2. The typing rules are presented in Figure 1. The typing rules mirror the syntax of terms. Again, the first four rules come ◦] rules are self-explanatory and so we will focus on from STLC. The [η] and [− the [op], [L M] and [C] rules. [op] To use an operation op : α ֌ β, we provide the input parameter Mp : α and a continuation λx. Mc : β → FE(γ), which expects the output of type β. The resulting term has the same type as the body of the continuation, FE(γ). Before, we have spoken of terms of type FE(γ) as of algebraic expressions generated by the terms of type γ and the operators in the effect signature E. However, having seen the typing rule for operation terms, it might not be obvi- ous how such a term represents an algebraic expression. Traditionally, algebraic signatures map operation symbols to arities, which are natural numbers. Our effect signatures map each operation symbol to a pair of types α ֌ β. -- We can explain α by analogy to the single-sorted algebra of vector spaces. In a single-sorted vector space algebra, scalar multiplication is viewed as 5 The two types α and β are to be seen as the operation's input and output types, respectively. Γ, x : α ⊢ M : β Γ ⊢ λx. M : α → β [abs] x : α ∈ Γ Γ ⊢ x : α [var] Γ ⊢ M : α → β Γ ⊢ N : α Γ ⊢ M N : β c : α ∈ Σ Γ ⊢ c : α [const] [app] Γ ⊢ M : α Γ ⊢ η M : FE(α) [η] Γ ⊢ Mp : α Γ, x : β ⊢ Mc : FE(γ) op : α ֌ β ∈ E Γ ⊢ op Mp (λx. Mc) : FE(γ) [op] Γ ⊢ M : F∅(α) Γ ⊢ − ◦M : α [− ◦] E = {opi : αi ֌ βi}i∈I ⊎ Ef E ′ = E ′′ ⊎ Ef [Γ ⊢ Mi : αi → (βi → FE ′ (δ)) → FE ′ (δ)]i∈I Γ ⊢ Mη : γ → FE ′ (δ) Γ ⊢ N : FE(γ) Γ ⊢ L (opi: Mi)i∈I , η: Mη M N : FE ′ (δ) [L M] Γ ⊢ M : α → FE(β) Γ ⊢ C M : FE(α → β) [C] Fig. 1: The typing rules for our calculus. a unary operation parameterized by some scalar. So technically, there is a different unary operation for each scalar. All of our operations are similarly parameterized and α is the type of that parameter. -- The type β expresses the arity of the operator. When we say that an operator has arity β, where β is a type, we mean that it takes one operand for every value of β [24]. We can also think of the operator as taking one operand containing x : β as a free variable. We can look at the algebraic expression op Mp (λx. Mc) as a description of a program that: -- interacts with its context by some operator called op -- to which it provides the input Mp -- and from which it expects to receive an output of type β -- which it will then bind as the variable x and continue as the program de- scribed by Mc. [L M] The banana brackets describe iterators/catamorphisms.6 In the typing rule, E is the input's signature, E′ is the output's signature, γ is the input's atom type and δ is the output's atom type. E is decomposed into the operations that our 6 These are similar to recursors/paramorphisms. See [20] for the difference. Catamor- phisms are also known as folds and the common higher-order function fold found in functional programming languages is actually the iterator/catamorphism for lists. iterator will actually interpret, the other operations form a residual signature Ef . The output signature will then still contain the uninterpreted operations Ef combined with any operations E′′ that our interpretation might introduce. [C] We said before that the C function will let us commute λ and operations. Here we see that, on the type level, this corresponds to commuting the FE( ) and the α → type constructors. 2.3 Reduction Rules We will now finally give a semantics to our calculus. The semantics will be given in the form of a reduction relation on terms. Even though the point of the calculus is to talk about effects, the reduction semantics will not be based on any fixed evaluation order; any subterm that is a redex can be reduced in any context. The reduction rules are given in Fig. 2. (λx. M ) N → M [x := N ] λx. M x → M L (opi: Mi)i∈I , η: Mη M (η N ) → Mη N L (opi: Mi)i∈I , η: Mη M (opj Np (λx. Nc)) → Mj Np (λx. L (opi: Mi)i∈I , η: Mη M Nc) L (opi: Mi)i∈I , η: Mη M (opj Np (λx. Nc)) → opj Np (λx. L (opi: Mi)i∈I , η: Mη M Nc) − ◦(η M ) → M C (λx. η M ) → η (λx. M ) rule β rule η where x /∈ FV(M ) rule L η M rule L op M where j ∈ I and x /∈ FV((Mi)i∈I , Mη) rule L op ′ M where j /∈ I and x /∈ FV((Mi)i∈I , Mη) rule − ◦ rule Cη C (λx. op Mp (λy. Mc)) → op Mp (λy. C (λx. Mc)) rule Cop where x /∈ FV(Mp) Fig. 2: The reduction rules of our calculus. We have the β and η rules, which, by no coincidence, are the same rules as the ones found in STLC. The rest are function definitions for L M, − ◦ and C. By looking at the definition of L M, we see that it is an iterator. It replaces every occurrence of the constructors opj and η with Mj and Mη, respectively. The C function recursively swaps C (λx. ) with op Mp (λy. ) using the Cop rule. When C finally meets the η constructor, it swaps (λx. ) with η and termi- nates. Note that the constraint x /∈ FV(Mp) in rule Cop cannot be dismissed by renaming of bound variables. If the parameter Mp contains a free occurrence of x, the evaluation of C will get stuck. C is thus a partial function: it is only appli- cable when none of the operations being commuted with the λ-binder actually depend on the bound variable. 2.4 Common Combinators When demonstrating the calculus in the next section, the following combinators will be helpful. First, we define a sequencing operator. The operator ≫=, called bind, replaces all the α-typed atoms of a FE(α)-typed expression with FE(β)- typed expressions. More intuitively, M ≫= N is the program that first runs M to get its result x and then continues as the program N x. ≫= : FE(α) → (α → FE(β)) → FE(β) M ≫= N = L η: N M M The type constructor FE along with the operators η and ≫= form a free monad. Using this monadic structure, we can define the following combinators (variations on application) which we will make heavy use of in Section 3. ≪· : FE(α → β) → α → FE(β) F ≪· x = F ≫= (λf. η (f x)) ·≫ : (α → β) → FE(α) → FE(β) f ·≫ X = X ≫= (λx. η (f x)) ≪·≫ : FE(α → β) → FE(α) → FE(β) F ≪·≫ X = F ≫= (λf. X ≫= (λx. η (f x))) All of these operators associate to the left, so f ·≫ X ≪·≫ Y should be read as (f ·≫ X) ≪·≫ Y . Let ◦ : o → o → o be a binary operator on propositions. We define the following syntax for the same operator lifted to computations of propositions. ◦ : FE(o) → FE(o) → FE(o) M ◦ N = (λmn. m ◦ n) ·≫ M ≪·≫ N 3 Linguistic Phenomena as Effects 3.1 Deixis We will now try to use this calculus to do some semantics. Here is our tectogram- mar in an abstract categorial grammar presentation [5]. John, Mary, me : N P loves : N P −◦ N P −◦ S And here is our semantics. JJohnK := η j JMaryK := η m JmeK := speaker ⋆ (λx. η x) JlovesK := λOS. love ·≫ S ≪·≫ O In the semantics for JmeK, we use the speaker operation to retrieve the current speaker and make it available as the value of the variable x. The star (⋆) passed to speaker is a dummy value of the unit type 1. This, and all the semantics we will see in this paper, satisfies a homomorphism condition that whenever M : τ , then JM K : Jτ K. In our case, JN P K = FE(ι) and JSK = FE(o), where ι and o are the types of individuals and propositions, respectively. Of E, we assume that speaker : 1 ֌ ι ∈ E, since that is the type of speaker used in our semantics.7 With this fragment, we can give meanings to trivial sentences like: (1) John loves Mary. (2) Mary loves me. whose meanings we can calculate as: Jloves Mary JohnK ։ η (love j m) Jloves me MaryK ։ speaker ⋆ (λx. η (love m x)) (1) (2) The meaning of (1) is a proposition of type o wrapped in η, i.e. something that we can interpret in a model. As for the meaning of (2), the speaker oper- ator has propagated from the me lexical entry up to the meaning of the whole sentence. We now have an algebraic expression having as operands the proposi- tions love m x for all possible x : ι. In order to get a single proposition which is to be seen as the truth-conditional meaning of the sentence and which can be evaluated in a model, we will need to fix the speaker. We will do so by defining an interpreting handler. withSpeaker : ι → F{speaker:1֌ι}⊎E(α) → FE(α) withSpeaker = λsM. L speaker: (λxk. k s) M M Note that we omitted the η clause in the banana brackets above. In such cases, we say there is a default clause η: (λx. η x). 7 1 is the unit type whose only element is written as ⋆. withSpeaker s Jloves me MaryK ։ η (love m s) So far, we could have done the same by introducing a constant named me to stand in for the speaker. However, since handlers are part of our object language, we can include them in lexical entries. With this, we can handle phenomena such as direct (quoted) speech, that rebinds the current speaker in a certain scope. saidis : S −◦ N P −◦ S saidds : S −◦ N P −◦ S Those are our new syntactic constructors: one for the indirect speech use of said and the other for the direct speech use (their surface realizations would differ typographically or phonologically). Let us give them some semantics. JsaidisK = λCS. say ·≫ S ≪·≫ C = λCS. S ≫= (λs. say s ·≫ C) JsaiddsK = λCS. S ≫= (λs. say s ·≫ (withSpeaker s C)) Here we elaborated the entry for indirect speech so it is easier to compare with the one for direct speech, which just adds a use of the withSpeaker operator. (3) John said Mary loves me. (4) John said, "Mary loves me". Jsaidis (loves me Mary) JohnK ։ speaker ⋆ (λx. η (say j (love m x))) Jsaidds (loves me Mary) JohnK ։ η (say j (love m j)) (3) (4) The meaning of sentence (3) depends on the speaker (as testified by the use of the speaker operator) whereas in (4), this dependence has been eliminated due to the use of direct speech. 3.2 Quantification Now we turn our attention to quantificational noun phrases. every, a : N −◦ N P man, woman : N JeveryK := λN. scope (λc. ∀ ·≫ (C (λx. (N ≪· x) → (c x)))) (λx. η x) JaK := λN. scope (λc. ∃ ·≫ (C (λx. (N ≪· x) ∧ (c x)))) (λx. η x) JmanK := η man JwomanK := η woman The entries for every and a might seem intimidating. However, if we ignore the ·≫, the C, the ≪· and the overline on the logical operator, we get the familiar generalized quantifiers. These decorations are the plumbing that takes care of the proper sequencing of effects. Note that we make use of the C operator here. In the denotation of JaK, the term (λx. (N ≪· x) ∧ (c x)) describes the property to which we want to apply the quantifier ∃. However, this term is of type ι → FE(o). In order to apply ∃, we need something of type ι → o. Intuitively, the effects of E correspond to the process of interpretation, the process of arriving at some logical form of the sentence. They should thus be independent of the particular individual that we use as a witness for x when we try to model-check the resulting logical form. This independence allows us use the C operator without fear of getting stuck. Once we arrive at the type FE(ι → o), it is a simple case of using ∃ ·≫ to apply the quantifier within the computation type.89 While the terms that use the scope operator might be complex, the handler that interprets them is as simple as can be. SI = λM. L scope: (λck. c k) M M Same as with withSpeaker, SI will also be used in lexical items. By inter- preting the scope operation in a particular place, we effectively determine the scope of the quantifier. Hence the name of SI, short for Scope Island. If we want to model clause boundaries as scope islands, we can do so by inserting SI in the lexical entries of clause constructors (in our case, the verbs). JlovesK := λOS. SI (JlovesK O S) JsaidisK := λCS. SI (JsaidisK C S) JsaiddsK := λCS. SI (JsaiddsK C S) Whenever we use the semantic brackets on the right-hand side of these revised definitions, they stand for the denotations we have assigned previously. (5) Every man loves a woman. (6) John said every woman loves me. (7) John said, "Every woman loves me". Jloves (a woman) (every man)K ։ η (∀x.man x → (∃y.woman y ∧ love x y)) withSpeaker s Jsaidis (loves me (every woman)) JohnK ։ η (say j (∀x.woman x → love x s)) Jsaidds (loves me (every woman)) JohnK ։ η (say j (∀x.woman x → love x j)) (5) (6) (7) 8 Other solutions to this problem include separating the language of logical forms and the metalanguage used in the semantic lexical entries to manipulate logical forms as objects [13]. 9 Our C has been inspired by an operator of the same name proposed in [9]: de Groote introduces a structure that specializes applicative functors in a similar direction as monads by introducing the C operator and equipping it with certain laws; our C operator makes the FE type constructor an instance of this structure. The calculus offers us flexibility when modelling the semantics. We might choose to relax the constraint that clauses are scope islands by keeping the old entries for verbs that do not use the SI handler. We might then want to add the SI handler to the lexical entry of saidds, next to the withSpeaker handler, so that quantifiers cannot escape quoted expressions. We might also allow for inverse scope readings by, e.g., providing entries for transitive verbs that evaluate their arguments right-to-left (though then we would have to watch out for crossover effects if we were to add anaphora). 3.3 Conventional Implicature Our goal is to show the modularity of this approach and so we will continue and plug in one more phenomenon into our growing fragment: conventional implicatures, as analyzed by Potts [23]. Specifically, we will focus on nominal appositives. appos : N P −◦ N P −◦ N P best-friend : N P −◦ N P JapposK := λXY. X ≫= (λx. SI (η x = Y ) ≫= (λi. implicate i (λz. η x))) Jbest-friendK := λX. best-friend ·≫ X In the denotation of the nominal appositive construction, appos, we first evaluate the head noun phrase X : JN P K to find its referent x : ι. We then want to implicate that x is equal to the referent of Y . The term η x = Y (note the line over =) is the term that computes that referent and gives us the proposition we want. We also want to state that no quantifier from within the appositive Y should escape into the matrix clause and so we wrap this computation in the SI handler to establish a scope island. Finally, we pass this proposition as an argument to implicate and we return x as the referent of the noun phrase. The point of the implicate operation is to smuggle non-at-issue content outside the scope of logical operators. The contribution of an appositive should survive, e.g., logical negation.10 The place where we will accommodate the im- plicated truth-conditions will be determined by the use of the following handler: accommodate : F{implicate:o֌1}⊎E(o) → FE(o) accommodate = λM. L implicate: (λik. η i ∧ k ⋆) M M We want conventional implicatures to project out of the common logical op- erators. However, when we consider direct quotes, we would not like to attribute the implicature made by the quotee to the quoter. We can implement this by inserting the accommodate handler into the lexical entry for direct speech. JsaiddsK := λCS. SI (S ≫= (λs. say s ·≫ (withSpeaker s (accommodate C)))) Consider the following three examples. 10 In our limited fragment, we will only see it sneak out of a quantifier. (8) John, my best friend, loves every woman. (9) Mary, everyone's best friend, loves John. (10) A man said, "My best friend, Mary, loves me". In (8), the conventional implicature that John is the speaker's best friend projects from the scope of the quantifier. On the other hand, in (10), the impli- cature does not project from the quoted clause and so it is not misattributed. withSpeaker s (accommodate Jloves (every woman) (appos John (best-friend me))K) ։ η ((j = best-friend s) ∧ (∀x.woman x → love j x)) (8) accommodate Jloves John (appos Mary (best-friend everyone))K ։ η ((∀x.m = best-friend x) ∧ (love m j)) Jsaidds (loves me (appos (best-friend me) Mary)) (a man)K ։ η (∃x.man x ∧ say x ((best-friend x = m) ∧ (love (best-friend x) x))) (9) (10) 3.4 Summary Let us look back at the modularity of our approach and count how often during the incremental development of our fragment we either had to modify existing denotations or explicitly mention previous effects in new denotations. When adding quantification: -- in the old denotations of verbs, we added the new SI handler so that clauses form scope islands When adding appositives and their conventional implicatures: -- in the old denotations JsaiddsK, we added the new accommodate handler to state that conventional implicatures should not project out of quoted speech -- in the new denotation JapposK, we used the old SI handler to state that appositives should form scope islands Otherwise, none of the denotations prescribed in our semantic lexicon had to be changed. We did not have to type-raise non-quantificational NP constructors like JJohnK, JmeK or Jbest-friendK. With the exception of direct speech, we did not have to modify any existing denotations to enable us to collect conventional implicatures from different subconstituents. Furthermore, all of the modifications we have performed to existing denota- tions are additions of handlers for new effects. This gives us a strong guarantee that all of the old results are conserved, since applying a handler to a computa- tion which does not use the operations being handled changes nothing. The goal of our calculus is to enable the creation of semantic lexicons with a high degree of separation of concerns. In this section, we have seen how it can be done for one particular fragment. 4 Properties of the Calculus The calculus defined in Sect. 2 and to which we will refer as L λ M, has some satisfying properties. First of all, the reduction rules preserve types of terms (subject reduction). The reduction relation itself is confluent and, for well-typed terms, it is also terminating. This means that typed L λ M is strongly normalizing. The proof of subject reduction is a mechanical proof by induction. For conflu- ence and termination, we employ very similar strategies: we make use of general results and show how they apply to our calculus. Due to space limitations, we will pursue in detail only the proof of confluence. Our reduction relation is given as a set of rules which map redexes matching some pattern into contracta built up out of the redexes' free variables. However, our language also features binding, and so some of the rules are conditioned on whether or not certain variables occur freely in parts of the redex. Fortunately, such rewriting systems have been thoroughly studied. Klop's Combinatory Re- duction Systems (CRSs) [16] is one class of such rewriting systems. We will make use of the result that orthogonal CRSs are confluent [16]. A CRS is orthogonal if it is left-linear and non-ambiguous. We will need to adapt our formulation of the reduction rules so that they form a CRS and we will need to check whether we satisfy left-linearity and non-ambiguity (we will see what these two properties mean when we get to them). We refer the reader to [16] for the definition of CRSs. The key point is that in a CRS, the free variables which appear in the left-hand side of a rewrite rule, called metavariables, are explicitly annotated with the set of all free variables that are allowed to occur within a term which would instantiate them. This allows us to encode all of our x /∈ F V (M ) constraints. One detail which must be taken care of is the set notation (opi: Mi)i∈I and the indices I used in the L M rules. We do away with this notation by adding a separate rule for every possible instantiation of the schema. This means that for each sequence of distinct operation symbols op1,. . . ,opn, we end up with: -- a special rewriting rule L op1: M1, . . . , opn: Mn, η: Mη M (η N ) → Mη N -- for every 1 ≤ i ≤ n, a special rewriting rule L op1: M1, . . . , opn: Mn, η: Mη M (opi Np (λx. Nc(x))) → Mi Np (λx. L op1: M1, . . . , opn: Mn, η: Mη M Nc(x)) -- for every op′ ∈ E \ {opi1 ≤ i ≤ n}, a special rewriting rule L op1: M1, . . . , opn: Mn, η: Mη M (op′ Np (λx. Nc(x))) → op′ Np (λx. L op1: M1, . . . , opn: Mn, η: Mη M Nc(x)) So now we have a CRS which defines the same reduction relation as the rules we have shown in 2.3. Next, we verify the two conditions. Left-linearity states that no left-hand side of any rule contains multiple occurrences of the same metavariable. By examining our rules, we find that this is indeed the case.11 11 Multiple occurrences of the same opi are alright, since those are not metavariables. Non-ambiguity demands that there is no non-trivial overlap between any of the left-hand sides.12 In our CRS, we have overlaps between the β and the η rules. We split our CRS into one with just the η rule (→η) and one with all the other rules (→L λ M). Now, there is no overlap in either of these CRSs, so they are both orthogonal and therefore confluent. We then use the Lemma of Hindley-Rosen [17, p. 7] to show that the union of →L λ M and →η is confluent when →L λ M and →η are both confluent and commute together. For that, all that is left to prove is that →L λ M and →η commute. Thanks to another result due to Hindley [17, p. 8], it is enough to prove that for all a, b and c such that a →L λ M b and a →η c, we have a d such that b ։η d and c →= L λ M d. The proof of this is a straightforward induction on the structure of a. 5 Conclusion In our contribution, we have introduced a new calculus motivated by modelling detailed semantics and inspired by current work in programming language the- ory. Our calculus is an extension of the simply-typed lambda calculus which is the de facto lingua franca of semanticists. Its purpose is to facilitate the communication of semantic ideas without depending on complex programming languages [19,15] and to do so with a well-defined formal semantics. We have demonstrated the features of our calculus on several examples ex- hibiting phenomena such as deixis, quantification and conventional implicature. While our calculus still requires us to do some uninteresting plumbing to be able to correctly connect all the denotations together, we have seen that the result- ing denotations are very generic. We were able to add new phenomena without having to change much of what we have done before and the changes we have made arguably corresponded to places where the different phenomena interact. Finally, we have also shown that the calculus shares some of the useful prop- erties of the simply-typed lambda calculus, namely strong normalization. In future work, it would be useful to automate some of the routine plumbing that we have to do in our terms. It will also be important to test the methodology on larger and more diverse fragments (besides this fragment, we have also created one combining anaphora, quantification and presupposition [19]). Last but not least, it would be interesting to delve deeper into the foundational differences between the approach used here, the monad transformers used by Charlow [4] and the applicative functors used by Kiselyov [13]. References 1. Barker, C.: Continuations and the nature of quantification. Natural language se- mantics 10(3), 211 -- 242 (2002) 2. Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Log. Algebr. Meth. Program. 84(1), 108 -- 123 (2015) 12 The definition of (non-trivial) overlap is the same one as the one used when defining critical pairs. See [16] for the precise definition. 3. Brady, E.: Programming and reasoning with algebraic effects and dependent types. In: ACM SIGPLAN Notices (2013) 4. Charlow, S.: On the semantics of exceptional scope. Ph.D. thesis, New York Uni- versity (2014) 5. de Groote, P.: Towards abstract categorial grammars. In: Proceedings of the 39th Annual Meeting on Association for Computational Linguistics (2001) 6. de Groote, P.: Type raising, continuations, and classical logic. In: Proceedings of the thirteenth Amsterdam Colloquium (2001) 7. de Groote, P.: Towards a montagovian account of dynamics. In: Proceedings of SALT. vol. 16 (2006) 8. Giorgolo, G., Asudeh, A.: Natural language semantics with enriched meanings (2015) 9. de Groote, P.: On Logical Relations and Conservativity. In: NLCS'15. Third Work- shop on Natural Language and Computer Science (2015) 10. Hobbs, J., Rosenschein, S.: Making computational sense of montague's intensional logic. Artificial Intelligence 9(3), 287 -- 306 (1977) 11. Kammar, O., Lindley, S., Oury, N.: Handlers in action. In: ACM SIGPLAN Notices (2013) 12. Kamp, H., Reyle, U.: From discourse to logic. Kluwer Academic Pub (1993) 13. Kiselyov, O.: Applicative abstract categorial grammars. In: Proceedings of the Third Workshop on Natural Language and Computer Science (2015) 14. Kiselyov, O., Sabry, A., Swords, C.: Extensible effects: an alternative to monad transformers. In: ACM SIGPLAN Notices (2013) 15. Kiselyov, O., Shan, C.c.: Lambda: the ultimate syntax-semantics interface (2010) 16. Klop, J.W., Van Oostrom, V., Van Raamsdonk, F.: Combinatory reduction sys- tems: introduction and survey. Theoretical computer science (1993) 17. Klop, J.W., et al.: Term rewriting systems. Handbook of logic in computer science 2, 1 -- 116 (1992) 18. Lebedeva, E.: Expression de la dynamique du discours `a l'aide de continuations. Ph.D. thesis, Universit´e de Lorraine (2012) 19. Mars´ık, J., Amblard, M.: Algebraic Effects and Handlers in Natural Language Interpretation. In: Natural Language and Computer Science (Jul 2014) 20. Meijer, E., Fokkinga, M., Paterson, R.: Functional programming with bananas, lenses, envelopes and barbed wire. In: Functional Programming Languages and Computer Architecture (1991) 21. Moggi, E.: Notions of computation and monads. Information and computation 93(1), 55 -- 92 (1991) 22. Plotkin, G., Pretnar, M.: Handlers of algebraic effects. In: Programming Languages and Systems, pp. 80 -- 94. Springer (2009) 23. Potts, C.: The logic of conventional implicatures. Oxford University Press (2005) 24. Pretnar, M.: Logic and handling of algebraic effects. Ph.D. thesis, The University of Edinburgh (2010) 25. Qian, S., Amblard, M.: Event in compositional dynamic semantics. In: Logical Aspects of Computational Linguistics. Springer (2011) 26. Shan, C.: Monads for natural language semantics. arXiv cs/0205026 (2002) 27. Shan, C.: Linguistic side effects. Ph.D. thesis, Harvard University (2005) 28. Van Eijck, J., Unger, C.: Computational semantics with functional programming. Cambridge University Press (2010) 29. Wadler, P.: The essence of functional programming. In: Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages (1992)
1903.10118
1
1903
2019-03-25T03:40:15
End-to-End Learning Using Cycle Consistency for Image-to-Caption Transformations
[ "cs.CL", "cs.CV" ]
So far, research to generate captions from images has been carried out from the viewpoint that a caption holds sufficient information for an image. If it is possible to generate an image that is close to the input image from a generated caption, i.e., if it is possible to generate a natural language caption containing sufficient information to reproduce the image, then the caption is considered to be faithful to the image. To make such regeneration possible, learning using the cycle-consistency loss is effective. In this study, we propose a method of generating captions by learning end-to-end mutual transformations between images and texts. To evaluate our method, we perform comparative experiments with and without the cycle consistency. The results are evaluated by an automatic evaluation and crowdsourcing, demonstrating that our proposed method is effective.
cs.CL
cs
End-to-End Learning Using Cycle Consistency for Image-to-Caption Transformations Keisuke Hagiwara1, Yusuke Mukuta1,2, and Tatsuya Harada1,2 1The University of Tokyo 2RIKEN AIP {hagiwara, mukuta, harada}@mi.t.u-tokyo.ac.jp Abstract So far, research to generate captions from images has been carried out from the viewpoint that a caption holds suf- ficient information for an image. If it is possible to generate an image that is close to the input image from a generated caption, i.e., if it is possible to generate a natural language caption containing sufficient information to reproduce the image, then the caption is considered to be faithful to the im- age. To make such regeneration possible, learning using the cycle-consistency loss is effective. In this study, we propose a method of generating captions by learning end-to-end mu- tual transformations between images and texts. To evaluate our method, we perform comparative experiments with and without the cycle consistency. The results are evaluated by an automatic evaluation and crowdsourcing, demonstrating that our proposed method is effective. 1. Introduction Generating captions from images is useful, and research has been conducted to solve this problem using machine learning. For example, there are many situations where it is difficult for blind people to correctly understand images on the web. During Internet shopping, it is necessary to obtain information on images of products in audio or text form to shop as expected. In addition, image captioning is required for non-blind users. For example, when the only informa- tion a user possesses concerning the content they are inter- ested in is an image, it would be helpful for obtaining in- formation via a search if it is possible to input this image and acquire text for the search. Moreover, when it is neces- sary to utilize words only to describe a captured scene, it is necessary to convey the situation captured by the camera in text form. In addition, applications for providing assistance based on the road condition while driving a car or under- Figure 1. Simple diagram of the system of our proposed method. standing the situation in a room can also be considered. A caption should faithfully describe an image. In this study, if the image recalled from a generated caption is close to the original image, then the caption is considered to rep- resent the image faithfully. Thus, we propose a method to generate captions by learning to regenerate images using mutual transformations between images and texts. Previous research has been conducted to make it possible to search an original image from a generated sentence [14]. However, in that case if only the minimum information necessary to de- scribe the differences from other images for identification is available, then image retrieval can be considered possi- ble. On the other hand, to generate an image from a caption generated from the input image, the caption must include in- formation that is essential to convey the input image. In ad- dition, the caption must make it possible to correctly under- stand the information when recalling an image from a cap- tion. Therefore, an approach that attempts to generate cap- tions from images by extracting the relationships between images and texts using a mutual transformation through ma- chine learning can constitute a useful contribution. In this paper, we aimed to improve the performance of captions generated from images by incorporating a learn- ing method using mutual transformations. A generated cap- tion must be grammatically correct, such that it is easy for humans to read, and we assume that color information is 1 DiscriminatorDiscriminatormatch the captionor notmatch the imageor notGenerator Generator ImageCaption not described for each pixel. To realize such captions, we design a generator using generative adversarial networks (GANs). In addition, mutual transformations are performed between images and texts using a cycle-consistency loss. A simple diagram of the system of our model is presented in Figure 1. There are two generators and two discriminators in this model. The contributions of this research are summarized as fol- lows. • We propose a method for image captioning through training to regenerate the input image. • The effectiveness of the proposed method is demon- strated by an automatic evaluation, and crowdsourcing to evaluate the degree to which images are described. 2. Related Work Here, we introduce related research on image-to-text generation, text-to-image generation, and mutual transfor- mations between different domains using GANs. 2.1. Image Captioning Object recognition in images, understanding the relation- ships between objects, and the generation of grammatically correct sentences are required to generate captions from images, and research to make this possible has been con- ducted in recent years using machine learning. We refer the reader to the representative study of Vinyals et al. [27]. This represents an application of the encoder -- decoder model, which achieves a strong performance in machine translation and uses a convolutional neural network (CNN) to encode feature from images and decode captions using a recur- rent neural network (RNN). Here, long short-term memory (LSTM) [8] is employed for the RNN. In addition, meth- ods incorporating attention have recently become main- stream [29]. When generating a caption, the first word is acquired by performing discrete sampling, such as search- ing for the maximum value of the appearance probability of the next word generated from the image features. Then, the next word is acquired from that word in the same manner, and so on. In the method of Dai et al. [3], the authors combine the image captioning network of Vinyals et al. with a network for evaluating the generated captions. In the generator, the latent variable connected to an image feature extracted by the CNN is passed to LSTM. The generated caption and im- age are input into a network for evaluation, and the image features extracted by the CNN are multiplied by the text fea- tures extracted by LSTM to determine whether the caption matches the image. In the unsupervised image captioning method of Feng et al. [5], the authors proposed an exten- sion to unpaired data. 2.2. GANs for Text Generation GANs [6] consist of two parts: a generator and discrimi- nator. In GANs, parameters of a generator are updated using gradients from a discriminator. However, because text gen- eration usually involves indifferentiable discrete sampling, as in the study of Vinyals et al., it is not possible to propa- gate gradients from discriminators and train networks. With this motivation, SeqGAN was proposed by Yu et al. [30] as a method enabling the generation of text from latent variables using GANs. As for ordinary GANs, the discriminator de- termines whether the input text is real or fake. An RNN is employed as the generator, but reinforcement learning is utilized for training. The parameter of the generator is uti- lized as the policy, the result of the discriminator acts as the reward, and the parameter is updated such that the reward is maximized using the policy gradient method. Because the discriminator can only calculate the reward for data series for which generation has been completed, the remainder of a partially generated series is generated using a Monte Carlo search, and the reward is calculated approximately. Using this method, it is difficult to start learning from random pa- rameters, owing to the use of the policy gradient method, and pre-training is required. On the other hand, GANs for sequences of discrete el- ements with the Gumbel-softmax distribution (GSGAN), proposed by Kusner et al. [11], utilizes the Gumbel- softmax [9] as a generator, which is differentiable. Here, the Gumbel-softmax is as shown in Equation 1. π1, π2, ..., πk is the probability of each class before putting it in gumbel- softmax, τ is the temperature parameter. As τ is smaller, the output is closer to the one-hot vector, and as τ is larger, the output is closer to uniform distribution. Even if the text is generated in one go from the latent variable to the end, such as in the method of generating the first word from the la- tent variable and then generating each following word from the current word, parameter updating by error backpropa- gation is enabled. Because the Gumbel-softmax can out- put the approximate one-hot vector, it can obtain the next predicted word by approximation of the one-hot expression without performing the process of searching for the maxi- mum value. This achieves differential sampling, and trains a generator without using reinforcement learning. However, in this study only data sequences of short length, such as lists of symbols, are generated. An additional study em- ploys the Gumbel-softmax to generate image descriptions using GANs [23]. u ∼ Uniform(0, 1) g = − log(− log(u)) (cid:80)k zi = 2 exp((log(πi) + gi)/τ ) j=0 exp((log(πj) + gj)/τ ) (1) f or i = 1, ..., k 2.3. Text-to-Image Generation The method AlignDRAW [15] was proposed by Man- simov et al. to generate images from text. This approach estimates the relationship between text features and a gen- erated image using an RNN, but produces a blurred image that only captures rough features. Reed et al. [22] generated images from text using GANs. The DCGAN [20] method, proposed by Radford et al., is a mainstream approach using GANs to generate images from latent variables, and employs a CNN. In addition, CGAN [16] makes it possible to generate an image that matches a condition label. Using the same network as CGAN, in the method of Reed et al. the text feature vector extracted from a caption is connected to the latent variable as a condition, and input into the generator. The discrim- inator determines whether the generated image is valid for the caption. A method [21] combining a CNN and RNN is also employed to extract features from captions. The model trained using this method is utilized as a text encoder, but this component is employed without updates when training GANs. The StackGAN method of Zhang et al. [31] is another approach for generating high-resolution images. Like that of Reed et al., this method is based on CGAN, but the train- ing is divided into two stages. An image satisfying the con- ditions is generated in the first stage, and a high-resolution image is generated in the second stage. Here, if the text feature ϕt extracted from the caption t is employed as it is, then the input vector is biased, and learning becomes un- stable. To circumvent this issue, to maintain diversity the authors employ a condition c sampled randomly from the normal distribution, whose average µ and diagonal covari- ance matrix Σ are calculated from the text feature ϕt. In ad- dition, to avoid overfitting the Kullback -- Leibler divergence is incorporated into the loss function, representing the dis- tance between the standard normal distribution and the nor- mal distribution obtained from the feature. An additional study enables the generation of high-resolution images by end-to-end learning without division into two stages [32]. 2.4. Transformation Using the Cycle Consistency The CycleGAN [33] method, proposed by Zhu et al., em- ploys GANs for mutual transformations between images. The authors combined two GANs, and enabled color con- versions of images such as horses and zebras, and summer and winter landscapes. In CycleGAN, let X and Y represent the image domains, such as summer and winter. Then, we have four networks: the X to Y generator GY , discriminator of Y DY , Y to X generator GX, and discriminator of X DX. In this model, the data of the domain Y is generated from that of the domain X, and the data of X is regenerated from the generated data. The data of X is generated from that of Y, and the data of Y is regenerated from the generated data 3 in the same manner. CycleGAN utilizes two types of loss function for learning. The reason for employing two is that they combine two GANs. One is the same as for regular GANs. The other is called the cycle-consistency loss, and represents the error between the original data and the result obtained by passing this through the two generators. This is treated as a loss function for the generators, and is not used to train the discriminators. In this manner, CycleGAN enables mutual transformations of images, even for datasets that do not contain pair data. Text2image2textGAN, pro- posed by Gorti et al. [7], is an example of using the cycle- consistency to generate images from text. Here, an image is generated from a text, a text is generated from the result- ing image, and learning is performed using the consistency loss between the regenerated and original texts. The model of Vinyals et al. is employed in the image-to-text gener- ator, and so differentiable sampling as in GSGAN is not performed. 3. Proposed Model Our model performs mutual transformations between images and captions with reference to CycleGAN. The en- tire pipeline is shown in Figure 2. Unlike CycleGAN, which performs transformations between images, pre-training is performed to handle texts consisting of series data, so that a grammatically correct description and an image without noise can be generated. We explain each procedure in detail below. 3.1. Image-to-Caption GAN In GANs that generate captions from images, two types of generator are prepared. These generators share the same network parameters. One is employed to generate captions from images in the dataset. This generator is shown in Figure 2 (a). Incorporat- ing the method of GSGAN, we utilized the Gumbel-softmax to generate the text from an image feature. This is because a further image is generated from the generated caption, and error backpropagation can be performed during learning. The other generator is employed to generate a caption from a generated image. This generator is shown in Fig- ure 2 (b), and is based on the method of Vinyals et al. Here, the trained model of VGG16 [24] was employed as a CNN for extracting features of images. An image is input into the trained model, and pooling is performed in the fifth layer. The output of this is then input into LSTM through the lin- ear layer, and the features are extracted by the hidden vector of LSTM. The features are utilized as the first LSTM hidden vector of the caption generation component, the word rep- resenting the beginning of the sentence is employed as the first input, and the cross entropy of the probability distribu- tion of the next word to be predicted and the ground truth are calculated. The first word of the ground truth is adopted Figure 2. Our proposed model. The upper-left figure (a) illustrates the regeneration of an image. IE and gs in this figure indicate the image encoder and Gumbel -- softmax. The lower-left figure (b) depicts the regeneration of a text. The upper-right figure (c) illustrates the discriminator for images, and the lower-right figure (d) illustrates the discriminator of texts. as the next input, and cross entropy of the probability dis- tribution of the next word to be predicted and the ground truth are again calculated. The generator is pre-trained by calculating the sum of the cross entropies until the end of the sentence in the same manner. A caption and an image are input into the discrimina- tor. The captions generated by the generator are approxi- mated as one-hot expressions by the Gumbel-softmax, and the sentences of the ground truth are represented by one-hot expressions. By multiplying the image features extracted by the trained VGG16 model with the caption features ex- tracted by LSTM, it is determined whether captions match images. To prevent the discriminator from becoming overly strong, it is not pre-trained. When training both generators and classifiers, the param- eters of the VGG16 component are not updated, as these are contained in the trained model. 3.2. Caption-to-Image GAN We designed the training of GANs that generate images from captions based on the first stage generator and dis- criminator of StackGAN. The loss function of the gener- ator is the same as that of StackGAN, such that the amount of Kullback -- Leibler information is added to the loss func- tion of the normal generator of GANs. As with StackGAN, the discriminator also employs either the generated image or correct image from the dataset and the correct text fea- tures as input to determine whether an image matches the text. Here, the convolution and linear combination layers from the SNGAN [17] method are adopted, such that spec- tral normalization is performed in the discriminator to sta- bilize the learning. Next, the resulting caption is input into a text encoder to extract features and generate an image from these fea- tures. In the method of Reed et al. and StackGAN, the text 4 Down- sampling ImageImageDiscriminator DXCNNLSTM p1LogisticDotProd CNNImage (real) LSTM LSTM LSTM p2p3p4gsgsgsgsthisbirdahas<bos>thisbirdhasLSTM LSTM LSTM LSTM thisbird<eos>hasImage (real) TextGenerator GYText Encoder φyΣμε~N(0,1)z~N(0,1)Up- sampling Image ImageGenerator GXMAE with IE CrossEntropy Text Encoder φyΣμε~N(0,1)z~N(0,1)Up- sampling ImageImageGenerator GXText (real)CNNLSTM p1LSTM LSTM LSTM p2p3p4<bos>thisbirdhasTextGenerator GYConditioning Augmentation Conditioning Augmentation TextDiscriminator DYText Encoder φyText (real)Text (real)LcycLcyc(a)(b)(d)(c) encoder employs a learned model, and parameters of the model are not updated while training for image generation. In this study, bi-directional LSTM [2] is employed as the text encoder, to extract the forward and backward features of the caption and connect them. While the effects of words increase at the end of the text in ordinary LSTM, the ef- fects of words at the beginning of text can also be increased by employing bi-directional LSTM. This text encoder was trained by the generator using its loss function. The generator, discriminator, and text encoder were pre- trained. 3.3. Image-to-Caption Mutual Transformation For the mutual transformation, it is necessary to calcu- late the cycle-consistency loss from the results through the two generators and the original input, and to utilize the loss for learning. We used two types of L1 loss, for the cycle-consistency loss between images (Figure 2 (a)) and the cross entropy for the cycle-consistency loss between captions (Figure 2 (b)). Images should not only be directly compared on a pixel- by-pixel basis, but the contents of the images should also be compared. Therefore, the L1 loss calculated from a direct image and that calculated from the value of the intermediate layer passing the image through VGG16 were incorporated. Specifically, we employed the calculation results from up to the fifth pooling layer. In addition, weighting was per- formed using hyper parameters, so that the effect of the L1 loss calculated through VGG16 was greater than that of the directly calculated L1 loss. The technique of comparing im- ages through the image encoder and calculating the loss is also employed in SRGAN [12], making it possible to pre- vent blurry outputs, such as those occurring when averaging pixel values when comparing images directly. For the cycle-consistency loss between captions, we did not employ the generated text as it was, but rather we used the vector before passing the Gumbel-softmax, which rep- resented the probability distribution of the predicted word, and calculated the cross entropy using the captions of the dataset. 3.4. Objective Function Equation 2 defines the objective function of GANs that generates captions from images. Here, the domain X is an image and Y is a text. Furthermore, GY and DY are the generator and discriminator of captions, respectively. max DY LDY = E(x,y)∼pdata(x,y)[log DY (y, x)] + Ex∼pdata(x)[log(1 − DY (GY (x), x))] (cid:20) (cid:21) (2) min GY LGY = Ex∼pdata(x) − log DY (GY (x)) 1 − DY (GY (x)) Equation 3 defines the objective function of GANs that 5 generates images from captions. Here, GX and DX are the generator and discriminator of images, respectively. Fur- thermore, ϕy denotes features extracted by the text encoder. The text encoder component is trained using only the gen- erator's loss function. Here, the hyper parameter was set as λKL = 2.0. max DX LDX = (3) E(x,y)∼pdata(x,y)[log DX (x, ϕy)]+ Ez∼pz,y∼pdata(y)[log(1 − DX (GX (z, ϕy), ϕy))] min LGX = GX Ez∼pz,y∼pdata(y)[log(1 − DX (GX (z, ϕy), ϕy))]+ λKLDKL(N (µ(ϕy), Σ(ϕy))(cid:107)N (0, 1)) Finally, Equation 4 defines the objective function of the cycle-consistency loss. Here, FIE is the image encoder, and we employed VGG16. Furthermore, yt is the t-th word in a caption and T is the length of a caption. Here, the hyper parameters were set as λ1 = 1.0, λ2 = 1, 000, and λ3 = 0.01. Lcyc min GY ,GX = Ex∼pdata(x)[λ1(cid:107)GX (GY (x)) − x(cid:107)1] + Ex∼pdata(x)[λ2(cid:107)FIE(GX (GY (x))) − FIE(x)(cid:107)1] + Ey∼pdata(y)[−λ3 yt log(GY (GX (yt)))] T(cid:88) (4) t=0 In summary, the objective function of the proposed method is defined as in Equation 5. max DY ,DX min GY ,GX VDY ,DX = LDY + LDX VGY ,GX = LGY + LGX + Lcyc (5) 4. Experiments Here, we describe an experiment performed to generate a caption from an image, and the generated caption is eval- uated. 4.1. Datasets We employed a dataset combining Caltech-UCSD Bird [28], consisting of bird images, and Oxford-102 Flower [18], consisting of flower images. The dataset contains attached captions, and was provided by Reed et al. [21]. Unlike in CycleGAN, this is a paired dataset. Be- cause this dataset is limited to birds and flowers, it is often employed to study image generation from text. Therefore, we considered it to be appropriate for this study. Some ex- amples are presented in Figure 3. Figure 3. Some examples of the dataset provided by Reed et al. Here, 10 captions were attached to each image using Amazon Mechanical Turk (AMT) [1]. Each of these 10 sentences is independent. Workers ware instructed not to mention background, so the information that said it was in the sea or forest was not included in the captions. There are a total of 11,788 images of birds in 200 classes, and a total of 8,188 images of flowers in 102 classes. Of these, 90% were utilized as training data and 10% as test data. Specifically, 10,609 training and 1,179 test data items were from the bird dataset, and 7,369 training and 819 test data items were from the flower dataset. Here, the lengths of the captions included in each dataset are shown in Figure 4. The bird and flower datasets vary in length. Therefore, to make the lengths of the utilized captions uniform, one of the 10 captions for each image was selected to be utilized according to the following method. • Remove periods, commas, and semicolons from the captions. • Align all captions to 20 words in length by filling the end of the caption with a symbol indicating the end of the sentence or deleting the 21st and later words. • During training, select one of the 10 captions at ran- dom for each iterator (however, the caption shall be limited to five or more words except for the sentence- ending symbol). The resulting captions of the dataset were utilized in the experiment. In addition, because the bird dataset was pro- vided with bounding-box information indicating the part of 6 the image where the bird appears, this part was cropped and utilized. The images were RGB representations of size 64 × 64. 4.2. Experimental Setup We generated captions of 20 words in length from 64 × 64-sized images. When a caption was input into the text en- coder, consisting of bi-directional LSTM, the text features were extracted as a 1,024-dimensional vector, in which for- ward vector and backward vectors of 512 dimensions were connected, and size-64 × 64 image was generated from the text features and a 100-dimensional latent variable accord- ing to the normal distribution. The training consisted of 500 epochs in pre-training and 200 in subsequent train- ing. Adam [10] and weight decay were employed for op- timization during the whole training period, including pre- training. As a comparison method, image captioning and image regeneration were performed by combining GX and GY , which were trained the same number of times as the pro- posed method, without using the cycle-consistency loss. 4.3. Qualitative Results Some successful examples from this experiment are pre- sented in Figure 5. The captions were generated using the proposed method from images in the dataset for test. When the symbol indicating the end of the sentence was output, words after that were deleted. They correctly describe the colors of birds or flowers overall, and also mention the col- ors of beaks or shapes of petals. Furthermore, the captions BirdsFlowersthe medium sized bird has a dark grey color, a black downward curved beak, and long wings.the bird is dark grey brown with a thick curved bill and a flat shaped tail.bird has brown body feathers, white breast feathers and black beakthis bird has a dark brown overall body color, with a small white patch around the base of the bill.the bird has very long and large brown wings, as well as a black body and a long black beak.it is a type of albatross with black wings, tail, back and beak, and has a white ring at the base of its beak.this bird has brown plumage and a white ring at the base of its long, curved brown beak.the entire body is dark brown, as is the bill, with a white band encircling where the bill meets the head.this bird is gray in color, with a large curved beak.a large gray bird with a long wingspan and a long black beak.this flower is blue and green in color, with petals that are oval shaped.the petals of the flower are bright blue with white lines, and the stamen is bright green with black dots.the flower has stamen and the petals are green in color.this flower has green petals and purple and green stamen.the flower shown has green pollen tubes with green sepal and blue petalsa large flower with neon colors and a large green stigma.this blue and white flower has pointed petals and green sepals.this flower has a flat row of pointed white petals and a flat row of thin blue filament on top of that.this flower has petals that are green and has purple stringy stamenthis flower has large green petals under a fringed set of purple and white quills. Table 2. Evaluation of faithfulness using crowdsourcing. Workers chose our methods more than comparison method. faithfulness of generated captions Ours(bird) Comp.(bird) P value Ours(flower) Comp.(flower) P value 318 182 1.247e-09 310 190 8.963e-08 4.5. Human Evaluation To determine whether faithful captions were generated, a manual evaluation was also performed by crowdsourc- ing using AMT. Given generated caption pairs (from the proposed and comparison methods) together with an image from the dataset, workers were asked to select which cap- tion better represents the image. Here, we instructed the workers to give priority to judging the extent to which the caption refers to the image, rather than focusing on gram- matical order. The data employed here consisted of 100 randomly selected items from the test data, and five work- ers completed the same task. The workers were all certified as Master by AMT. The points obtained by summing the selections of each option for the proposed and comparison methods were used for the evaluation. In addition, binomial tests were performed on the evaluation results, to determine whether the differences between the proposed and compar- ison methods were significant. Here, it was tested whether the proportion selecting the proposed method was signifi- cantly different from 0.5, with a significance level of 0.05. The results are shown in Table 2. For both datasets, the proposed method achieved higher points, and the statistical tests show a significant difference between the proposed and comparison methods. (Each p value was less than 0.05.) 4.6. Regenerated Image Evaluation As a quantitative evaluation method for regenerated im- ages, the fine-tuned inception model [31] of StackGAN was employed, and the inception score was calculated. Specifi- cally, we employed the fine-tuned inception model of Zhang et al. [25] for Caltech-UCSD Bird and Oxford-102 flower. The results are shown in Table 3. The overall results are not considerably different, and for the flower dataset the score was lower for the proposed method than for the comparison method. 4.7. Extension to unpaired data The dataset used in this experiment is used as a non-pair data set by randomly selecting image and description pairs. Learning was also performed using non-paired data sets in Figure 4. Lengths of captions in the dataset. The upper and lower parts represent the bird and flower data, respectively. Table 1. Automatic evaluation of generated captions Ours(bird) Comp.(bird) Ours(flower) Comp.(flower) BLEU-4 ROUGE Meteor 0.146 0.057 0.047 0.147 0.146 0.070 0.062 0.141 0.304 0.304 0.294 0.287 CIDEr 0.218 0.207 0.212 0.190 are also grammatically correct, at a level that can be under- stood by humans. 4.4. Caption Evaluation As a quantitative evaluation method for the captions generated from the test data, automatic metrics such as BLEU [19], ROUGE [13], Meteor [4], and CIDEr [26] are employed. The results are shown in Table 1. For both the bird and flower datasets, the proposed method achieved a comparable or better performance than the comparison method. In particular, the score improvement in BLEU-4 and CIDEr was remarkable. 7 Sentence LengthNumbersSentence LengthNumbers Figure 5. Examples of successes. Each caption on the right is generated from the image on the left. Table 3. Inception scores of regenerated images Ours(bird) Comp.(bird) Ours(flower) Comp.(flower) mean 1.46 1.38 1.26 1.34 std. 0.14 0.10 0.07 0.08 Table 4. Automatic evaluation of generated captions(unpaired) Ours(bird) Comp.(bird) Ours(flower) Comp.(flower) BLEU-4 ROUGE Meteor CIDEr 0.216 0.056 0.197 0.048 0.065 0.185 0.181 0.064 0.149 0.144 0.142 0.145 0.308 0.299 0.295 0.282 comparison methods and pre-training. The experiment was performed with the dataset only being unpaired in exactly the same experimental setting, and the results are shown in Table 4. Although there are also cases where the proposed method outperforms the comparison method, there was no significant difference. The results in this experiment are not significantly inferior in performance compared to when the experiment was performed in pair dataset. However, the dataset used here is the one in which the domain is limited to birds or flowers, so we do not know about the case where we experimented with a dataset containing more versatile images. As a matter of discussion, even if we create a non- pair dataset at random like this time, it is possible that the selected captions partially become similar with correct sen- tences, and there is almost no difference. 8 5. Conclusions In this study, we proposed a learning method for image captioning using mutual transformations between images and texts. We demonstrated that mutual transformations are possible using the cycle-consistency loss. Furthermore, au- tomatic evaluations demonstrated that a comparable or bet- ter performance was achieved by the proposed method with paired dataset. In addition, crowdsourcing evaluations also demonstrated that our method is more effective than one without the cycle-consistency loss. In order to improve performance more, it is necessary to increase the accuracy of GANs used for mutual con- version. In particular, GANs that generate images match- ing text from text are considered to be difficult to achieve higher accuracy than GANs that generate text from images in terms of the amount of information. Also, in this paper, we did not consider where to pay attention to images and captions. During learning, two types of loss function can interfere with parameter updates of each other. In order to avoid that, it is effective to find something better than the one used in this paper as a cycle-consistency loss between images. In order to know the effect on non-paired data sets, it is considered that datasets with more domains to handle are required. 6. Acknowledgement This work was partially supported by JST CREST Grant Number JPMJCR1403, Japan. We would like to thank Mik- ihiro Tanaka, Atsuhiro Noguchi, Hiroaki Yamane for help- ful discussions. this flower is pink in color and has petals that are oval shaped and lighter at the edges the flower is made of small skinny petals that are pink in color this bird is yellow in color with a black beak and black eye rings this is a dark gray bird with black strips on its nape and a white belly this bird is brown with white and has a very short beak this flower is white and purple in color with petals that are thin and spotted References [1] https://www.mturk.com. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine trans- In Inter- lation by jointly learning to align and translate. national Conference on Learning Representations (ICLR), 2015. [3] B. Dai, S. Fidler, R. Urtasun, and D. Lin. Towards diverse and natural image descriptions via a conditional gan. In the IEEE International Conference on Computer Vision (ICCV), 2017. [4] M. Denkowski and A. Lavie. Meteor universal: Language specific translation evaluation for any target language. In the ninth workshop on statistical machine translation, 2014. [5] Y. Feng, L. Ma, W. Liu, and J. Luo. Unsupervised image captioning. arXiv preprint arXiv:1811.10787, 2018. [6] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Gen- In Neural Information Processing erative adversarial nets. Systems (NeurIPS), 2014. [7] S. K. Gorti and J. Ma. Text-to-image-to-text translation us- ing cycle consistent adversarial networks. arXiv preprint arXiv:1808.04538, 2018. [8] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735 -- 1780, 1997. [9] E. Jang, S. Gu, and B. Poole. Categorical reparameterization arXiv preprint arXiv:1611.01144, with gumbel-softmax. 2016. [10] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Rep- resentations (ICLR), 2015. [11] M. J. Kusner and J. M. Hern´andez-Lobato. Gans for se- quences of discrete elements with the gumbel-softmax dis- tribution. arXiv preprint arXiv:1611.04051, 2016. [12] C. Ledig, L. Theis, F. Husz´ar, J. Caballero, A. Cunningham, A. Acosta, A. P. Aitken, A. Tejani, J. Totz, Z. Wang, et al. Photo-realistic single image super-resolution using a gener- ative adversarial network. In the IEEE Conference on Com- puter Vision and Pattern Recognition (CVPR), 2017. [13] C.-Y. Lin. Rouge: A package for automatic evaluation of summaries. In Text Summarization Branches Out: Proceed- ings of the ACL-04 Work- shop, 2004. [14] R. Luo, B. Price, S. Cohen, and G. Shakhnarovich. Discrim- In the inability objective for training descriptive captions. IEEE Conference on Computer Vision and Pattern Recogni- tion (CVPR), 2018. [15] E. Mansimov, E. Parisotto, J. L. Ba, and R. Salakhutdinov. In Inter- Generating images from captions with attention. national Conference on Learning Representations (ICLR), 2016. [16] M. Mirza and S. Osindero. Conditional generative adversar- ial nets. arXiv preprint arXiv:1411.1784, 2014. [17] T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spec- tral normalization for generative adversarial networks. In In- ternational Conference on Learning Representations (ICLR), 2018. [18] M.-E. Nilsback and A. Zisserman. A visual vocabulary for flower classification. In the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2006. [19] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: a method for automatic evaluation of machine translation. In the 40th annual meeting on association for computational linguistics (ACL), 2002. [20] A. Radford, L. Metz, and S. Chintala. Unsupervised rep- resentation learning with deep convolutional generative ad- versarial networks. In International Conference on Learning Representations (ICLR), 2016. [21] S. Reed, Z. Akata, H. Lee, and B. Schiele. Learning deep In the representations of fine-grained visual descriptions. IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR), 2016. [22] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In In- ternational Conference on Machine Learning (ICML), 2016. [23] R. Shetty, M. Rohrbach, L. Anne Hendricks, M. Fritz, and B. Schiele. Speaking the same language: Matching machine to human captions by adversarial training. In the IEEE Inter- national Conference on Computer Vision (ICCV), 2017. [24] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2014. [25] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In the IEEE conference on Computer Vision and Pattern Recog- nition (CVPR), 2016. [26] R. Vedantam, C. Lawrence Zitnick, and D. Parikh. Cider: Consensus-based image description evaluation. In the IEEE conference on Computer Vision and Pattern Recognition (CVPR), 2015. [27] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In the IEEE confer- ence on Computer Vision and Pattern Recognition (CVPR), 2015. [28] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. [29] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudi- nov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Interna- tional Conference on Machine Learning (ICML), 2015. [30] L. Yu, W. Zhang, J. Wang, and Y. Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In Associ- ation for the Advancement of Artificial Intelligence (AAAI), 2017. [31] H. Zhang, T. Xu, H. Li, S. Zhang, X. Huang, X. Wang, and D. Metaxas. Stackgan: Text to photo-realistic image synthe- sis with stacked generative adversarial networks. In the IEEE International Conference on Computer Vision (ICCV), 2017. [32] Z. Zhang, Y. Xie, and L. Yang. Photographic text-to-image synthesis with a hierarchically-nested adversarial network. In the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. [33] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image- to-image translation using cycle-consistent adversarial net- 9 works. In the IEEE International Conference on Computer Vision (ICCV), 2017. 10
1708.04729
3
1708
2017-09-22T15:20:27
Deconvolutional Paragraph Representation Learning
[ "cs.CL", "cs.LG", "stat.ML" ]
Learning latent representations from long text sequences is an important first step in many natural language processing applications. Recurrent Neural Networks (RNNs) have become a cornerstone for this challenging task. However, the quality of sentences during RNN-based decoding (reconstruction) decreases with the length of the text. We propose a sequence-to-sequence, purely convolutional and deconvolutional autoencoding framework that is free of the above issue, while also being computationally efficient. The proposed method is simple, easy to implement and can be leveraged as a building block for many applications. We show empirically that compared to RNNs, our framework is better at reconstructing and correcting long paragraphs. Quantitative evaluation on semi-supervised text classification and summarization tasks demonstrate the potential for better utilization of long unlabeled text data.
cs.CL
cs
Deconvolutional Paragraph Representation Learning Yizhe Zhang Dinghan Shen Guoyin Wang Zhe Gan Ricardo Henao Department of Electrical & Computer Engineering, Duke University Lawrence Carin Abstract Learning latent representations from long text sequences is an important first step in many natural language processing applications. Recurrent Neural Networks (RNNs) have become a cornerstone for this challenging task. However, the qual- ity of sentences during RNN-based decoding (reconstruction) decreases with the length of the text. We propose a sequence-to-sequence, purely convolutional and deconvolutional autoencoding framework that is free of the above issue, while also being computationally efficient. The proposed method is simple, easy to implement and can be leveraged as a building block for many applications. We show empirically that compared to RNNs, our framework is better at reconstruct- ing and correcting long paragraphs. Quantitative evaluation on semi-supervised text classification and summarization tasks demonstrate the potential for better utilization of long unlabeled text data. 1 Introduction A central task in natural language processing is to learn representations (features) for sentences or multi-sentence paragraphs. These representations are typically a required first step toward more applied tasks, such as sentiment analysis [1, 2, 3, 4], machine translation [5, 6, 7], dialogue systems [8, 9, 10] and text summarization [11, 12, 13]. An approach for learning sentence representations from data is to leverage an encoder-decoder framework [14]. In a standard autoencoding setup, a vector representation is first encoded from an embedding of an input sequence, then decoded to the original domain to reconstruct the input sequence. Recent advances in Recurrent Neural Networks (RNNs) [15], especially Long Short-Term Memory (LSTM) [16] and variants [17], have achieved great success in numerous tasks that heavily rely on sentence-representation learning. RNN-based methods typically model sentences recursively as a generative Markov process with hidden units, where the one-step-ahead word from an input sentence is generated by conditioning on previous words and hidden units, via emission and transition operators modeled as neural networks. In principle, the neural representations of input sequences aim to encapsulate sufficient information about their structure, to subsequently recover the original sentences via decoding. However, due to the recursive nature of the RNN, challenges exist for RNN-based strategies to fully encode a sentence into a vector representation. Typically, during training, the RNN generates words in sequence conditioning on previous ground-truth words, i.e., teacher forcing training [18], rather than decoding the whole sentence solely from the encoded representation vector. This teacher forcing strategy has proven important because it forces the output sequence of the RNN to stay close to the ground-truth sequence. However, allowing the decoder to access ground truth information when reconstructing the sequence weakens the encoder's ability to produce self-contained representations, that carry enough information to steer the decoder through the decoding process without additional guidance. Aiming to solve this problem, [19] proposed a scheduled sampling approach during training, which gradually shifts from learning via both latent representation and ground-truth signals to solely use the encoded latent representation. Unfortunately, [20] showed that scheduled sampling is a fundamentally inconsistent training strategy, in that it produces largely unstable results in practice. As a result, training may fail to converge on occasion. During inference, for which ground-truth sentences are not available, words ahead can only be gener- ated by conditioning on previously generated words through the representation vector. Consequently, decoding error compounds proportional to the length of the sequence. This means that generated sentences quickly deviate from the ground-truth once an error has been made, and as the sentence progresses. This phenomenon was coined exposure bias in [19]. We propose a simple yet powerful purely convolutional framework for learning sentence representa- tions. Conveniently, without RNNs in our framework, issues connected to teacher forcing training and exposure bias are not relevant. The proposed approach uses a Convolutional Neural Network (CNN) [21, 22] as encoder and a deconvolutional (i.e., transposed convolutional) neural network [23] as decoder. To the best of our knowledge, the proposed framework is the first to force the encoded latent representation to capture information from the entire sentence via a multi-layer CNN specification, to achieve high reconstruction quality without leveraging RNN-based decoders. Our multi-layer CNN allows representation vectors to abstract information from the entire sentence, irrespective of order or length, making it an appealing choice for tasks involving long sentences or paragraphs. Further, since our framework does not involve recursive encoding or decoding, it can be very efficiently parallelized using convolution-specific Graphical Process Unit (GPU) primitives, yielding significant computational savings compared to RNN-based models. 2 Convolutional Auto-encoding for Text Modeling 2.1 Convolutional encoder c Let wt denote the t-th word in a given sentence. Each word wt is embedded into a k-dimensional word vector xt = We[wt], where We ∈ Rk×V is a (learned) word embedding matrix, V is the vocabulary size, and We[v] denotes the v-th column of We. All columns of We are normalized to have unit (cid:96)2-norm, i.e., We[v]2 = 1,∀v, by dividing each column with its (cid:96)2-norm. After embedding, a sentence of length T (padded where necessary) is represented as X ∈ Rk×T , by concatenating its word embeddings, i.e., xt is the t-th column of X. For sentence encoding, we use a CNN architecture similar to [24], though originally proposed for image data. The CNN consists of L layers (L − 1 convolutional, and the Lth fully-connected) that ultimately summarize an input sentence into a (fixed-length) latent representation vector, h. Layer l ∈ {1, . . . , L} consists of pl filters, learned from data. For the i-th filter in layer 1, a convolutional ∈ Rk×h to X, where h is the convolution filter operation with stride length r(1) applies filter W(i,1) c + b(i,1)) ∈ R(T−h)/r(1)+1, where γ(·) is size. This yields latent feature map, c(i,1) = γ(X ∗ W(i,1) a nonlinear activation function, b(i,1) ∈ R(T−h)/r(1)+1, and ∗ denotes the convolutional operator. In our experiments, γ(·) is represented by a Rectified Linear Unit (ReLU) [25]. Note that the original embedding dimension, k, changes after the first convolutional layer, as c(i,1) ∈ R(T−h)/r(1)+1, for i = 1, . . . , p1. Concatenating the results from p1 filters (for layer 1), results in feature map, C(1) = [c(1,1) . . . c(p1,1)] ∈ Rp1×[(T−h)/r(1)+1]. After this first convolutional layer, we apply the convolution operation to the feature map, C(1), using the same filter size, h, with this repeated in sequence for L − 1 layers. Each time, the length along the spatial coordinate is reduced to T (l+1) = (cid:98)(T (l) − h)/r(l) + 1(cid:99), where r(l) is the stride length, T (l) is the spatial length, l denotes the l-th layer and (cid:98)·(cid:99) is the floor function. For the final layer, L, the feature map C(L−1) is fed into a fully-connected layer, to produce the latent representation h. Implementation-wise, we use a convolutional layer with filter size equals to T (L−1) (regardless of h), which is equivalent to a fully-connected layer; this implementation trick has been also utilized in [24]. This last layer summarizes all remaining spatial coordinates, T (L−1), into scalar features that encapsulate sentence sub-structures throughout the entire sentence characterized by filters, {W(i,l) } for i = 1, . . . , pl and l = 1, . . . , L, where W(i,l) denotes filter i for layer l. This also implies that the extracted feature is of fixed-dimensionality, independent of the length of the input sentence. c c 2 Figure 1: Convolutional auto-encoding architecture. Encoder: the input sequence is first expanded to an embedding matrix, X, then fully compressed to a representation vector h, through a multi-layer convolutional encoder with stride. In the last layer, the spatial dimension is collapsed to remove the spatial dependency. Decoder: the latent vector h is fed through a multi-layer deconvolutional decoder with stride to reconstruct X as X, via cosine-similarity cross-entropy loss. Having pL filters on the last layer, results in pL-dimensional representation vector, h = C(L), for the input sentence. For example, in Figure 1, the encoder consists of L = 3 layers, which for a sentence of length T = 60, embedding dimension k = 300, stride lengths {r(1), r(2), r(3)} = {2, 2, 1}, filter sizes h = {5, 5, 12} and number of filters {p1, p2, p3} = {300, 600, 500}, results in intermediate feature maps, C(1) and C(2) of sizes {28 × 300, 12 × 600}, respectively. The last feature map of size 1 × 500, corresponds to latent representation vector, h. Conceptually, filters from the lower layers capture primitive sentence information (h-grams, analo- gous to edges in images), while higher level filters capture more sophisticated linguistic features, such as semantic and syntactic structures (analogous to image elements). Such a bottom-up architecture models sentences by hierarchically stacking text segments (h-grams) as building blocks for repre- sentation vector, h. This is similar in spirit to modeling linguistic grammar formalisms via concrete syntax trees [26], however, we do not pre-specify a tree structure based on some syntactic structure (i.e., English language), but rather abstract it from data via a multi-layer convolutional network. 2.2 Deconvolutional decoder We apply the deconvolution with stride (i.e., convolutional transpose), as the conjugate operation of convolution, to decode the latent representation, h, back to the source (discrete) text domain. As the deconvolution operation proceeds, the spatial resolution gradually increases, by mirroring the convolutional steps described above, as illustrated in Figure 1. The spatial dimension is first expanded to match the spatial dimension of the (L − 1)-th layer of convolution, then progressively expanded as T (l+1) = (T (l) − 1) ∗ r(l) + h, for l = 1,··· up to L-th deconvolutional layer (which corresponds to the input layer of the convolutional encoder). The output of the L-layer deconvolution operation aims to reconstruct the word embedding matrix, which we denote as X. In line with word embedding matrix We, columns of X are normalized to have unit (cid:96)2-norm. Denoting wt as the t-th word in reconstructed sentence s, the probability of wt to be word v is specified as p( wt = v) = , (1) (cid:80) exp[τ−1Dcos(xt, We[v])] v(cid:48)∈V exp[τ−1Dcos(xt, We[v(cid:48)])] (cid:104)x,y(cid:105) where Dcos(x, y) is the cosine similarity defined as, xy, We[v] is the v-th column of We, xt is the t-th column of X, τ is a positive number we denote as temperature parameter [27]. This parameter is akin to the concentration parameter of a Dirichlet distribution, in that it controls the spread of probability vector [p( wt = 1) . . . p( wt = V )], thus a large τ encourages uniformly distributed probabilities, whereas a small τ encourages sparse, concentrated probability values. In the experiments we set τ = 0.01. Note that in our setting, the cosine similarity can be obtained as an inner product, provided that columns of We and X have unit (cid:96)2-norm by specification. 3 300x 60Deconvolution LayersConvolution Layers(k,h,p1,r(1))(300,5,300,2)28x30012x600(kxT)300600500600300(T(1)xp1)(T(2)xp2)(T(2)xp2)12x60028x300(T(1)xp1)300x 60(kxT)(k,h,p2,r(2))(1,5,600,2)(k,T(2),p3,r(3))(1,12,500,1)C(1)C(2) 2.3 Model learning The objective of the convolutional autoencoder described above can be written as the word-wise log-likelihood for all sentences s ∈ D, i.e., Lae =(cid:80) d∈D(cid:80) d = wt d) , t log p( wt (2) where D denotes the set of observed sentences. The simple, maximum-likelihood objective in (2) is optimized via stochastic gradient descent. Details of the implementation are provided in the experiments. Note that (2) differs from prior related work in two ways: i) [22, 28] use pooling and un-pooling operators, while we use convolution/deconvolution with stride; and ii) more importantly, [22, 28] do not use a cosine similarity reconstruction as in (1), but a RNN-based decoder. A further discussion of related work is provided in Section 3. We could use pooling and un-pooling instead of striding (a particular case of deterministic pooling/un-pooling), however, in early experiments (not shown) we did not observe significant performance gains, while convolution/deconvolution operations with stride are considerably more efficient in terms of memory footprint. Compared to a standard LSTM-based RNN sequence autoencoders with roughly the same number of parameters, computations in our case are considerably faster (see experiments) using single NVIDIA TITAN X GPU. This is due to the high parallelization efficiency of CNNs via cuDNN primitives [29]. Comparison between deconvolutional and RNN Decoders The proposed framework can be seen as a complementary building block for natural language modeling. Contrary to the standard LSTM- based decoder, the deconvolutional decoder imposes in general a less strict sequence dependency compared to RNN architectures. Specifically, generating a word from an RNN requires a vector of hidden units that recursively accumulate information from the entire sentence in an order-preserving manner (long-term dependencies are heavily down-weighted), while for a deconvolutional decoder, the generation only depends on a representation vector that encapsulates information from throughout the sentence without a pre-specified ordering structure. As a result, for language generation tasks, a RNN decoder will usually generate more coherent text, when compared to a deconvolutional decoder. On the contrary, a deconvolutional decoder is better at accounting for distant dependencies in long sentences, which can be very beneficial in feature extraction for classification and text summarization tasks. 2.4 Semi-supervised classification and summarization Identifying related topics or sentiments, and abstracting (short) summaries from user generated content such as blogs or product reviews, has recently received significant interest [1, 3, 4, 30, 31, 13, 11]. In many practical scenarios, unlabeled data are abundant, however, there are not many practical cases where the potential of such unlabeled data is fully realized. Motivated by this opportunity, here we seek to complement scarcer but more valuable labeled data, to improve the generalization ability of supervised models. By ingesting unlabeled data, the model can learn to abstract latent representations that capture the semantic meaning of all available sentences irrespective of whether or not they are labeled. This can be done prior to the supervised model training, as a two-step process. Recently, RNN-based methods exploiting this idea have been widely utilized and have achieved state-of-the-art performance in many tasks [1, 3, 4, 30, 31]. Alternatively, one can learn the autoencoder and classifier jointly, by specifying a classification model whose input is the latent representation, h; see for instance [32, 33]. In the case of product reviews, for example, each review may contain hundreds of words. This poses challenges when training RNN-based sequence encoders, in the sense that the RNN has to abstract information on-the-fly as it moves through the sentence, which often leads to loss of information, particularly in long sentences [34]. Furthermore, the decoding process uses ground-truth information during training, thus the learned representation may not necessarily keep all information from the input text that is necessary for proper reconstruction, summarization or classification. We consider applying our convolutional autoencoding framework to semi-supervised learning from long-sentences and paragraphs. Instead of pre-training a fully unsupervised model as in [1, 3], we cast the semi-supervised task as a multi-task learning problem similar to [35], i.e., we simultaneously train a sequence autoencoder and a supervised model. In principle, by using this joint training strategy, the learned paragraph embedding vector will preserve both reconstruction and classification ability. 4 Specifically, we consider the following objective: t log p( wt d∈{Dl+Du}(cid:80) Lsemi = α(cid:80) d) +(cid:80) Lsup(f (hd), yd) , d∈Dl d = wt (3) where α > 0 is an annealing parameter balancing the relative importance of supervised and unsu- pervised loss; Dl and Du denote the set of labeled and unlabeled data, respectively. The first term in (3) is the sequence autoencoder loss in (2) for the d-th sequence. Lsup(·) is the supervision loss for the d-th sequence (labeled only). The classifier function, f (·), that attempts to reconstruct yd from hd can be either a Multi-Layer Perceptron (MLP) in classification tasks, or a CNN/RNN in text summarization tasks. For the latter, we are interested in a purely convolutional specification, however, we also consider an RNN for comparison. For classification, we use a standard cross-entropy loss, and for text summarization we use either (2) for the CNN or the standard LSTM loss for the RNN. In practice, we adopt a scheduled annealing strategy for α as in [36, 37], rather than fixing it a priori as in [1]. During training, (3) gradually transits from focusing solely on the unsupervised sequence autoencoder to the supervised task, by annealing α from 1 to a small positive value αmin. We set αmin = 0.01 in the experiments. The motivation for this annealing strategy is to first focus on abstracting paragraph features, then to selectively refine learned features that are most informative to the supervised task. 3 Related Work Previous work has considered leveraging CNNs as encoders for various natural language processing tasks [22, 28, 21, 38, 39]. Typically, CNN-based encoder architectures apply a single convolution layer followed by a pooling layer, which essentially acts as a detector of specific classes of h-grams, given a convolution filter window of size h. The deep architecture in our framework will, in principle, enable the high-level layers to capture more sophisticated language features. We use convolutions with stride rather than pooling operators, e.g., max-pooling, for spatial downsampling following [24, 40], where it is argued that fully convolutional architectures are able to learn their own spatial downsampling. Further, [41] uses a 29-layer CNN for text classification. Our CNN encoder is considerably simpler in structure (convolutions with stride and no more than 4 layers) while still achieving good performance. Language decoders other than RNNs are less well studied. Recently, [42] proposed a hybrid model by coupling a convolutional-deconvolutional network with an RNN, where the RNN acts as decoder and the deconvolutional model as a bridge between the encoder (convolutional network) and decoder. Additionally, [37, 43, 44, 45] considered CNN variants, such as pixelCNN [46], for text generation. Nevertheless, to achieve good empirical results, these methods still require the sentences to be generated sequentially, conditioning on the ground truth historical information, akin to RNN-based decoders, thus still suffering from the exposure bias. Other efforts have been made to improve embeddings from long paragraphs using unsupervised approaches [2, 47]. The paragraph vector [2] learns a fixed length vector by concatenating it with a word2vec [48] embedding of history sequence to predict future words. The hierarchical neural autoencoder [47] builds a hierarchical attentive RNN, then it uses paragraph-level hidden units of that RNN as embedding. Our work differs from these approaches in that we force the sequence to be fully restored from the latent representation, without aid from any history information. Previous methods have considered leveraging unlabeled data for semi-supervised sequence classifica- tion tasks. Typically, RNN-based methods consider either i) training a sequence-to-sequence RNN autoencoder, or a RNN classifier that is robust to adversarial perturbation, as initialization for the en- coder in the supervised model [1, 4]; or, ii) learning latent representation via a sequence-to-sequence RNN autoencoder, and then using them as inputs to a classifier that also takes features extracted from a CNN as inputs [3]. For summarization tasks, [49] has considered a semi-supervised approach based on support vector machines, however, so far, research on semi-supervised text summarization using deep models is scarce. 4 Experiments Experimental setup For all the experiments, we use a 3-layer convolutional encoder followed by a 3-layer deconvolutional decoder (recall implementation details for the top layer). Filter size, stride 5 Ground-truth: Hier. LSTM [47] on every visit to nyc , the hotel beacon is the place we love to stay . so conveniently located to central park , lincoln center and great local restaurants . the rooms are lovely . beds so comfortable , a great little kitchen and new wizz bang coffee maker . the staff are so accommodating and just love walking across the street to the fairway supermarket with every imaginable goodies to eat . every time in new york , lighthouse hotel is our favorite place to stay . very convenient , central park , lincoln center , and great restaurants . the room is wonderful , very comfortable bed , a kitchenette and a large explosion of coffee maker . the staff is so inclusive , just across the street to walk to the supermarket channel love with all kinds of what to eat . Our LSTM-LSTM on every visit to nyc , the hotel beacon is the place to relax and wanting to become conveniently located . hotel , in the evenings out good budget accommodations . the views are great and we were more than two couples . manny the doorman has a great big guy come and will definitly want to leave during my stay and enjoy a wonderfully relaxing wind break in having for 24 hour early rick's cafe . oh perfect ! easy easy walking distance to everything imaginable groceries . if you may want to watch yours ! on every visit to nyc , the hotel beacon is the place we love to stay . so closely located to central park , lincoln center and great local restaurants . biggest rooms are lovely . beds so comfortable , a great little kitchen and new UNK suggestion coffee maker . the staff turned so accommodating and just love walking across the street to former fairway supermarket with every food taxes to eat . Our CNN-DCNN Table 1: Reconstructed paragraph of the Hotel Reviews example, used in [47]. and word embedding are set to h = 5, rl = 2, for l = 1, . . . , 3 and k = 300, respectively. The dimension of the latent representation vector varies for each experiment, thus is reported separately. For notational convenience, we denote our convolutional-deconvolutional autoencoder as CNN- DCNN. In most comparisons, we also considered two standard autoencoders as baselines: a) CNN- LSTM: CNN encoder coupled with LSTM decoder; and b) LSTM-LSTM: LSTM encoder with LSTM decoder. An LSTM-DCNN configuration is not included because it yields similar performance to CNN-DCNN while being more computationally expensive. The complete experimental setup and baseline details is provided in the Supplementary Material (SM). CNN-DCNN has the least number of parameters. For example, using 500 as the dimension of h results in about 9, 13, 15 million total trainable parameters for CNN-DCNN, CNN-LSTM and LSTM-LSTM, respectively. Model LSTM-LSTM [47] Hier. LSTM-LSTM [47] Hier. + att. LSTM-LSTM [47] CNN-LSTM CNN-DCNN BLEU ROUGE-1 ROUGE-2 24.1 26.7 28.5 18.3 94.2 30.2 33.0 35.5 28.2 94.2 57.1 59.0 62.4 56.6 97.0 Table 2: Reconstruction evaluation results on the Hotel Reviews Dataset. Figure 2: BLEU score vs. sentence length for Hotel Review data. Paragraph reconstruction We first investigate the performance of the proposed autoencoder in terms of learning representations that can preserve paragraph information. We adopt evaluation criteria from [47], i.e., ROUGE score [50] and BLEU score [51], to measure the closeness of the reconstructed paragraph (model output) to the input paragraph. Briefly, ROUGE and BLEU scores measures the n-gram recall and precision between the model outputs and the (ground-truth) references. We use BLEU-4, ROUGE-1, 2 in our evaluation, in alignment with [47]. In addition to the CNN- LSTM and LSTM-LSTM autoencoder, we also compared with the hierarchical LSTM autoencoder [47]. The comparison is performed on the Hotel Reviews datasets, following the experimental setup from [47], i.e., we only keep reviews with sentence length ranging from 50 to 250 words, resulting in 348,544 training data samples and 39,023 testing data samples. For all comparisons, we set the dimension of the latent representation to h = 500. From Table 1, we see that for long paragraphs, the LSTM decoder in CNN-LSTM and LSTM-LSTM suffers from heavy exposure bias issues. We further evaluate the performance of each model with different paragraph lengths. As shown in Figure 2 and Table 2, on this task CNN-DCNN demonstrates a clear advantage, meanwhile, as the length of the sentence increases, the comparative advantage becomes more substantial. For LSTM-based methods, the quality of the reconstruction deteriorates quickly as sequences get longer. In constrast, the reconstruction quality of CNN-DCNN is stable and consistent regardless of sentence length. Furthermore, the computational cost, evaluated as wall-clock, is significantly lower in CNN-DCNN. Roughly, CNN-LSTM is 3 times slower than CNN-DCNN, and LSTM-LSTM is 5 times slower on a single GPU. Details are reported in the SM. Character-level and word-level correction This task seeks to evaluate whether the deconvolu- tional decoder can overcome exposure bias, which severely limits LSTM-based decoders. We consider 6 6080100120140160180200Sentence length020406080100Bleu scoreCNN-DCNNCNN-LSTMLSTM-LSTM a denoising autoencoder where the input is tweaked slightly with certain modifications, while the model attempts to denoise (correct) the unknown modification, thus recover the original sentence. For character-level correction, we consider the Yahoo! Answer dataset [52]. The dataset description and setup for word-level correction is provided in the SM. We follow the experimental setup in [53] for word-level and character-level spelling correction (see details in the SM). We considered substituting each word/character with a different one at random with probability η, with η = 0.30. For character-level analysis, we first map all characters into a 40 dimensional embedding vector, with the network structure for word- and character-level models kept the same. Model Actor-critic[53] LSTM-LSTM CNN-LSTM CNN-DCNN Model LSTM-LSTM CNN-LSTM CNN-DCNN Yahoo(CER) 0.2284 0.2621 0.2035 0.1323 ArXiv(WER) 0.7250 0.3819 0.3067 Table 3: CER and WER com- parison on Yahoo and ArXiv data. Figure 4: Spelling error denoising compar- ison. Darker colors indicate higher uncer- tainty. Trained on modified sentences. Figure 3: CER comparison. Black triangles indicate the end of an epoch. We employ Character Error Rate (CER) [53] and Word Error Rate (WER) [54] for evaluation. The WER/CER measure the ratio of Levenshtein distance (a.k.a., edit distance) between model predictions and the ground-truth, and the total length of sequence. Conceptually, lower WER/CER indicates better performance. We use LSTM-LSTM and CNN-LSTM denoising autoencoders for comparison. The architecture for the word-level baseline models is the same as in the previous experiment. For character-level correction, we set dimension of h to 900. We also compare to actor-critic training [53], following their experimental guidelines (see details in the SM). As shown in Figure 3 and Table 3, we observed CNN-DCNN achieves both lower CER and faster convergence. Further, CNN-DCNN delivers stable denoising performance irrespective of the noise location within the sentence, as seen in Figure 4. For CNN-DCNN, even when an error is detected but not exactly corrected (darker colors in Figure 4 indicate higher uncertainty), denoising with future words is not effected, while for CNN-LSTM and LSTM-LSTM the error gradually accumulates with longer sequences, as expected. For word-level correction, we consider word substitutions only, and mixed perturbations from three kinds: substitution, deletion and insertion. Generally, CNN-DCNN outperforms CNN-LSTM and LSTM-LSTM, and is faster. We provide experimental details and comparative results in the SM. Semi-supervised sequence classification & summarization We investigate whether our CNN- DCNN framework can improve upon supervised natural language tasks that leverage features learned from paragraphs. In principle, a good unsupervised feature extractor will improve the general- ization ability in a semi-supervised learning setting. We evaluate our approach on three popular natural language tasks: sentiment analysis, paragraph topic prediction and text summarization. The first two tasks are essentially sequence classification, while summarization involves both language comprehension and language generation. We consider three large-scale document classification datasets: DBPedia, Yahoo! Answers and Yelp Review Polarity [52]. The partition of training, validation and test sets for all datasets follows the settings from [52]. The detailed summary statistics of all datasets are shown in the SM. To demonstrate the advantage of incorporating the reconstruction objective into the training of text classifiers, we further evaluate our model with different amounts of labeled data (0.1%, 0.15%, 0.25%, 1%, 10% and 100%, respectively), and the whole training set as unlabeled data. For our purely supervised baseline model (supervised CNN), we use the same convolutional encoder architecture described above, with a 500-dimensional latent representation dimension, followed by a MLP classifier with one hidden layer of 300 hidden units. The dropout rate is set to 50%. Word embeddings are initialized at random. As shown in Table 4, the joint training strategy consistently and significantly outperforms the purely supervised strategy across datasets, even when all labels are available. We hypothesize that during the early phase of training, when reconstruction is emphasized, features from text fragments can be readily 7 010203040506070Time (hour)0.00.20.40.60.81.0Character Error Rate (CER)CNN-DCNNCNN-LSTMLSTM-LSTMOriginalcOriginalaOriginalnOriginal OriginalaOriginalnOriginalyOriginaloOriginalnOriginaleOriginal OriginalsOriginaluOriginalgOriginalgOriginaleOriginalsOriginaltOriginal OriginalsOriginaloOriginalmOriginaleOriginal OriginalgOriginaloOriginaloOriginaldOriginal OriginalbOriginaloOriginaloOriginalkOriginalsOriginal Original?ModifiedcModifiedaModifiedpModified ModifiedaModifiednModifiedyModifiedoModifiednModifiedkModified ModifiedwModifieduModifiedgModifiedgModifiedeModifiedsModifiedtModified ModifiedxModifiedoModifiedhModifiedeModified ModifiediModifiedoModifiedrModifieddModified ModifiedyModifiedoModifiedoModifiedkModifieduModified Modified?ActorCriticcActorCriticaActorCriticnActorCritic ActorCriticaActorCriticnActorCriticyActorCriticoActorCriticnActorCriticeActorCritic ActorCriticwActorCriticiActorCritictActorCritichActorCriticeActorCriticsActorCritictActorCritic ActorCritictActorCriticoActorCritic ActorCriticeActorCritic ActorCriticfActorCriticoActorCriticrActorCriticdActorCritic ActorCriticyActorCriticoActorCriticuActorCritic ActorCriticuActorCritic ActorCritic?LSTM-LSTMcLSTM-LSTMaLSTM-LSTMnLSTM-LSTM LSTM-LSTMaLSTM-LSTMnLSTM-LSTMyLSTM-LSTMoLSTM-LSTMnLSTM-LSTMeLSTM-LSTM LSTM-LSTMsLSTM-LSTMuLSTM-LSTMgLSTM-LSTMgLSTM-LSTMeLSTM-LSTMsLSTM-LSTMtLSTM-LSTM LSTM-LSTMjLSTM-LSTMoLSTM-LSTMkLSTM-LSTMeLSTM-LSTM LSTM-LSTMfLSTM-LSTMoLSTM-LSTMoLSTM-LSTMdLSTM-LSTM LSTM-LSTMyLSTM-LSTMoLSTM-LSTMuLSTM-LSTMnLSTM-LSTMgLSTM-LSTM LSTM-LSTM?CNN-LSTMcCNN-LSTMaCNN-LSTMnCNN-LSTM CNN-LSTMaCNN-LSTMnCNN-LSTMyCNN-LSTMoCNN-LSTMnCNN-LSTMeCNN-LSTM CNN-LSTMgCNN-LSTMuCNN-LSTMiCNN-LSTMtCNN-LSTMeCNN-LSTMsCNN-LSTM CNN-LSTMsCNN-LSTMoCNN-LSTMmCNN-LSTMeCNN-LSTM CNN-LSTMoCNN-LSTMwCNN-LSTMeCNN-LSTM CNN-LSTMpCNN-LSTMoCNN-LSTMoCNN-LSTMkCNN-LSTMsCNN-LSTM CNN-LSTM?CNN-LSTM CNN-LSTM CNN-DCNNcCNN-DCNNaCNN-DCNNnCNN-DCNN CNN-DCNNaCNN-DCNNnCNN-DCNNyCNN-DCNNoCNN-DCNNnCNN-DCNNeCNN-DCNN CNN-DCNNsCNN-DCNNuCNN-DCNNgCNN-DCNNgCNN-DCNNeCNN-DCNNsCNN-DCNNtCNN-DCNN CNN-DCNNsCNN-DCNNoCNN-DCNNmCNN-DCNNeCNN-DCNN CNN-DCNNwCNN-DCNNoCNN-DCNNoCNN-DCNNdCNN-DCNN CNN-DCNNbCNN-DCNNoCNN-DCNNoCNN-DCNNkCNN-DCNNsCNN-DCNN CNN-DCNN?OriginalwOriginalhOriginalaOriginaltOriginal OriginalsOriginal OriginalyOriginaloOriginaluOriginalrOriginal OriginaliOriginaldOriginaleOriginalaOriginal OriginaloOriginalfOriginal OriginalaOriginal OriginalsOriginaltOriginaleOriginalpOriginalpOriginaliOriginalnOriginalgOriginal OriginalsOriginaltOriginaloOriginalnOriginaleOriginal OriginaltOriginaloOriginal OriginalbOriginaleOriginaltOriginaltOriginaleOriginalrOriginal OriginaltOriginalhOriginaliOriginalnOriginalgOriginalsOriginal OriginaltOriginaloOriginal OriginalcOriginaloOriginalmOriginaleOriginal Original?ModifiedwModifieduModifiedaModifiedtModified ModifiedsModified ModifiedyModifiedoModifiedgModifiedrModified ModifiediModifieddModifiedeModifiedmModified ModifiedoModifiedfModified ModifiedtModified ModifiedsModifiedtModifiedeModifiedpModifieduModifiedkModifiednModifiedgModified ModifiedjModifiedtModifiedzModifiednModifiedeModified ModifiedtModifiediModified ModifiedbModifiedeModifiedtModifiedtModifiedeModifiedrModified ModifiedtModifiedhModifiediModifiednModifiedgModifiedzModified ModifiedtModifiedtModified ModifiedcModifiedoModifiedeModifiedeModified Modified?ActorCriticwActorCritichActorCriticaActorCritictActorCritic ActorCriticsActorCritic ActorCriticyActorCriticoActorCriticuActorCriticrActorCritic ActorCriticiActorCriticdActorCriticeActorCriticmActorCritic ActorCriticoActorCriticfActorCritic ActorCritictActorCritic ActorCriticsActorCritictActorCriticeActorCriticpActorCriticuActorCriticaActorCriticnActorCriticgActorCritic ActorCriticjActorCriticoActorCritickActorCriticnActorCriticeActorCritic ActorCritictActorCriticiActorCritic ActorCriticbActorCriticeActorCritictActorCritictActorCriticeActorCriticrActorCritic ActorCritictActorCritichActorCriticiActorCriticnActorCriticgActorCritic ActorCriticiActorCritictActorCritictActorCritic ActorCriticcActorCriticoActorCriticmActorCriticeActorCritic ActorCritic?LSTM-LSTMwLSTM-LSTMhLSTM-LSTMaLSTM-LSTMtLSTM-LSTM LSTM-LSTMsLSTM-LSTM LSTM-LSTMyLSTM-LSTMoLSTM-LSTMuLSTM-LSTMrLSTM-LSTM LSTM-LSTMiLSTM-LSTMdLSTM-LSTMeLSTM-LSTMaLSTM-LSTM LSTM-LSTMoLSTM-LSTMfLSTM-LSTM LSTM-LSTMaLSTM-LSTM LSTM-LSTMsLSTM-LSTMpLSTM-LSTMeLSTM-LSTMaLSTM-LSTMkLSTM-LSTMiLSTM-LSTMnLSTM-LSTMgLSTM-LSTM LSTM-LSTMsLSTM-LSTMtLSTM-LSTMaLSTM-LSTMnLSTM-LSTMdLSTM-LSTM LSTM-LSTMtLSTM-LSTMoLSTM-LSTM LSTM-LSTMbLSTM-LSTMeLSTM-LSTMtLSTM-LSTMtLSTM-LSTMeLSTM-LSTMrLSTM-LSTM LSTM-LSTMtLSTM-LSTMhLSTM-LSTMiLSTM-LSTMnLSTM-LSTMgLSTM-LSTMsLSTM-LSTM LSTM-LSTMtLSTM-LSTMoLSTM-LSTM LSTM-LSTMcLSTM-LSTMoLSTM-LSTMmLSTM-LSTMeLSTM-LSTM LSTM-LSTM?CNN-LSTMwCNN-LSTMhCNN-LSTMaCNN-LSTMtCNN-LSTM CNN-LSTMsCNN-LSTM CNN-LSTMyCNN-LSTMoCNN-LSTMuCNN-LSTMrCNN-LSTM CNN-LSTMiCNN-LSTMdCNN-LSTMeCNN-LSTMmCNN-LSTM CNN-LSTMoCNN-LSTMfCNN-LSTM CNN-LSTMaCNN-LSTM CNN-LSTMsCNN-LSTMtCNN-LSTMeCNN-LSTMpCNN-LSTMpCNN-LSTMiCNN-LSTMnCNN-LSTMgCNN-LSTM CNN-LSTMsCNN-LSTMtCNN-LSTMaCNN-LSTMrCNN-LSTMtCNN-LSTM CNN-LSTMtCNN-LSTMoCNN-LSTM CNN-LSTMbCNN-LSTMeCNN-LSTMtCNN-LSTMtCNN-LSTMeCNN-LSTMrCNN-LSTM CNN-LSTMtCNN-LSTMhCNN-LSTMiCNN-LSTMnCNN-LSTMgCNN-LSTM CNN-LSTMtCNN-LSTMoCNN-LSTM CNN-LSTMcCNN-LSTMoCNN-LSTMmCNN-LSTMeCNN-LSTM CNN-LSTM?CNN-LSTM CNN-DCNNwCNN-DCNNhCNN-DCNNaCNN-DCNNtCNN-DCNN CNN-DCNNsCNN-DCNN CNN-DCNNyCNN-DCNNoCNN-DCNNuCNN-DCNNrCNN-DCNN CNN-DCNNiCNN-DCNNdCNN-DCNNeCNN-DCNNaCNN-DCNN CNN-DCNNoCNN-DCNNfCNN-DCNN CNN-DCNNaCNN-DCNN CNN-DCNNsCNN-DCNNtCNN-DCNNeCNN-DCNNpCNN-DCNNpCNN-DCNNiCNN-DCNNnCNN-DCNNgCNN-DCNN CNN-DCNNsCNN-DCNNtCNN-DCNNoCNN-DCNNnCNN-DCNNeCNN-DCNN CNN-DCNNtCNN-DCNNoCNN-DCNN CNN-DCNNbCNN-DCNNeCNN-DCNNtCNN-DCNNtCNN-DCNNeCNN-DCNNrCNN-DCNN CNN-DCNNtCNN-DCNNhCNN-DCNNiCNN-DCNNnCNN-DCNNgCNN-DCNNsCNN-DCNN CNN-DCNNtCNN-DCNNoCNN-DCNN CNN-DCNNcCNN-DCNNoCNN-DCNNmCNN-DCNNeCNN-DCNN CNN-DCNN? learned. As the training proceeds, the most discriminative text fragment features are selected. Further, the subset of features that are responsible for both reconstruction and discrimination presumably encapsulate longer dependency structure, compared to the features using a purely supervised strategy. Figure 5 demonstrates the behavior of our model in a semi-supervised setting on Yelp Review dataset. The results for Yahoo! Answer and DBpedia are provided in the SM. Model ngrams TFIDF Large Word ConvNet Small Word ConvNet Large Char ConvNet Small Char ConvNet SA-LSTM (word-level) Deep ConvNet Ours (Purely supervised) Ours (joint training with CNN-LSTM) Ours (joint training with CNN-DCNN) DBpedia 1.31 1.72 1.85 1.73 1.98 1.40 1.29 1.76 1.36 1.17 Yelp P. 4.56 4.89 5.54 5.89 6.53 - 4.28 4.62 4.21 3.96 Yahoo 31.49 29.06 30.02 29.55 29.84 - 26.57 27.42 26.32 25.82 5% 12.40 16.04 Obs. proportion σ Supervised Semi-sup. Figure 5: Semi-supervised classifica- tion accuracy on Yelp review data. Table 4: Test error rates of document classification (%). Results from other methods were obtained from [52]. For summarization, we used a dataset composed of 58,000 abstract-title pairs, from arXiv. Abstract- title pairs are selected if the length of the title and abstract do not exceed 50 and 500 words, respectively. We partitioned the training, validation and test sets into 55000, 2000, 1000 pairs each. We train a sequence-to-sequence model to generate the title given the abstract, using a randomly selected subset of paired data with proportion σ = (5%, 10%, 50%, 100%). For every value of σ, we considered both purely supervised summarization using just abstract-title pairs, and semi- supervised summarization, by leveraging additional abstracts without titles. We compared LSTM and deconvolutional network as the decoder for generating titles for σ = 100%. Table 5 summarizes quantitative results using ROUGE-L (longest common sub- sequence) [50]. In general, the additional abstracts without titles improve the gen- eralization ability on the test set. Inter- estingly, even when σ = 100% (all titles are observed), the joint training objective still yields a better performance than using Lsup alone. Presumably, since the joint training objective requires the latent representation to be capable of reconstructing the input paragraph, in addition to generating a title, the learned representation may better capture the entire structure (meaning) of the paragraph. We also empirically observed that titles generated under the joint training objective are more likely to use the words appearing in the corresponding paragraph (i.e., more extractive), while the the titles generated using the purely supervised objective Lsup, tend to use wording more freely, thus more abstractive. One possible explanation is that, for the joint training strategy, since the reconstructed paragraph and title are all generated from latent representation h, the text fragments that are used for reconstructing the input paragraph are more likely to be leveraged when "building" the title, thus the title bears more resemblance to the input paragraph. As expected, the titles produced by a deconvolutional decoder are less coherent than an LSTM decoder. Presumably, since each paragraph can be summarized with multiple plausible titles, the deconvolutional decoder may have trouble when positioning text segments. We provide discussions and titles generated under different setups in the SM. Designing a framework which takes the best of these two worlds, LSTM for generation and CNN for decoding, will be an interesting future direction. Table 5: Summarization task on arXiv data, using ROUGE-L metric. First 4 columns are for the LSTM decoder, and the last column is for the deconvolutional decoder (100% observed). 50% 100% DCNN dec. 15.87 17.64 14.75 16.83 16.37 18.14 10% 13.07 16.62 5 Conclusion We proposed a general framework for text modeling using purely convolutional and deconvolutional operations. The proposed method is free of sequential conditional generation, avoiding issues associated with exposure bias and teacher forcing training. Our approach enables the model to fully encapsulate a paragraph into a latent representation vector, which can be decompressed to reconstruct the original input sequence. Empirically, the proposed approach achieved excellent long paragraph reconstruction quality and outperforms existing algorithms on spelling correction, and semi-supervised sequence classification and summarization, with largely reduced computational cost. 8 0.1110100Proportion (%) of labeled data556065707580859095100Accuracy (%)SupervisedSemi (CNN-DCNN)Semi (CNN-LSTM) References [1] Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. In NIPS, 2015. [2] Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In ICML, 2014. [3] Rie Johnson and Tong Zhang. Supervised and Semi-Supervised Text Categorization using LSTM for Region Embeddings. arXiv, February 2016. [4] Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Adversarial Training Methods for Semi-Supervised Text Classification. In ICLR, May 2017. [5] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In ICLR, 2015. [6] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014. [7] Fandong Meng, Zhengdong Lu, Mingxuan Wang, Hang Li, Wenbin Jiang, and Qun Liu. Encoding source language with convolutional neural network for machine translation. In ACL, 2015. [8] Tsung-Hsien Wen, Milica Gasic, Nikola Mrksic, Pei-Hao Su, David Vandyke, and Steve Young. Se- mantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv, 2015. [9] Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforcement learning for dialogue generation. arXiv, 2016. [10] Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. arXiv:1701.06547, 2017. [11] Ramesh Nallapati, Bowen Zhou, Cicero Nogueira dos santos, Caglar Gulcehre, and Bing Xiang. Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyond. In CoNLL, 2016. [12] Shashi Narayan, Nikos Papasarantopoulos, Mirella Lapata, and Shay B Cohen. Neural Extractive Summa- rization with Side Information. arXiv, April 2017. [13] Alexander M Rush, Sumit Chopra, and Jason Weston. A Neural Attention Model for Abstractive Sentence Summarization. In EMNLP, 2015. [14] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, 2014. [15] Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. Recurrent neural network based language model. In INTERSPEECH, 2010. [16] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. In Neural computation, 1997. [17] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv, 2014. [18] Ronald J Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280, 1989. [19] Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In NIPS, 2015. [20] Ferenc Huszár. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? arXiv, 2015. [21] Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. A convolutional neural network for modelling sentences. In ACL, 2014. [22] Yoon Kim. Convolutional neural networks for sentence classification. In EMNLP, 2014. [23] Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv, 2016. [24] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv, 2015. [25] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, pages 807–814, 2010. [26] Ian Chiswell and Wilfrid Hodges. Mathematical logic, volume 3. OUP Oxford, 2007. [27] Emil Julius Gumbel and Julius Lieblein. Statistical theory of extreme values and some practical applications: a series of lectures. 1954. [28] Ronan Collobert, Jason Weston, Léon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natural language processing (almost) from scratch. In JMLR, 2011. 9 [29] Sharan Chetlur, Cliff Woolley, Philippe Vandermersch, Jonathan Cohen, John Tran, Bryan Catanzaro, and Evan Shelhamer. cudnn: Efficient primitives for deep learning. arXiv, 2014. [30] Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. Hierarchical attention networks for document classification. In NAACL, 2016. [31] Adji B Dieng, Chong Wang, Jianfeng Gao, and John Paisley. TopicRNN: A Recurrent Neural Network with Long-Range Semantic Dependency. In ICLR, 2016. [32] Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In NIPS, 2014. [33] Yunchen Pu, Zhe Gan, Ricardo Henao, Xin Yuan, Chunyuan Li, Andrew Stevens, and Lawrence Carin. Variational autoencoder for deep learning of images, labels and captions. In NIPS, 2016. [34] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jürgen Schmidhuber. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies, 2001. [35] Richard Socher, Jeffrey Pennington, Eric H Huang, Andrew Y Ng, and Christopher D Manning. Semi- supervised recursive autoencoders for predicting sentiment distributions. In EMNLP. Association for Computational Linguistics, 2011. [36] Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv, 2015. [37] Zichao Yang, Zhiting Hu, Ruslan Salakhutdinov, and Taylor Berg-Kirkpatrick. Improved Variational Autoencoders for Text Modeling using Dilated Convolutions. arXiv, February 2017. [38] Baotian Hu, Zhengdong Lu, Hang Li, and Qingcai Chen. Convolutional neural network architectures for matching natural language sentences. In NIPS, 2014. [39] Rie Johnson and Tong Zhang. Effective use of word order for text categorization with convolutional neural networks. In NAACL HLT, 2015. [40] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv, 2014. [41] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recogni- tion. In ICLR, 2015. [42] Stanislau Semeniuta, Aliaksei Severyn, and Erhardt Barth. A Hybrid Convolutional Variational Autoen- coder for Text Generation. arXiv, February 2017. [43] Nal Kalchbrenner, Lasse Espeholt, Karen Simonyan, Aaron van den Oord, Alex Graves, and Koray Kavukcuoglu. Neural machine translation in linear time. arXiv, 2016. [44] Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language Modeling with Gated Convolutional Networks. arXiv, December 2016. [45] J. Gehring, M. Auli, D. Grangier, D. Yarats, and Y. N. Dauphin. Convolutional Sequence to Sequence Learning. arXiv, May 2017. [46] Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In NIPS, pages 4790–4798, 2016. [47] Jiwei Li, Minh-Thang Luong, and Dan Jurafsky. A hierarchical neural autoencoder for paragraphs and documents. In ACL, 2015. [48] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013. [49] Kam-Fai Wong, Mingli Wu, and Wenjie Li. Extractive summarization using supervised and semi-supervised learning. In ICCL. Association for Computational Linguistics, 2008. [50] Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In ACL workshop, 2004. [51] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL. Association for Computational Linguistics, 2002. [52] Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In NIPS, pages 649–657, 2015. [53] Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. arXiv, 2016. [54] JP Woodard and JT Nelson. An information theoretic measure of speech recognition performance. In Workshop on standardisation for speech I/O, 1982. [55] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [56] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010. 10
1906.05664
1
1906
2019-06-11T17:00:49
Calibration, Entropy Rates, and Memory in Language Models
[ "cs.CL", "cs.LG", "stat.ML" ]
Building accurate language models that capture meaningful long-term dependencies is a core challenge in natural language processing. Towards this end, we present a calibration-based approach to measure long-term discrepancies between a generative sequence model and the true distribution, and use these discrepancies to improve the model. Empirically, we show that state-of-the-art language models, including LSTMs and Transformers, are \emph{miscalibrated}: the entropy rates of their generations drift dramatically upward over time. We then provide provable methods to mitigate this phenomenon. Furthermore, we show how this calibration-based approach can also be used to measure the amount of memory that language models use for prediction.
cs.CL
cs
Calibration, Entropy Rates, and Memory in Language Models Mark Braverman∗ Xinyi Chen† Cyril Zhang¶ Sham M. Kakade‡ Yi Zhang(cid:107) Karthik Narasimhan§ Abstract Building accurate language models that capture meaningful long-term dependencies is a core challenge in natural language processing. Towards this end, we present a calibration- based approach to measure long-term discrepancies between a generative sequence model and the true distribution, and use these discrepancies to improve the model. Empirically, we show that state-of-the-art language models, including LSTMs and Transformers, are miscalibrated : the entropy rates of their generations drift dramatically upward over time. We then provide provable methods to mitigate this phenomenon. Furthermore, we show how this calibration- based approach can also be used to measure the amount of memory that language models use for prediction. 1 Introduction Recent advances in language modeling have resulted in significant breakthroughs on a wide variety of benchmarks in natural language processing Dai et al. [2018], Gong et al. [2018], Takase et al. [2018]. Capturing long-term dependencies has especially been a major focus, with approaches ranging from explicit memory-based neural networks Grave et al. [2016], Ke et al. [2018] to optimization improvements aimed at stabilizing training Le et al. [2015], Trinh et al. [2018]. In this paper, we address a basic question: how do the long-term dependencies in a language model's generations compare to those of the underlying language? Furthermore, if there are measurable discrepancies, this leads to the question of whether and how we can use them to improve these models. Starting from Shannon's seminal work that essentially introduced statistical language modeling Shannon [1951], the most classical and widely studied long-term property of a language model is its entropy rate -- the average amount of information contained per word, conditioned on the preceding words. A learned model provides an upper bound for the entropy rate of a language, via its cross-entropy loss. The exponential of the entropy rate can be interpreted as the effective support size of the distribution of the next word (intuitively, the average number of "plausible" word choices to continue a document), and the perplexity score of a model (the exponential of the cross entropy loss) is an upper bound for this quantity. In state-of-the-art models trained on ∗Princeton University, Computer Science Department, email: [email protected] †Google AI Princeton, email: [email protected] ‡University of Washington, Allen School of Computer Science and Engineering and Department of Statistics, email: [email protected] §Princeton University, Computer Science Department, email: [email protected] ¶Princeton University, Computer Science Department, email: [email protected] (cid:107)Princeton University, Computer Science Department, email: [email protected] 1 Model Corpus Test ppl. EntRate AWD-LSTM [Merity et al., 2017] CNN-LSTM [Jozefowicz et al., 2016] Transformer [Vaswani et al., 2017b] Transformer [Radford et al., 2019] WebText PTB GBW GBW 58.3 29.8 28.1 23.7 93.1 49.4 34.7 61.2 Table 1: Entropy rate degradations for generations from popular language models. State-of-the-art performance is usually reported via perplexity (one-step prediction loss), but there is a striking blowup in the entropy rates of these models' long-term generations. billion-scale corpora, this number ranges between 10 and 30 Melis et al. [2017], Radford et al. [2019]. A natural diagnostic question, with which we begin our work, is whether the long-term generations of these models exhibit the same entropy rates as the underlying languages they are modeling predictively. Empirically, and perhaps surprisingly, it turns out that the entropy rate of generated text is substantially higher than the estimate for true text derived from the model's one-step predictions. As seen in Table 1 (see also Figure 1), this is true for both state-of-the-art LSTMs and Transformers trained on a variety of datasets. As a timely example, the GPT-2 model Radford et al. [2019], the object of much recent attention for its seemingly coherent and on-topic generations, suffers a dramatic degradation in its entropy rate, from 23.7 to 61.2. We will defer the details of this experiment to the supplementary material. This empirical finding is notable since the neural attention- and memory-based techniques have been steadily improving on standard metrics like perplexity and, in some cases, even produce re- markably coherent text (often with some heuristics to reject poor generations). That the perplexity of generated text is so much higher than it is under the true distribution suggests that there are significant gaps in our current methodologies in accurately learning language models, particularly if we are interested in generating text that globally resembles the modeled language itself. Our contributions. The focus of this work is twofold: to improve generations based on any measurement mismatch on a long-term property of the model (e.g. the entropy rate), and to quantify the way a model's predictions depend on the distant past. Central to both of these is a calibration-based approach, which is utilized in statistics and other areas of machine learning Dawid [1982, 1985], Foster [1991], Zadrozny and Elkan [2002], Platt [1999], Guo et al. [2017], Niculescu- Mizil and Caruana [2005]. First, we show that, from a worst-case perspective, even an extremely accurate model (with ε average KL divergence from the true distribution) may have generated text with a substantially different entropy rate as compared to the true distribution. Indeed, we show that this worst-case amplification may occur for a variety of long-term properties of a probabilistic language model; this is because the one-step KL divergence does not in general provide tight control over the expectation of a bounded function. The observed entropy rate amplification (as seen in Table 1) demonstrates that this is not only of theoretical concern. We then describe a calibration procedure to fix this mismatch while simultaneously improving the perplexity of the language model. From a statistical perspective, the procedure is simple, and we discuss approaches to make it computationally efficient. Second, we provide a definition for long-term memory in language models as the mutual in- formation between the models predictions and the distant past in the input. We then provide 2 an upper bound on the amount of this mutual information using calibrated distributions (with a single-parameter exponent). This allows us to estimate the amount of context used by a language model as a function of the distance of past tokens from the current prediction timestep. We perform empirical studies to accompany our theoretical results. We first use the entropy rate calibration algorithm to fix an LSTM language model, resulting in a drop of around 20 perplexity points in the generated text (so that the entropy rate of the model more accurately matches that of the language itself). Then, we empirically estimate and compare the long-term memory of state-of- the-art language models. Our insights point towards new ways of assessing (and fixing) language models, especially in terms of their long-term properties, in a manner complementary to existing metrics like perplexity. 2 Related Work Improving language modeling with long-term dependencies. Recent approaches to im- proving language modeling have focused on several ways to better capture long-term dependencies, from using manually-defined context representations Mikolov and Zweig [2012], Ji et al. [2015], Wang and Cho [2016] or document-level topics Wang et al. [2017] to using LSTM recurrent neural networks with careful initialization Le et al. [2015], auxiliary loss signals Trinh et al. [2018] or augmented memory structures Grave et al. [2016], Ke et al. [2018]. More recent work has demon- strated the applicability of Transformer networks Vaswani et al. [2017a] to the task, potentially side-stepping issues in training recurrent networks (e.g. vanishing/exploding gradients) and scaling to longer contexts Dai et al. [2018], Radford et al. [2018]. All these papers propose either architec- tural or optimization innovations to improve language model training. In contrast, we define and measure explicit long-term properties of language models and show that calibrating them correctly can provide improvements to any black-box language model. Information-theoretic approaches. While most language models aim to predict a distribution over the next token conditioned on the context, there have been alternative approaches relying on information-theoretic measures. Jost and Atwell [1994] propose a model which makes use of mutual information between word pairs to generate word sequences that retain longer-term dependencies. McAllester [2018] propose a training objective based on mutual information for predictive modeling, and demonstrate its application for phoneme prediction. Clarkson and Robinson [1999] develop a hybrid metric using both perplexity and entropy rate, and show that it correlates better with a downstream metric like word error rate. Such works propose alternative optimization objectives; in contrast, we show how to use information-theoretic measures to improve models with respect to existing objectives like cross-entropy. Measuring long-term statistics. Khandelwal et al. [2018] analyze LSTM-based language mod- els and empirically show that such models make use of a finite context for prediction. Lin and Tegmark [2017] measure mutual information between any two symbols in human languages, and show that it decays with distance, roughly following a power law distribution. Takahashi and Tanaka-Ishii [2018] provide an upper bound for the entropy (character-level) of human languages by training neural language models with various context and data sizes and extrapolating to infinity. While we also make use of measures like entropy and mutual information across longer contexts, our goal is to use these to better calibrate the language model and provably improve its perplexity. 3 Calibration and integral probability metrics. The idea of matching properties of the models' predictions to the empirical outcomes, in an online setting, goes back (at least) to the "prequential principle" of Dawid [1982, 1985], with subsequent work in online and game-theoretic settings Foster [1991], Vovk [2001], Kalai et al. [1999]. The idea of improving probability scores is also common in machine learning Zadrozny and Elkan [2002], Platt [1999], Guo et al. [2017], Niculescu-Mizil and Caruana [2005]. The notion of examining the expectation of functions as a metric for the distance between two distributions sometimes goes under the name of integral probability metrics Mller [1997], Sriperumbudur et al. [2009], and this notion is becoming increasingly relevant again in unsupervised learning through the connections to GANs Mroueh and Sercu [2017]. In this work, we directly focus on the KL divergence, where our use of calibration is largely based on basic facts about exponential families Brown [1986]. 3 Preliminaries We first define some useful quantities for our analyses. Let Pr(W1, W2, . . . , WT ) represent the true underlying distribution over T length sequences of words, where the vocabulary is of size M . Let W1:T denote a random sequence of length T , with distribution Pr(W1:T ). For clarity of exposition, we assume that all sequences (i.e. sentences or documents or books) are of equal length T . For any distributions D and D(cid:48) over length-T sequences, recall that the entropy H(·), KL- divergence, and entropy rate are, respectively, defined by: H(D) := Ew1:T ∼D (cid:104) (cid:105) T H(D). Let (cid:99)Pr(W1:T ) denote D(W1:T =w1:T ) log 1 , KL(D (cid:107) D(cid:48)) := Ew1:T ∼D log D(W1:T =w1:T ) D(cid:48)(W1:T =w1:T ) , and EntRate(D) := 1 (cid:105) a learned distribution over sequences. In the typical sequential prediction setting, the probabilistic model is implicitly defined by the conditional distributions Pr(WtW<t), which are typically effi- ciently computable. It is standard for such a language model to be trained to minimize the cross entropy objective: CE(Pr (cid:107)(cid:99)Pr) := 1 T E w1:T ∼Pr (cid:34) T(cid:88) (cid:35) 1(cid:99)Pr(wtw<t) log = 1 T E w1:T ∼Pr log (cid:34) (cid:35) . 1(cid:99)Pr(w1:T ) (cid:104) 1 T Note that for an accurate language model, we would hope that: CE(Pr (cid:107)(cid:99)Pr) ≈ EntRate((cid:99)Pr), i.e. t=1 the entropy rate of the sequences generated under the learned model is nearly that of the cross entropy of the model (with respect to the true distribution Pr). Throughout, we assume that KL(Pr (cid:107)(cid:99)Pr) = CE(Pr (cid:107)(cid:99)Pr) − H(Pr) ≤ ε (1) holds for some ε. In other words, the (unknown) ε measures the degree of sub-optimality of the learned model, this ε is often referred to as the Bayes regret. 4 Calibration and Entropy Rates In this section, we assess the long-term properties of language models when generating text. Specifically, we quantify the amplification in the entropy rate of generations under an ε-accurate 4 Figure 1: Entropy of the t-th generated word, conditioned on the past, for two popular language models, interpolating between model's estimate for the language's entropy (t = 1) and entropy rate of generations (t → ∞). A perfectly calibrated generative model would exhibit a time-invariant entropy rate (gray dotted lines). Left: LSTM trained on Penn Treebank. Right: GPT-2 Trans- former. model (Eq. 1). We then provide a procedure to fix this amplification, without increasing the perplexity of the model. Proofs for all statements are provided in the supplementary material. For generality, consider a function f : [M ]T → R, defined on T length sequences. Let the mean and variance of f under distribution D be denoted by µD(f ) and σ2D(f ) µD(f ) := E w1:T ∼D[f (w1:T )], σ2D(f ) := E w1:T ∼D[(f (w1:T ) − µD(f ))2] . 4.1 Error amplification under our model If our learned model(cid:99)Pr is accurate, we may hope that µPr(f ) ≈ µ(cid:99)Pr(f ) i.e. that the expected value of f under the true distribution Pr is close to its expected value under our model. We can quantify this gap as follows: Lemma 4.1. (Pinsker's Inequality Csiszar and Korner [2011]) Suppose that for all w1:T , f (w1:T ) ≤ B. Then: (cid:12)(cid:12)µPr(f ) − µ(cid:99)Pr(f )(cid:12)(cid:12) ≤ B (cid:113) 2KL(Pr (cid:107)(cid:99)Pr) . Since this holds for any bounded function, we can obtain the error amplification of the entropy rate of(cid:99)Pr simply by choosing f = − log(cid:99)Pr. small probabilities (which can blow up − log(cid:99)Pr), it is helpful to define the γ-mixture distribution We will then consider the model (cid:99)Pr compared to(cid:99)Pr, and, yet, may have a large amplification in the entropy rate. Before we proceed, in order to rule out amplification of this entropy rate due to arbitrarily as: D(γ) := (1 − γ)D + γUni, where the Uni is the uniform distribution over all M T sequences. , which has only a minor degradation in the cross entropy (ε) Corollary 4.2. (Entropy rate amplification under generations) Suppose the bound in equation 1 holds. The ε-mixture distribution has KL bounded as: ) ≤ KL(Pr (cid:107)(cid:99)Pr 1 + ε . (ε) (cid:18) (cid:19) We have that: 1 T CE(Pr (cid:107)(cid:99)Pr (ε) 1 T (cid:18) (cid:19) 1 T 1 + ε , and ) − EntRate(Pr) ≤ 5 0100200300400500600700Generation length t10060708090eH (LSTM)0100200300400500600700Generation length t2030405060eH (Transformer) CE(Pr (cid:107)(cid:99)Pr (ε) ) − EntRate((cid:99)Pr (ε) ) ≤(cid:112)2ε(T + 1) (cid:18) (cid:19) . log M + log(1/ε) T This bound shows that, in the worst case, even a small cross entropy may provide little control over the generations under our model (in terms of entropy rate). In fact, for ε = O( 1 T ) (which we may hope is an accurate model), the bound is vacuous; the following remark shows this worst case bound is unimprovable, see the supplementary material. The above theorems suggest that entropy rate amplification is a theoretical possibility in the worst case, which our experiments show is in fact prevalent in pratice. These entropy rate amplifi- cations are evident from the plots in Figure 1. Regardless of the text corpus or the language model, we observe that the entropy rate under the model's generations quickly increases with time, indi- cating that this is a persistent problem even for state-of-the-art language models while generating text. 4.2 Model calibration We now describe a procedure to fix this error amplification. First, let us define a distribution (cid:99)Prα such that:(cid:99)Prα(w1:T ) = exp(αf (w1:T )) ·(cid:99)Pr(w1:T ) . exp(αf (w1:T )) ·(cid:99)Pr(w1:T ) where Zα = (cid:88) Zα w1:T We can then recover a calibrated model that does not suffer from error amplification in f : Lemma 4.3. (Calibration to f with model improvement) Suppose the variance of f is uniformly + . Let α∗ = bounded in that there exists σ2 + such that the following holds for all α, σ2 (f ) ≤ σ2 Prα argminα CE(Pr (cid:107)(cid:99)Prα) . We have µPr(f ) − µ(cid:99)Prα∗ (f ) = 0, and CE(Pr (cid:107)(cid:99)Prα∗) ≤ CE(Pr (cid:107)(cid:99)Pr) − 1 (µ(f ) − µ(cid:99)Pr(f ))2 2σ2 + . T Entropy rate calibration. We can now apply the previous result to fix the entropy rate ampli- fication seen in Table 1. Note that it is trivial to avoid the entropy rate amplification if we were allowed to degrade the quality of our model, in terms of perplexity (e.g. a unigram model does not have this amplification. However, we show that it is possible to match the entropy rate without having to sacrifice the quality of our model. In fact, we can both improve our model and more accurately match the entropy rate, by fitting a family of one-parameter models. Theorem 4.4. (Entropy rate calibration) Suppose equation 1 holds. Algorithm 1 returns a (cid:99)Prα∗ such that: the following calibration property is satisfied: Furthermore, (cid:99)Prα∗ has entropy close to the true entropy rate as specified by: CE(Pr (cid:107)(cid:99)Prα∗) = EntRate((cid:99)Prα∗). (cid:18) EntRate(Pr) − EntRate((cid:99)Prα∗) ≤ 1 + (cid:19) 1 T ε, 6 Algorithm 1 (Inefficient) Entropy Rate Calibration 1: Input: Model(cid:99)Pr (ε) . 2: Define a model class: (cid:99)Prα(w1:T ) = (cid:16)(cid:99)Pr(w1:T )(ε)(cid:17)1+α /Zα . 3: Fit α∗: α∗ = argminα CE(Pr (cid:107)(cid:99)Prα) 4: Return(cid:99)Prα∗ and (cid:99)Prα∗ is an improvement over the original model as characterized by: CE(Pr (cid:107)(cid:99)Prα∗) ≤ CE(Pr (cid:107)(cid:99)Pr (ε) ) − 1 2  CE(Pr (cid:107)(cid:99)Pr ) − EntRate((cid:99)Pr) (ε) log M + log(1/ε) T 2 . This result shows that we simply need a single parameter α to define a new model class that is a powered up version of our original model. Then, we can fit this α to minimize the cross-entropy of the new model with respect to the true distribution Pr, in order to eliminate the entropy rate amplification. Even though this algorithm fits only a single parameter, it is not easily implementable since it requires an integration over sequences, at least in its exact form. One future direction would be to a sample based approach. This may be an interesting alternative to ideas like beam search Steinbiss et al. [1994], Ortmanns and Ney [2000], Antoniol et al. [1995], which also aims to minimize a global cost function on sequences that is inconsistent with the token-level perplexity loss used to train the underlying generative model. Lookahead algorithms. In order to sidestep the computational issues of Algorithm 1, we pro- vide another simple approach based on what can be viewed as a "one-step" lookahead correction (Algorithm 2). Let(cid:99)Wt be a random variable with conditional distribution(cid:99)Pr(·W<t). H((cid:99)Wt+1w≤t) denotes the entropy of this conditional distribution, i.e. H((cid:99)Wt+1w≤t) = E wt+1∼(cid:99)Pr(·w≤t) log 1(cid:99)Pr(wt+1w≤t) (cid:34) (cid:35) . Note that H((cid:99)Wt+1w≤t) includes the word wt, so we require computing the entropy at time t + 1 when predicting Wt using a learned model. For a conditional distribution, D(W1:T ), let us define: T(cid:88) [H((cid:99)Wt+1w≤t)] ¯µD = 1 T E E w<t∼Pr wt∼D(·w<t) t=1 Thus, ¯µD is the average of H((cid:99)Wt+1w≤t) with respect to a distribution which uses D for sampling the last word Wt (at every timestep). Intuitively, the resulting model(cid:99)Prα with a positive α would entropy 1-step ahead in the future. Therefore, if our learned language model (cid:99)Pr was accurate, we suppress sampling words leading to larger entropy but rather encourage words that stablizes the 7 Algorithm 2 Local Entropy Rate Calibration 1: Input: Model(cid:99)Pr (ε) 2: Define a model class: (ε) (·W<t). , where (cid:99)Wt ∼(cid:99)Pr (cid:99)Prα(wtw<t) =(cid:99)Pr(wtw<t) · exp (cid:99)Prα(w1:T ) = (cid:98)Pα(w1)(cid:98)Pα(w2w1) . . . (cid:16) (cid:17) α · H((cid:99)Wt+1w≤t) /Zα. where 3: Fit α∗: α∗ = argminα CE(Pr (cid:107)(cid:99)Prα) 4: Return(cid:99)Prα∗ would hope that: ¯µPr ≈ ¯µ(cid:99)Pr . The following corollary shows that this is achievable, along with Corollary 4.5. Suppose Equation 1 holds. Then, Algorithm 2 returns a (cid:99)Prα∗ such that: (cid:33)2 improving the model's perplexity. CE(Pr (cid:107)(cid:99)Prα∗) ≤ CE(Pr (cid:107)(cid:99)Pr (ε) ) − 1 2 (cid:32) ¯µ − ¯µ(cid:99)Pr (ε) log M + log(1/ε) . ¯µPr − ¯µ(cid:99)Prα∗ = 0, and This result provides us with Algorithm 2, which is computationally quite tractable. We first use the learned model(cid:99)Pr to define a new model class(cid:99)Prα, which scales(cid:99)Pr by an exponential distribution over the weighted 1-step lookahead entropy H((cid:99)Wt+1w≤t). Then, similar to Algorithm 1, we simply fixes the entropy amplification in the resulting model(cid:99)Prα. We observe this empirically in Figure 2 fit the single parameter α to minimize the cross-entropy of the new model with respect to Pr, which T -- our calibration results in a perplexity drop of almost 20 points over long-term generations under an LSTM model. Model and implementation details are in the supplementary material. Generations from a calibrated model. Table 2 provides sample generations from a calibrated Transformer model trained on the GBW dataset, compared to its original version. Qualitatively, the calibrated generations: (1) are shorter and more concise, and (2) display a better grasp of discourse structure across sentences. More generations are provided in the supplementary material. 5 Calibration and Memory Defining a notion of memory in language models is challenging, and multiple equally sensible notions may co-exist. Here we present our choice from first principles. Let us say that(cid:99)Wt is a sample from a model at time t, i.e. (cid:99)Wt ∼(cid:99)Pr(WtW<t). Let us also assume that W<t ∼ Pr(W<t). We will define the memory at gap τ as the mutual information between (cid:99)Wt and the distant past (those words greater than τ steps ago) conditioned on the subsequence Wt−τ :t−1. Precisely, Iτ := I((cid:99)Wt; W<t−τWt−τ :t−1) = H((cid:99)WtWt−τ :t−1) − H((cid:99)WtW<t) , where we are not explicitly denoting the t dependence in this definition1. 1While we may attempt to estimate Iτ for a given t, we can remove the t dependence by either defining this quantity by with an average over t or by using appropriate stationarity assumptions. In our experiments, we average over t. 8 h is able to reduce by utilizing the deep past W<t−τ in addition to the recent past Wt−τ :t−1. Figure 2: Effect of calibrating an LSTM generative model with 1-step lookahead. Blue: entropy curve from the setting of Figure 1. Green: entropy measurements after applying local calibration. Intuitively, It can be viewed as how much uncertainty (entropy) in the prediction Wt the model The difficulty in estimating this mutual information is due to estimating H((cid:99)WtWt−τ :t−1), which requires the marginalized model (cid:99)Pr(WtWt−τ :t−1). To (even approximately) marginalize a model distribution (cid:99)Pr(WtW<t) over the deep past W<t−τ is statistically difficult, since it requires the access to a pool of samples of W<t that share an common recent past Wt−τ :t−1. Nevertheless, we now show that it is possible to obtain an upper bound (which is computationally efficient to estimate). Upper bounding mutual information using calibrated models. consider a more general setting, where we have a distribution Pr(Z, Y, X) where Z, Y , and X are considering the mutual information between (cid:99)Wt and W<t−τ conditioned on Wt−τ :t−1. Let us now random variables. We wil eventually consider Z, Y, X to be (cid:99)Wt, Wt−τ :t−1W<t−τ , respectively. For distributions D(·Y, X) and (cid:101)D(·Y, X) and for α ∈ R, define (cid:17)α Dα(ZY, X) := D(ZY, X) ·(cid:16)(cid:101)D(ZY, X) In the above, we were /Zα . We say that D(·Y, X) is calibrated to D(·Y, X), if D = Dα=0 is unimprovable in that for all α Note this condition is achievable due to that calibrating a model to (cid:101)D(·Y, X) involves a one di- CE(Pr (cid:107) D) ≤ CE(Pr (cid:107) Dα) . mensional (convex) estimation problem (over α). 9 020406080100Generation length t60708090eH (LSTM)originalcalibrated Original model Actual results could differ materially from those in- dicated by these forward-looking statements as a re- sult of various important factors , including , without limitation : changes in general economic and busi- ness conditions , including more difficult real estate environments ; risks related to investigations by other companies ; inadequate infor- mation systems ; the impact of reduced availability of ; * assumptions upon such companies using such as ours to gauge CNET 's financial condition ; and other factors . [...174 tokens...] Bluepoint Games , Inc. is a highly experienced and multi-faceted publisher of licensed virtual worlds for gamers , developers and technology professionals . [...114 tokens...] James Upon , CEO of MyNet- SheltetWeb and the three previous Developers of MySQL . Based in Redwood City , California , Blue- Mountain is the leader in franchise and game develop- ment for the massively multiplayer online game . Calibrated model Actual results could differ materially from those indi- cated by these forward-looking statements as a result of a variety of factors , including but not limited to ( i ) the risk that the tender offer could close in one or more manner or at all ; ( ii ) risks associated with conducting business in foreign jurisdictions ; ( iii ) difficulties in combining some or all of the businesses under one roof ; ( iv ) decreased demand for electric- ity , natural gas and other energy products , including adverse effects on the pricing of oil and natural gas ; and ( v ) the risks associated with doing business in- ternationally . Bluepoint Games , Inc. is a highly experienced licens- ing , gaming and entertainment firm focused on de- veloping the next generation of casual games based on the PlayStation ( R ) BRAVIA family of video game machines for the North American market . Bluepoint is a wholly owned subsidiary of Bluehill ID Holdings L.P. Table 2: Sample generations from a calibrated, state-of-the-art Transformer model trained on the GBW corpus, seeded with prefixes of sentences (in italics) from the holdout validation set. Theorem 5.1. Suppose we have a model(cid:99)Pr(ZX), and suppose (cid:101)Z ∼(cid:102)Pr(·X), where (cid:101)Z is dependent only on X Suppose that (cid:99)Pr is calibrated to (cid:102)Pr. Then we have that: I((cid:98)Z; XY ) ≤ CE(Pr (cid:107)(cid:102)Pr) − H((cid:98)ZY, X) , where: (cid:35) CE(Pr (cid:107)(cid:102)Pr) = E (cid:34) log E . Y ∼Pr Z∼Pr(·Y ) 1(cid:102)Pr(ZY ) Memory estimation. We first learn another (cid:102)Wt ∼(cid:102)Pr(·Wt−τ :t−1), and then calibrate(cid:99)Pr to(cid:102)Pr. Corollary 5.2. Suppose (cid:99)Pr (·W<t) is a model calibrated to (cid:102)Pr(·Wt−τ :t−1). For a random vari- able, (cid:99)W cal (·W<t), we have that: t ∼(cid:99)Pr cal cal ; W<t−τWt−τ :t−1) ≤ CE(Pr (cid:107)(cid:102)Pr) − H((cid:99)W cal CE(Pr (cid:107)(cid:102)Pr) = (cid:102)Pr(WtWt−τ :t−1) Wt−τ :t∼Pr (cid:34) log E 1 t (cid:35) . I((cid:99)W cal t W<t), where: This corollary gives us a means to efficiently provide upper bounds on the mutual information. The key is that since (cid:102)Pr is efficiently computable, we can directly estimate CE(Pr(cid:102)Pr) through limited-memory models(cid:102)Pr (see details in the supplementary material) and report them in Figure 3. Monte Carlo estimation. We measure the upper bounds on Iτ of a LSTM model with trained As expected, the memory estimate gradually decays with longer τ , indicating that the models make more use of the recent past to generate text. 10 τ CE(Pr(cid:102)Pr) 5 10 15 20 25 30 4.8144 4.5258 4.4166 4.3347 4.2777 4.2408 Iτ upper bound 0.6180 0.4226 0.2678 0.2485 0.2274 0.2143 α∗ 0.003515 -0.01041 -0.00447 -0.02268 -0.01814 -0.02323 Figure 3: Left: Plot of the upper bound on Iτ derived from calibrated models. Right: The measurements of the upper bound on mutual information, the cross entropy of the limited memory model(cid:102)Pr as well as the optimal calibration coefficient α∗ for various time lengths τ . Details of the model used here can be found in the supplementary material. 6 Conclusion We have introduced a calibration-based approach to detect and provably correct the discrepancies between the long-term generations of language models and the true distributions they estimate sequentially. In particular, for state-of-the-art neural language models, we have observed large degradations of the entropy rate under iterative generation, and a proposed first-order correction which is both computationally tractable and effective. Using the same calibration approach, we have derived estimators for the amount of information extracted by these models from the deep past. Aside from the empirical findings and improvements, we hope that this work will inspire a more principled line of discourse on the quality of long-term generations in language models. It remains an interesting open problem to study other "future-aware" generation-improving heuristics (beam search, reverse language models, GANs) in this framework of calibration. Acknowledgments S. K. gratefully acknowledges funding from the Washington Research Foundation for Innovation in Data-intensive Discover, the ONR award N00014-18-1-2247, and NSF Award CCF-1703574. References Giuliano Antoniol, Fabio Brugnara, Mauro Cettolo, and Marcello Federico. Language model rep- resentations for beam-search decoding. In 1995 International Conference on Acoustics, Speech, and Signal Processing, volume 1, pages 588 -- 591. IEEE, 1995. L. D. Brown. Fundamentals of Statistical Exponential Families: With Applications in Statistical Decision Theory. Institute of Mathematical Statistics, Hayworth, CA, USA, 1986. ISBN 0-940- 60010-2. Philip Clarkson and Tony Robinson. Towards improved language model evaluation measures. In Sixth European Conference on Speech Communication and Technology, 1999. 11 51015202530history length 0.00.20.40.6I upper bound (nats) Thomas M. Cover and Joy A. Thomas. Elements of Information Theory (Wiley Series in Telecom- ISBN munications and Signal Processing). Wiley-Interscience, New York, NY, USA, 2006. 0471241954. Imre Csiszar and J´anos Korner. Information theory: coding theorems for discrete memoryless systems. Cambridge University Press, 2011. Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Language modeling with longer-term dependency. 2018. A. P. Dawid. The well-calibrated bayesian. Journal of the Am. Stat. Assoc, 77, 1982. A. P. Dawid. The impossibility of inductive inference. Journal of the Am. Stat. Assoc, 80, 1985. D. P. Foster. Prediction in the worst case. Annals of Statistics, 19, 1991. Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Frage: frequency-agnostic word representation. In Advances in Neural Information Processing Systems, pages 1341 -- 1352, 2018. Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016. Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1321 -- 1330. JMLR. org, 2017. Yangfeng Ji, Trevor Cohn, Lingpeng Kong, Chris Dyer, and Jacob Eisenstein. Document context language models. arXiv preprint arXiv:1511.03962, 2015. Uwe Jost and ES Atwell. Proposal for a mutual-information based language model. In Proceedings of the 1994 AISB Workshop on Computational Linguistics for Speech and Handwriting Recognition. AISB, 1994. Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. E. Kalai, E. Lehrer, and R. Smorodinsky. Calibrated forecasting and merging. Games and Economic Behavior, 29, 1999. Nan Rosemary Ke, Anirudh Goyal, Olexa Bilaniuk, Jonathan Binas, Michael C Mozer, Chris Pal, and Yoshua Bengio. Sparse attentive backtracking: Temporal credit assignment through reminding. In Advances in Neural Information Processing Systems, pages 7651 -- 7662, 2018. Urvashi Khandelwal, He He, Peng Qi, and Dan Jurafsky. Sharp nearby, fuzzy far away: How neural language models use context. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 284 -- 294, 2018. Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015. 12 Henry Lin and Max Tegmark. Critical behavior in physics and probabilistic formal languages. Entropy, 19(7):299, 2017. Mitchell Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. 1993. David McAllester. Information theoretic co-training. arXiv preprint arXiv:1802.07572, 2018. G´abor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language models. arXiv preprint arXiv:1707.05589, 2017. Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. arXiv preprint arXiv:1708.02182, 2017. Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An Analysis of Neural Language Modeling at Multiple Scales. arXiv preprint arXiv:1803.08240, 2018. Tomas Mikolov and Geoffrey Zweig. Context dependent recurrent neural network language model. In 2012 IEEE Spoken Language Technology Workshop (SLT), pages 234 -- 239. IEEE, 2012. Youssef Mroueh and Tom Sercu. Fisher gan. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 2513 -- 2523. Curran Associates, Inc., 2017. URL http://papers.nips.cc/ paper/6845-fisher-gan.pdf. Alfred Mller. Integral probability metrics and their generating classes of functions. Advances in Applied Probability, 29:429 -- 443, 06 1997. doi: 10.2307/1428011. Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learn- ing. In Proceedings of the 22nd international conference on Machine learning, pages 625 -- 632. ACM, 2005. Stefan Ortmanns and Hermann Ney. Look-ahead techniques for fast beam search. Computer Speech & Language, 14(1):15 -- 32, 2000. John C. Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In Advances in Large Margin Classifiers, pages 61 -- 74. MIT Press, 1999. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language un- derstanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openai- assets/research-covers/languageunsupervised/language understanding paper. pdf, 2018. Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019. Claude E Shannon. Prediction and entropy of printed english. Bell system technical journal, 30(1): 50 -- 64, 1951. Bharath Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Schlkopf, and Gert Lanckriet. On integral probability metrics, phi-divergences and binary classification. 01 2009. 13 Volker Steinbiss, Bach-Hiep Tran, and Hermann Ney. Improvements in beam search. In Third International Conference on Spoken Language Processing, 1994. Shuntaro Takahashi and Kumiko Tanaka-Ishii. Cross entropy of neural language models at infinitya new bound of the entropy rate. Entropy, 20(11):839, 2018. Sho Takase, Jun Suzuki, and Masaaki Nagata. Direct output connection for a high-rank language model. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Pro- cessing, pages 4599 -- 4609, 2018. Trieu H Trinh, Andrew M Dai, Thang Luong, and Quoc V Le. Learning longer-term dependencies in rnns with auxiliary losses. arXiv preprint arXiv:1803.00144, 2018. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, (cid:32)Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998 -- 6008, 2017a. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, (cid:32)Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998 -- 6008, 2017b. V. Vovk. Competitive on-line statistics. International Statistical Review, 69, 2001. Tian Wang and Kyunghyun Cho. Larger-context language modelling with recurrent neural network. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 1319 -- 1329, 2016. Wenlin Wang, Zhe Gan, Wenqi Wang, Dinghan Shen, Jiaji Huang, Wei Ping, Sanjeev Satheesh, and Lawrence Carin. Topic compositional neural language model. arXiv preprint arXiv:1712.09783, 2017. Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass proba- bility estimates, 2002. 14 A Proofs for Section 4 Proof. (of Lemma 4.1) We have (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) E w1:T ∼Pr w1:T ∼(cid:99)Pr [f (w1:T )] − E [f (w1:T )] (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) = (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:88) (cid:16) Pr(w1:T ) −(cid:99)Pr(w1:T ) ≤ (cid:12)(cid:12)(cid:12)Pr−(cid:99)Pr (cid:12)(cid:12)(cid:12)1 (cid:113) 2KL(Pr(cid:99)Pr))B ≤ w1:T B (cid:17) f (w1:T ) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) where we have used Holder's and Pinsker's inequalities Cover and Thomas [2006]. Proof. (of Corollary 4.2) First observe: 1(cid:99)Pr (ε) (w1:T ) ≤ log log and that: = log 1 (1 − ε)(cid:99)Pr(w1:T ) 1(cid:99)Pr log (ε) 1(cid:99)Pr(w1:T ) − log(1 − ε) ≤ log 1(cid:99)Pr(w1:T ) + ε ≤ log M T ε . (2) For the first claim, we have KL(Pr(cid:99)Pr 1 T (ε) ) = 1 T E w1:T ∼Pr Pr(w1:T ) (ε) (w1:T ) (cid:35) ≤ (1 + 1 T )ε . using our assumption in Equation 1. For the second claim, taking f = log with Lemma 4.1, we have: (cid:12)(cid:12)(cid:12)(cid:12)CE(Pr(cid:99)Pr (ε) 1(cid:99)Pr ) − EntRate((cid:99)Pr (ε) (ε) ) (cid:113) 2KL(Pr(cid:99)Pr (cid:112)2ε(T + 1) log (ε) ) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)log M T ε , (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)∞ 1(cid:99)Pr (ε) (w1:T ) (cid:34) log (cid:99)Pr (cid:12)(cid:12)(cid:12)(cid:12) ≤ 1 T (w1:T ) which completes the proof. = 1 T Proof. (of Lemma 4.3) By definition, CE(Pr(cid:99)Prα) := CE(Pr(cid:99)Pr) − α we have: ∂CE(Pr(cid:99)Prα) ∂α = 1 T The first claim now follows from optimality of α∗. [f (w1:T )] + log(Zα) , E T w1:T ∼Pr (cid:16)−µPr(f ) + µ(cid:99)Prα 1 T (cid:17) (f ) 15 For the second claim, ∂2CE(Pr(cid:99)Prα) ∂2α = = = 1 T 1 T 1 T ∂2 log(Zα) (cid:80) ∂2α (cid:80) w1:T ∂ ∂α σ2(cid:99)Prα (f ) = By Taylor's theorem, we have: CE(Pr(cid:99)Prα) ≤ CE(Pr(cid:99)Pr) − α · 1 f (w1:T ) exp(αf (w1:T )) ·(cid:99)Pr(w1:T ) exp(αf (w1:T )) ·(cid:99)Pr(w1:T ) σ2(cid:99)Prα (cid:16) (f ) ≤ σ2 + T w1:T 1 T (cid:17) . µPr(f ) − µ(cid:99)Prα (f ) + α2 2 · σ2 + T . T Taking the the α which minimizes the upper bound, leads to the second claim. Remark A.1. (Sharpness) If ε ≥ 1 EntRate((cid:99)Pr) takes on the maximal value of O(log M ). As an example, consider a model (cid:99)Pr, that T , then there exists a problem where the bound is sharp and starts by generating words under the true distribution Pr and has a 1 into a mode in which it generates words uniformly at random thereafter. T probability of transitioning Proof. (of Theorem 4.4) We can apply the previous lemma using and so our calibration condition implies: f = log 0 = µPr(f ) − µ(cid:99)Prα∗ (f ) = −(cid:16) , 1(cid:99)Pr(w1:T ) (cid:17) µPr(log(cid:99)Pr) − µ(cid:99)Prα∗ (log(cid:99)Pr) . Now observe that: T · CE(Pr(cid:99)Prα∗) = µPr(−(1 + α∗) log(cid:99)Pr + log Zα∗) = −(1 + α∗)µPr(log(cid:99)Pr) + log Zα∗ and, similarly, T · EntRate((cid:99)Prα∗) = −(1 + α∗)µ(cid:99)Prα∗ (log(cid:99)Pr) + log Zα∗ . These imply: CE(Pr(cid:99)Prα∗) − EntRate((cid:99)Prα∗) = − 1 (cid:16) µ(f ) − µ(cid:99)Pr(f ) = T T The proof of the second claim uses which completes the proof of the first claim. (cid:16) (cid:17) µPr(log(cid:99)Pr) − µ(cid:99)Prα∗ (log(cid:99)Pr) = 0 , (1 + α∗) (cid:17) CE(Pr(cid:99)Pr) − EntRate((cid:99)Pr) , and, by Equation 2, which completes the proof. + ≤ T log M + log(1/ε) , σ2 16 define: Define: and We have that: and that Lemma A.1. Suppose f ≤ σ2 +. Let Now we move on to the proof of Corollary 4.5. Suppose f (W≤t) be a function of W≤t. For a conditional distribution, D(W1:T ), let us now ¯µD(f ) = T(cid:88) (cid:98)Pt,α(wtw<t) := 1 T t=1 E w<t∼Pr 1 E [f (w≤t)] . wt∼(cid:98)D(·w<t) exp(αf (w≤t)) ·(cid:99)Pr(wtw<t) Zα,t (cid:99)Prα(w1:T ) := (cid:98)P1,α(w1)(cid:98)P2,α(w2w1) . . . . CE(Pr(cid:99)Prα) . α∗ = argmin ¯µPr(f ) − ¯µ(cid:99)Prα∗ (f ) = 0 α CE(Pr(cid:99)Prα∗) ≤ CE(Pr(cid:99)Pr) − (¯µ(f ) − ¯µ(cid:99)Pr(f ))2 . σ2∗ Proof. (sketch) The proof is identical to that of Lemma 4.3, with the addition of using linearity of expectation. B Proofs for Section 5 Proof. (of Theorem 5.1) It is convenient to define the distribution: D(Z, Y, X) =(cid:99)Pr(ZX, Y ) · Pr(Y, X) . I((cid:98)Z; XY ) = H((cid:98)ZY ) − H((cid:98)ZY, X) We then have: by the defintion of the mutual information. The proof consists of showing that: H((cid:98)ZY ) = EY,Z∼D log Let us take (cid:99)Prα(ZX, Y ) =(cid:99)Pr(ZX, Y ) ·(cid:16)(cid:102)Pr(ZX) D(ZY ) (cid:17)α 1 optimality at α = 0 implies: ≤ CE(Pr(cid:102)Pr) . 0 = ∂α = EX,Y ∼Pr (cid:12)(cid:12)(cid:12)α=0 ∂CE(Pr(cid:99)Prα) (cid:104)−EZ∼Pr(·X,Y ) log(cid:102)Pr(ZY ) + EZ∼(cid:99)Pr(·X,Y ) log(cid:102)Pr(ZY ) (cid:105) = −EY ∼Pr[EZ∼Pr(·Y ) log(cid:102)Pr(ZY ) + EX,Y ∼Pr[EZ∼(cid:99)Pr(·X,Y ) log(cid:102)Pr(ZY )] = CE(Pr(cid:102)Pr) + EX,Y ∼Pr[EZ∼(cid:99)Pr(·X,Y ) log(cid:102)Pr(ZY )] . /Zα. The zero gradient condition for the 17 This implies: CE(Pr(cid:102)Pr) = EX,Y ∼Pr[EZ∼(cid:99)Pr(·X,Y ) log 1(cid:102)Pr(ZY ) 1(cid:102)Pr(ZY ) = EX,Y,Z∼D log = EY,Z∼D log 1(cid:102)Pr(ZY ) ] where the last step uses the definition of (cid:98)Z and Jensen's inequality. 1 D(ZY ) ≥ EY,Z∼D log = H((cid:98)ZY ) , C Experimental Details In this section, we outline the experimental setups used to obtain the empirical results throughout the paper. For the calibration and memory experiments (Table 1 row 1, Figure 1 (left), Figures 2, 3), our base model is a 3-layer LSTM with with 400 embedding dimension and 1150 hidden nodes. We train it on the Penn Treebank (PTB) corpus Marcus et al. [1993], following the setup of Merity et al. [2017] and Merity et al. [2018] for 500 epochs using SGD with batch size 20 and BPTT length 70. The trained base model achieves 64.3 validation perplexity and 58.3 test perplexity. The limited-memory models (cid:102)Pr(·Wt−τ :t−1) used for the memory estimation in Section 5 share the same architecture as our base model while, during training, the hidden states is re-initialized after reading every τ tokens (τ takes value from {5, 15, . . . , 30}). Finally, for the entropy rate measurements of larger-scale state-of-the-art language models (Ta- ble 1 rows 2-4, Figure 1 (right)), we used the pretrained weights published alongside Jozefowicz et al. [2016], Radford et al. [2019] for rows 2 and 4, while we trained the model using the tensor2tensor framework. The model for row 2 is an LSTM with CNN-embedded inputs, trained on the Google Billion Words (GBW) corpus. The other two are Transformer Vaswani et al. [2017a] models trained on GBW (row 3), and an proprietary corpus derived from a web crawl (WebText; row 4). For GPT- 2, since the authors have not published training or validation data, we used the text of several New York Times articles as a stand-in validation set; the cross entropy loss is comparable to that re- ported on the validation set. The entropy rate amplification plot in Figure 1 (bottom) corresponds to the setup from row 4. To measure the conditional entropy after t generations, we measured the empirical conditional entropy of the t-th word over > 500 independent generations, which were produced by the standard way of iteratively sampling from the next predicted conditional distribution, seeded with ground- truth text up to > 100 random points in the validation set. We used the entropy rate at t = 700 as a proxy for the asymptotic limit in Table 1. D Additional Generation Samples In this section, to provide a better sense of the qualitative effect of calibration, we provide below some additional generations, seeded by 10-token prefixes of the holdout (validation) sentences from 18 the Google Billion Words dataset. Here, we used the model we trained for row 3 of Table 1. To identify a failure mode for the uncalibrated model, we selected the seed prefixes which resulted in unusually long generations by the uncalibrated model. Original model Actual results could differ materially from those indicated by these forward-looking statements as a result of numerous fac- tors including the risks associated with the timely and efficient completion and inte- gration of the Temporary Liquidity Guar- antee Department 's supervision into the commercial , open market , solar energy , energy efficiency , electric utility trans- mission , and water demands of residential and business customers , Comcast 's abil- ity to successfully implement its business plan , timing of completion of the acqui- sition and the effectiveness of the efforts and strategies involved in the integration of Rhapsody , timing of regulatory and client approvals and availability of key en- hancements . Calibrated model Actual results could differ materially from those indicated by these forward-looking statements as a result of a variety of fac- tors , including but not limited to ( i ) the risk that the tender offer could close in one or more manner or at all ; ( ii ) risks associated with conducting business in foreign jurisdictions ; ( iii ) difficulties in combining some or all of the businesses under one roof ; ( iv ) decreased demand for electricity , natural gas and other en- ergy products , including adverse effects on the pricing of oil and natural gas ; and ( v ) the risks associated with doing busi- ness internationally . 19 Actual results could differ materially from those indicated by such forward-looking statements as a result of various important factors , including those discussed in the company 's periodic reports that are filed with the Securities and Exchange Com- mission and available on the SEC 's web- site at www.sec.gov. Actual results could differ materially from those indicated by these forward-looking statements as a result of various important factors , including , without limitation : changes in general economic and business conditions , including more difficult real estate environments ; declines in infor- mation technology spending ; continued availability of capital and government reg- ulations ; changes in general economic and business conditions ; the possibility that extended unemployment and healthcare policies may change , or may reduce ac- cess to quality care services ; failure to ob- tain adequate and affordable medications ; changes in certain CME / CE product mix ; disruption in CME credit markets ; uncertainty of the outcomes of regulatory investigations of companies in which the Company has an interest ; dependence on suppliers for most of its products ; consol- idation among financial institutions ; abil- ity to attract and retain skilled personnel ; changes in rapidly changing technology and regulatory environments ; arrogance and complacency among financial analysts ; the impact of competition ; inability to retain and motivate senior management ; difficulties in the integration of acquired businesses ; the effects of redundancy and loss of key employees ; litigation , includ- ing claims and the challenge of insurance practices ; uncertainties relating to liti- gation ; risks related to investigations by other companies ; inadequate information systems ; the impact of reduced availabil- ity of ; * assumptions upon such compa- nies using such as ours to gauge CNET 's financial condition ; and other factors . 20 Actual results could differ materially from those indicated by these forward-looking statements as a result of various important factors , including those discussed in the " Risk Factors " section of the Company 's Annual Report on Form 10-K for the most recently ended fiscal year . Actual results could differ materially from those indicated by such forward-looking statements as a result of a variety of fac- tors , including our ability to improve our liquidity . Among these factors are changes in the general economy , changes in political and economic conditions , changes in interest rates , changes in tech- nology and implementation of regulatory policies and legislation , the direction of interest rates and changes in the bank- ing industry , changes in loan prepay- ment activity , changes in consumer pref- erences and consumer and business lend- ing markets , legislation or public com- pliance with applicable laws and regula- tions and changes in the business or reg- ulatory environment . We caution you that there are many uncertainties that could cause actual results to differ mate- rially from those indicated in the forward- looking statements . Among them are the risk factors that could cause results to dif- fer from those expressed in the forward- looking statements . These factors include , but are not limited to : general economic and business conditions , including the fi- nancial markets ; fluctuations in interest rates ; government regulation of the finan- cial services industry and possible failures ; planning assumptions and estimates ; po- tential funding requirements ; unexpected changes in cost increases ( including good- will impairment ) ; competition ; the po- tentially lengthy , protracted U.S. reces- sion ; and migratory consumer and busi- ness conditions . 21 Bluepoint Games , Inc. is a highly experi- enced gaming and entertainment company with several renowned blockbuster fran- chises including PC , GameHouse ( ( R ) ) GameHouse ( ( R ) ) , Heavenly Sword ( ( TM ) ) , EverQuest ( R ) , Untold Story ( TM ) and EverQuest ( R ) II . Through its wholly-owned subsidiary , Bluehill ID ( R ) , the Bluehill ID logo and tagline are registered trademarks of Bluehill ID Cor- poration and its subsidiaries in the U.S. and in other countries . Bluepoint Games , Inc. is a highly expe- rienced and multi-faceted publisher of li- censed virtual worlds for gamers , devel- opers and technology professionals . The company is based in Vancouver , Canada . BlueKai 's innovative games are dis- tributed by Devices EA , LLC , and Club Penguin . BlueKai owns and is the exclu- sive licensor of Scrabulous . BluetoothQ Interactive Inc. has acquired JoShear- Swain Media , LLC , a premier devel- oper and publisher of community based games for the handheld game device . For further information , please visit : www.netgear.com / ngcleveld . Sprint 's fantasy game publisher and Web doing business within the Entertainment Group is James Upon , CEO of MyNetShel- tetWeb and the three previous Develop- ers of MySQL . Based in Redwood City , California , BlueMountain is the leader in franchise and game development for the massively multiplayer online game . 22 Bluepoint Games , Inc. is a highly expe- rienced licensing , gaming and entertain- ment firm focused on developing the next generation of casual games based on the PlayStation ( R ) BRAVIA family of video game machines for the North American market . Bluepoint is a wholly owned sub- sidiary of Bluehill ID Holdings L.P. Bluepoint Games , Inc. is a highly ex- perienced player in the growing genre of casual games for both casual and active gaming enthusiasts . Bluepoint is an early stage Company with a significant follow- ing among youth and adults in Europe and the United States with an impressive track record in global on-line gaming opportuni- ties . , Inc. Bluepoint Games , Inc. is a highly expe- rienced gaming , entertainment and mo- bile games company with a vertically in- tegrated portfolio including : games ( TM ) , social network , mobile , casual games , MMORPG , production , distribution , and licensing including its flagship games , SUIT and TIMMERIX ( TM ) , as well as its award-winning gaming , basketball and entertainment network . In order to cre- ate a highly integrated , pure and socially responsible Game ( R ) family , Bluepoint has collaborated with Amplify Systems In- ternational on various titles for PlayStation ( R ) 2 , PLAYSTATION 3 ( R ) 5 , Wii ( TM ) 3 , PS3 , Wii ( TM ) ( and PS3 titles ) as well as PC games for PC , PSP , POOL , Wii ( TM ) ( and successor title ) and IP ( R ) , in addition to its focused gaming , entertainment and communication services . BlueBay 's ex- clusive licensee worldwide licensee of the Bluepoint ( TM ) ZMFAO Gateway series , it is the world 's leading portable gam- ing , PC and mobile phone company . For more information , see UNK , Inc. and " Oakpoint : ZWC 's Community Health Business Development Center . Bluepoint Games , Inc. is a highly expe- rienced , innovative entertainment sports gaming company whose products and ser- vices are used by some of the most rec- ognized and respected names in the world of gaming including : Pokemon , Macau ( Valve ) , Quattro , Super Smash Bros. , Good Neighbor Games , IGN Games , Vail Resorts , Kania ( Ocean Spray , Pem- berton and Roatenham ) , PURE Hold- ings , TeenNick , National Amusements , SEGA Games , Cirrus ( Aircraft ) and www.netapool.com. 23 Nursing Homes : Genworth 's 2009 Cost of Care Survey , conducted by the Robert Wood Johnson Foundation and released today , reveals the extent to which mem- bers of the U.S. population adheres to practices recommended since 1995 , in- cluding : a rolling three-hour " Python for Life " that fell asleep from 11 p.m. to 2 a.m. , sleep time from 11 p.m. to 3 a.m. , spare time from 8 a.m. to 9 p.m. , and use of state-of-the art non-invasive technolo- gies . A remodeling and refurbishment of hospital facilities is underway as the na- tion 's economy begins to gain momentum . Similar to the previous years , Thinking About Health - Hear how health plans are working to address various congressional proposals to advance best practices in pa- tient care and provide greater accountabil- ity , advocacy and transparency to con- sumers . Nursing Homes : Genworth 's 2009 Cost of Care Survey is based on a double- blind , randomized , double-blind , placebo-controlled survey which involved an assessment of the cost-effectiveness of healthcare associated with an adequate diet and regular physical activity com- pared to its managed-care counterparts . The margin of error for this survey is + / - 3.3 percentage points at the 95 percent level of confidence . Nursing Homes : Genworth 's 2009 Cost of Care Survey , conducted by CareScout ( R ) and published in the April 2009 is- sue , evaluated findings from the 10-year , nearly 900,000-member Specialty Health Management Association 's more than 6,000 professionals living in the United States . Nursing Homes : Genworth 's 2009 Cost of Care Survey is based on interviews with 516 family , friends and neighbors of in- sured and self-employed people conducted from Jan . Nursing Homes : Genworth 's 2009 Cost of Care Survey , conducted by Harris Inter- active , performed significantly worse than a control group of its peers who provided care but were not able to offer health care to their employees . Nursing Homes : Genworth 's 2009 Cost of Care Survey includes a series of health and medical cost reports on more than 100 home medical equipment and related products , including more than 3.9 million units of durable medical equipment . IBC 's cost of more than $ 100 billion is a sig- nificant portion of Medicare spending on home health care . Table 3: More generations from a state-of-the-art Transformer model trained on GBW, seeded with prefixes of sentences from the holdout validation set. 24
1111.3152
1
1111
2011-11-14T09:34:34
\'Evaluation de lexiques syntaxiques par leur int\'egartion dans l'analyseur syntaxiques FRMG
[ "cs.CL" ]
In this paper, we evaluate various French lexica with the parser FRMG: the Lefff, LGLex, the lexicon built from the tables of the French Lexicon-Grammar, the lexicon DICOVALENCE and a new version of the verbal entries of the Lefff, obtained by merging with DICOVALENCE and partial manual validation. For this, all these lexica have been converted to the format of the Lefff, Alexina format. The evaluation was made on the part of the EASy corpus used in the first evaluation campaign Passage.
cs.CL
cs
Elsa TOLONE LIGM, Université Paris-Est, France & FaMAF, Universidad Nacional de Córdoba, Argentine [email protected] Éric de LA CLERGERIE ALPAGE, INRIA Paris–Rocquencourt & Université Paris 7, France [email protected] Benoît SAGOT ALPAGE, INRIA Paris–Rocquencourt & Université Paris 7, France [email protected] ÉVALUATION DE LEXIQUES SYNTAXIQUES PAR LEUR INTÉGRATION DANS L'ANALYSEUR SYNTAXIQUE FRMG Résumé Dans cet article, nous évaluons divers lexiques avec l'analyseur syntaxique FRMG : le Lefff, LGLex, le lexique syntaxique construit à partir des tables du Lexique-Grammaire du français, le lexique DICOVALENCE, ainsi qu'une nouvelle version des entrées verbales du Le fff, obtenues par fusion avec DICOVALENCE et validation manuelle partielle. Pour cela, tous ces lexiques ont été convertis au format du Lefff, le format Alexina. L'évaluation a été faite sur la partie du corpus EASy utilisé lors de la première campagne d'évaluation Passage. Mots clés : lexiques syntaxiques, analyseur syntaxique, campagne d'évaluation, fouille d'erreurs 1. Introduction De nombreux analyseurs du français ont été développés ces dernières années et il importe de les évaluer afin d'améliorer leur précision et leur robustesse sur des corpus à grande échelle. Ceci est en effet de nature à améliorer l'exploitation des annotations syntaxiques produites, d'une part pour enrichir, améliorer voire créer des ressources linguistiques et d'autre part en vue d'applications concrètes comme l'extraction d'informations ou la fouille de textes. L'objectif de ce travail est d'évaluer divers lexiques syntaxiques par le biais de l'évaluation de l'analyseur syntaxique FRMG (de La Clergerie, 2005a ; Thomasset & Éric de La Clergerie, 2005) lorsqu'il est couplé à chacun d'entre eux. Il s'agit donc d'une évaluation orientée-tâche (task-based) de ces ressources. Nous avons évalué le Le fff dans sa version 3.0 (Sagot, 2010), ainsi que trois ressources obtenues en remplaçant (presque) toutes les entrées verbales du Lefff par d'autres ressources, à savoir successivement le lexique LGLex (Tolone, 2011) construit à partir des tables du Lexique-Grammaire du français, le lexique DICOVALENCE (van den Eynde & Mertens, 2006), ainsi qu'une nouvelle version des entrées verbales du Lefff obtenues à partir de sa fusion avec DICOVALENCE et d'un travail de validation manuelle. Pour cela, tous ces lexiques ont été convertis au format du Le fff, le format Alexina. L'évaluation a été faite sur la partie du corpus EASy utilisé lors de la première campagne d'évaluation Passage (Hamon et al., 2008). Nous commençons par détailler ces quatre ressources lexicales, qu'il s'agisse de lexiques déjà existants (le Lefff, LGLex ou DICOVALENCE) ou de la nouvelle version du Lefff (section 2.2). Nous présenterons ensuite l'analyseur FRMG et la campagne d'évaluation Passage à la section 3, avant de détailler les résultats obtenus par FRMG lorsqu'on lui fait rejouer cette campagne en le couplant successivement avec les quatre lexiques décrits à la section 4. Nous montrons en particulier que pour l'instant, c'est encore la version standard du Lefff qui donne les meilleurs résultats. Enfin, nous discutons à la section 5 de la fouille d'erreurs réalisée sur les sorties produites afin d'identifier les entrées lexicales verbales susceptibles d'expliquer la baisse de précision obtenue par les autres ressources par rapport au Lefff, puis nous concluons à la section 6. 2. Les ressources lexicales 2.1. Lefff, LGLex et DICOVALENCE Nous avons utilisé les données lexicales issues de trois ressources électroniques librement disponibles : - Lefff (Lexique des formes fléchies du français) 1 : Ce lexique est une ressource morphologique et syntaxique à large couverture du français, qui couvre l'ensemble des catégories (Sagot, 2010). Le Lefff, développé dans le formalisme lexical Alexina, est orienté vers une utilisation dans des outils de traitement automatique, mais cherche à préserver une pertinence linguistique. Il est ainsi utilisé par exemple dans des analyseurs à grande échelle pour différents formalismes (LFG, LTAG, et d'autres). Des travaux récents en ont amélioré la qualité et la couverture pour certaines classes d'entrées (constructions impersonnelles, constructions pronominales, adverbes en -ment, verbes en -iser et -ifier), notamment par comparaison et fusion avec d'autres ressources lexicales comme DICOVALENCE et les tables du Lexique-Grammaire (Sagot & Danlos, 2007 ; Sagot & Fort, 2007 ; Danlos & Sagot, 2008 ; Sagot & Fort, 2009). - LGLex2 : Ce lexique syntaxique a été construit à partir des tables du Lexique-Grammaire du français en un format textuel et XML (Constant & Tolone, 2010), après un travail de mise en cohérence et d'explicitation des propriétés syntaxiques dans les tables du Lexique- Grammaire (Tolone, 2011). Grâce à une définition formelle ou à une interprétation dynamique de toutes les constructions, la version texte du lexique LGLex a ensuite été convertie au format Alexina (Tolone & Sagot, 2011). Cela a pu être fait pour l'ensemble des verbes (issus des 67 tables regroupant 13 867 entrées, dont 5 738 entrées distinctes) et des noms prédicatifs (issus des 78 tables regroupant 12 696 entrées, dont 8 531 entrées distinctes). - DICOVALENCE3 : Le dictionnaire de valence verbale DICOVALENCE (van den Eynde & Mertens, 2006) est une ressource informatique qui répertorie les cadres de valence de plus de 3 700 verbes simples du français, soit plus de 8 000 entrées. Le dictionnaire explicite en outre certaines restrictions sélectionnelles, certaines formes de réalisation (pronominales, phrastiques) des termes, la possibilité d'employer le cadre valenciel dans différents types de passif, etc. La particularité essentielle du dictionnaire réside dans le fait que les informations valencielles sont représentées selon les principes de « l'Approche Pronominale » en syntaxe (Blanche-Benveniste et al., 1984). Pour chaque place de valence (appelée paradigme) le dictionnaire précise le paradigme de pronoms qui y est associé et qui couvre en intention les lexicalisations possibles. Il précise aussi les reformulations possibles, comme le passif. 2.2. Construction d'une nouvelle version des entrées verbales du Le fff par fusion avec DICOVALENCE et validation manuelle Bien que le principe général sous-tendant les entrées lexicales du Le fff soit que chaque sens distinct d'un même lemme doive correspondre à une entrée distincte, ce principe n'est respecté que très partiellement dans la version actuelle de la ressource. C'est pourtant une nécessité pour améliorer la qualité du Lefff comme ressource descriptive, pour permettre la prise en compte d'informations telles que les restrictions de sélection pendant ou après l'analyse syntaxique, pour coupler à terme le Le fff avec des ressources lexicales sémantiques, et plus 1Distribution de la version 3.0 en ligne sous licence LGPL-LR à l'adresse http://gforge.inria.fr/projects/alexina/ 2Distribution de la version 3.3 en ligne sous licence LGPL-LR à l'adresse http://infolingu.univ-mlv.fr, Données Linguistiques > Lexique-Grammaire > Téléchargement 3Distribution de la version 2 en ligne sous licence LGPL-LR à l'adresse http://bach.arts.kuleuven.be/dicovalence/ généralement pour envisager l'utilisation du Lefff en analyse sémantique. Nous avons effectué un premier travail dans cette direction, en cherchant à intégrer DICOVALENCE au sein du Le fff. En effet, DICOVALENCE distingue quant à lui les différents sens d'un même lemme verbal en plusieurs entrées. Pour cela, nous avons mis en oeuvre la méthodologie décrite dans (Sagot & Danlos, 2008). Ainsi, nous avons tout d'abord converti DICOVALENCE au format Alexina, améliorant pour ce faire l'outil de conversion utilisé précédemment (Danlos & Sagot, 2008). La fusion du résultat de cette conversion avec le Lefff a été réalisée de la même façon que dans (Danlos & Sagot, 2008), en préservant toutes les informations issues des deux ressources (exemples, etc.). La difficulté est qu'il est fréquent qu'un lemme verbal donné ait plusieurs entrées dans DICOVALENCE et plusieurs dans le Lefff, ce qui rend délicate la mise en correspondance de chaque entrée de l'un avec zéro, une ou plusieurs entrées de l'autre. Nous avons donc appliqué les heuristiques décrites dans (Danlos & Sagot, 2008), qui permettent la mise en correspondance de deux entrées si les inventaires de fonctions syntaxiques de base (sujet, objets direct et indirects) sont identiques, et si l'inventaire de fonctions syntaxiques obliques (locatif, délocatif, etc.) dans l'entrée du Lefff est inclus dans celui issu de DICOVALENCE. Pour chaque lemme, on obtient ainsi au moins autant d'entrées que dans le lexique qui en contient le moins, et au plus la somme des nombres d'entrées dans chaque lexique, lorsqu'aucune mise en correspondance n'a fonctionné. Pour bénéficier au mieux de la bonne qualité générale des informations syntaxiques présentes dans DICOVALENCE, nous avons décidé de réaliser une validation manuelle partielle mais significative du résultat de la fusion. Ainsi, nous avons validé manuellement toutes les entrées correspondant à des lemmes telles que le nombre d'entrées dans le lexique fusionné était strictement supérieur au maximum du nombre d'entrées entre les deux ressources. Une telle situation signifie en effet qu'au moins une entrée du Le fff n'a pu être mise en correspondance avec une entrée de DICOVALENCE, et inversement, ce qui fait soupçonner que la fusion s'est passée de façon incorrecte en raison d'erreurs dans l'un ou l'autre des lexiques, ou en raison de différences d'analyse (un objet indirect en de pour une ressource pouvant être un délocatif pour une autre, par exemple). Nous avons ainsi validé, corrigé voire fusionné manuellement toutes les entrées pour 505 lemmes verbaux, produisant ainsi 986 entrées. Par ailleurs, nous avons extrait du corpus de l'Est Républicain une table de fréquence des formes fléchies, qui nous a permis de dresser une liste des 100 lemmes verbaux les plus fréquents du français. Nous avons validé, corrigé, fusionné et complété manuellement toutes les entrées correspondant à ces lemmes verbaux dans le lexique fusionné. Le résultat de ce travail est un lexique morphologique, syntaxique et sémantique composé de 12 613 entrées couvrant 7 933 lemmes verbaux distincts. 3. L'analyseur syntaxique FRMG et la campagne d'évaluation Passage FRMG (FRench MetaGrammar) (de La Clergerie, 2005a ; Thomasset & Éric de La Clergerie, 2005) est un analyseur syntaxique profond à large couverture pour le français. Une description grammaticale de haut niveau sous forme de méta-grammaire sert de point de départ pour la génération d'une grammaire d'arbres adjoints (TAG, Tree Adjoining Grammar) (Joshi et al., 1975). Cette grammaire est transformée par le système DyALog (de La Clergerie, 2005b ; de La Clergerie, 2002) en un analyseur syntaxique. L'analyseur syntaxique FRMG découlant des phases de compilation de la métagrammaire FRMG ne peut bien sûr fonctionner seul. Il s'intègre dans une chaîne complète de traitement comprenant, en amont, le lexique syntaxique Lefff et les nombreux modules de SXPipe (Sagot & Boullier, 2008) en charge de la segmentation, de la correction orthographique et de la détection des entités nommées. Pour une phrase donnée, FRMG retourne l'ensemble des analyses complètes sous forme de forêt. En cas d'échec pour une analyse complète, l'analyseur retourne un ensemble d'analyses partielles couvrant au mieux la phrase. Enfin, sous la contrainte d'un temps limite (timeout), si l'analyseur n'a pu conclure l'ensemble des analyses, il retourne celles déjà disponibles (mode just-in-time). En pratique, très peu de phrases (moins de 1%) se retrouvent sans aucune analyse (complète ou partielle). Ensuite, la forêt d'analyse peut être convertie sous forme d'une forêt de dépendances et également désambiguïsée, en utilisant un ensemble de règles heuristiques très peu lexicalisées. On obtient ainsi une unique analyse par dépendance qui peut ensuite être convertie dans le format Passage, utilisé dans le cadre des campagnes d'évaluation Passage. On peut voir par exemple à la figure 1 la sortie au format Passage de la phrase Depuis quelques semaines, les rapports entre les deux camps se dégradent. Figure 1. Exemple de sortie au format Passage Précisons que FRMG est un logiciel libre accessible sous la GForge de l'INRIA 4. Il est également possible de jouer avec la chaîne de traitement et de visualiser la grammaire FRMG sur http://alpage.inria.fr/frmgdemo. La campagne d'évaluation Passage (2007-2009)5 (Hamon et al., 2008) soutenue par l'ANR a pour objectif d'évaluer les analyseurs du français, d'améliorer l'exactitude et la robustesse des analyseurs du français sur des corpus à grande échelle (100 millions de mots) ; et d'exploiter les annotations syntaxiques résultantes pour créer une ressource linguistique plus riche et plus étendue : un treebank pour le français. Six types de constituants ont été choisis pour cette campagne : groupe nominal, (GN), noyau verbal (NV), groupe adjectival (GA), groupe adverbial (GR), groupe prépositionnel (GP) et groupe prépositionnel à noyau verbal (PV). Les relations (dépendances entre mots pleins) à relever sont les suivantes : dépendance sujet-verbe (SUJ-V), dépendance auxiliaire-verbe (AUX-V), objet direct (COD-V), autre complément du verbe (CPL-V), modifieur du verbe (MOD-V), subordonnée (COMP), attribut du sujet ou de l'objet (ATB-SO), modifieur du nom (MOD-N), modifieur de l'adjectif (MOD- A), modifieur de l'adverbe (MOD-R), modifieur de la préposition (MOD-P), coordination (COORD), apposition (APPOS) et juxtaposition (JUXT). Le guide d'annotation utilisé lors de la campagne Passage est le guide des annotations syntaxiques de référence PEAS6. Les métriques d'évaluation utilisées sont celles définies à l'occasion de la campagne EASy : la précision, le rappel et la f-mesure, avec différents modes de relâchement de contrainte sur la mesure des frontières de constituants (Paroubek et al., 2005). Pour la première campagne de Passage de 2007, la référence utilisée est un extrait d'environ un million de mots du corpus EASy (Paroubek et al., 2005), de styles variés 4http://gforge.inria.fr/projects/mgkit/ 5http://atoll.inria.fr/passage/index.fr.html 6Disponible sur le site http://www.limsi.fr/Individu/anne/Guide/PEAS_reference_annotations_v2.2.html (journalistique, médical, oral, questions, littéraire, etc.), dont 4 306 phrases constituaient déjà la référence de la campagne EASy en 2004 et 400 nouvelles phrases ont été annotées manuellement depuis. Pour pouvoir tenir compte des noms prédicatifs du lexique LGLex, il a fallu modifier la méta-grammaire en faisant l'approximation suivante : n'importe quel déterminant peut venir de manière optionnelle devant un nom prédicatif. 4. Résultats On peut voir les résultats des différents lexiques sur le corpus EASy dans le tableau 1. Lexique Couverture (#phrases) Lefff 3 555 Nouveau Lefff 3 495 LGLex 3 437 DICOVALENCE 2 773 Couverture (%) 76.08 74.81 73.60 59.78 Constituants (%) 89.21 88.65 87.97 86.98 Relations (%) 66.36 65.41 63.03 61.91 Temps (s) 0.30 0.43 0.84 0.42 Timeout (%) 0.00 0.03 0.03 0.00 Tableau 1.Résultats comparatifs sur le corpus EASy, exprimés en terme de f-mesure Les meilleurs résultats et performances de FRMG sont obtenus avec la version standard du Lefff (version 3). Ceci peut s'expliquer par le fait que les deux ressources ont été développées ensemble depuis longtemps. En comparaison, les résultats sont finalement assez proches pour les autres ressources. Les temps d'analyse sont plus importants pour LGLex (avec en conséquence plus de phrases échouant pour cause de timeout) : ceci provient du grand nombre d'entrées par verbe dans LGLex. À titre de comparaison, les lemmes verbaux les plus ambigus dans le Le fff sont tenir et (re)faire (6 entrées), alors que dans le lexique LGLex il s'agit des lemmes tenir (53 entrées), jouer (44 entrées) et prendre (35 entrées). De plus, LGLex contient un grand nombre de noms prédicatifs liés à des verbes support. DICOVALENCE a un faible taux de couverture (relativement aux autres lexiques) mais des f-mesures qui sont finalement bonnes : ceci confirme la pertinence de l'approche suivie par les développeurs de cette ressource, qui se sont concentrés sur les emplois fréquents des lemmes les plus fréquents. Nous présentons les résultats pour quelques relations verbales dans le tableau 2. SUJ-V (%) AUX-V (%) COD-V (%) CPL-V (%) ATB-SO (%) Lexique Lefff 66.46 62.40 72.48 91.55 79.29 Nouveau Lefff 78.76 91.15 72.18 62.59 59.45 LGLex 45.79 59.47 66.46 89.28 77.78 DICOVALENCE 76.12 86.74 65.49 61.62 8.65 Tableau 2. Résultats comparatifs pour quelques relations verbales (f-mesures) DICOVALENCE semble avoir des problèmes sur certains verbes très fréquents, en particulier sur le verbe être, comme le montre la très faible f-mesure pour la relation ATB-SO (8.65% contre 66.46% pour Lefff, cf. tableau 2) et comme également mis en évidence par la fouille d'erreurs. 5. Fouille d'erreurs La fouille d'erreurs sur les verbes reprend les principes de fouilles d'erreurs présentés dans (Sagot & Villemonte de La Clergerie, 2006), tout en l'adaptant. En effet, dans ce travail, l'objectif était en première approximation d'identifier les formes dont la présence dans une phrase tend à rendre la phrase inanalysable7. Dans le présent article, cet objectif est adaptée afin d'identifier les entrées d'un lexique hyp qui semblent dégrader les performances de FRMG comparativement à un lexique de référence ref, ici le Lefff : l'idée est de trouver les formes, et plus précisément les formes verbales, dont la présence dans une phrase analysable avec le lexique de référence ref tend à rendre cette phrase inanalysable avec le lexique hyp. Le corpus EASy est trop petit pour obtenir des statistiques suffisantes pour un diagnostic complet des ressources. Mais l'algorithme ne nécessitant pas de disposer d'un corpus de référence (seule l'analysabilité, c'est-à-dire la couverture, étant exploitée), nous avons pu ajouter au corpus EASy environ 100K phrases avec AFP, Europar, Wikipedia et Wikisources, ce qui constitue le CPJ (Corpus Passage Jouet). Nous avons regardé en détail les 15 premiers suspects dans LGLex afin de déterminer d’où proviennent les erreurs (entre parenthèses est indiqué le nombre de phrases contenant ce verbe qui n’ont pas pu être analysées, sachant que seule une phrase est donnée par verbe à titre d’exemple, mais qu'au total 212 phrases sont concernées pour cet échantillon) : - Certaines entrées ne figurent pas dans les tables : c'est le cas de réaffirmer (28), de réélire (10), de la forme pronominale se réimplanter (5), mais également de mixer (7) dans la phrase Mixé par Jimi Hazel , assisté de Bruce Calder , enregistré chez Jimi à l’ « Electric Lady Studios » à New York puisque cette entrée est codée dans la table 36S avec un sens différent (Max mixe les carottes (et+avec) les navets dans un mixeur). - Certaines entrées figurent dans les tables mais ne sont pas codées (codage ~) : c'est le cas de susciter (41) qui n’est codée dans aucune des deux tables dans laquelle elle est présente (36DT et 38R), recruter (14) qui figure dans la table 38R sans être codée (ce qui implique qu’à part la construction de base N0 V N1 Prép N2, aucune autre construction n’est codée), délocaliser (9) qui figure dans la table 38L sans être codée (sa construction de base est N0 V N1 Loc N2 source Loc N3 destination, les effacements de certains compléments pouvant être codés dans la table), et zapper (4) qui figure dans la table 35L sans être codée (sa construction de base est N0 V Loc N1 source Loc N2 destination, elle ne peut donc pas être reconnue dans la phrase Elle a également " déploré " la mémoire de " plus en plus sélective " de la jeune femme , " qui zappe les détails qui font désordre "). - D’autres sont codées dans les tables mais avec des compléments obligatoires qui ne sont pas présents dans les phrases du corpus : - kidnapper (12) et revendre (5) dans des phrases sans deuxième complément, telles que Les deux Italiens ont été kidnappés le 18 décembre et dans Charles mangeait l’avoine des chevaux , doublant les fournitures , revendant par une porte de derrière ce qui entrait par la grande porte : ces deux entrées sont codées dans la table 36DT, elles acceptent comme construction de base N0 V N1 Prép N2, sans effacement possible du deuxième complément introduit par la préposition à (c'est le cas de toutes les entrées de cette table) ; 7Une forme suspecte doit aussi avoir tendance à apparaître seule dans de telles phrases ou en cooccurrence avec des formes qui ne sont pas (trop) suspectes à l'échelle du corpus entier. On trouvera le détail du modèle sous- jacent dans (Sagot & Villemonte de La Clergerie, 2006) ; il s'exprime sous forme d'une paire d'équations mutuellement récursives reflétant le niveau local des phrases et le niveau global du corpus. L'algorithme de résolution est un algorithme de point fixe. - écrouer (5) dans la phrase Le lycéen de 18 ans soupçonné d’avoir poignardé vendredi un camarade , Hakim , dans leur lycée du Kremlin-Bicêtre \( Val-de-Marne \) , a été mis en examen et écroué hier , alors que lycées et collèges sont invités à observer une minute de silence aujourd’hui à la mémoire de la victime : cette entrée est codée dans la table 38LHD avec la construction N0 V N1 Loc N2 destination ; - réprouver (11) dans la phrase Dieu ne réprouve donc personne : cette entrée est codée dans la table 12 avec la construction N0 V N1 de N2. - Enfin, certains cas spécifiques : rediriger (50) dans des phrases erronées, telles que deux cent cinquante-troisredirige ici, consoler (6) dans des phrases avec pronominalisation de l’objet, telles que Elle essayait de le consoler (l'entrée est codée dans les tables 13 et 32R1 avec la construction N0 V N1 acceptée, mais sans qu’aucune ne code la possibilité de pronominaliser le premier complément), et camper (5) dans Les troupes campent entre Harlem et Nimègue (l'entrée devrait être reconnue car elle accepte la construction N1 V). Si l'on se penche à présent sur les 5 premiers verbes les plus suspects dans les 9 phrases suivantes qui n'ont pas été analysées avec le nouveau Le fff, l'origine de l'erreur est plus difficile à déterminer et ne semble pas toujours liée au nouveau Le fff. Il se peut, dans certains cas, que le succès de l'analyse avec le Le fff standard soit plutôt le résultat d'une surgénération : - tomber employé dans une phrase complexe avec partie du corps : cette lourde pensée lui tombe sur le coeur ; - tomber et dominer employés dans une construction avec laisser, qui semble mal gérée : Reprit M Levrault en se laissant tomber dans un fauteuil ; moi je dis qu' il faut pas laisser JS tomber comme ça ; Pour quelles raisons, en temps de guerre, un très grand nombre de personnes, habituellement paisibles et inoffensives, se laissent-elles dominer par la haine ; - cuisiner, approcher et orner, employés dans des phrases pour laquelle l'échec n'est pas imputable aux entrées verbales : il sait pas cuisiner ; Comme il approchait du château de ses pères ; elle a voulu à tout prix, orner sa vieille ville ; elle l' a ornée, sans proportion avec ses destinées et son avenir ; - parer, à qui il manque la redistribution passive : Partout, sur la route, les fenêtres vous regardent parées de fleurs et de verdure. 6. Conclusion Convertir un lexique au format Lefff permet de l'utiliser à peu près immédiatement avec FRMG. Pour un lexique de bonne qualité comme DICOVALENCE ou les tables du Lexique- Grammaire, les résultats obtenus sont bons. En effet, une f-mesures pour les relations au dessus de 60% est meilleure que les résultats de FRMG avec le Le fff lors de la campagne de 2007 (59,65% de f-mesure pour 56% de couverture). Néanmoins, les derniers points de f- mesure découle d'une adaptation plus fine entre la grammaire et le lexique, et de la recherche des erreurs ou incomplétudes lexicales. Il est en effet normal que tout lexique possède des entrées erronées qu'il est difficile de trouver. Les techniques de fouille d'erreurs permettant de comparer (dans un sens ou l'autre) les verbes de deux lexiques sont un moyen de repérer plus rapidement ces entrées. À terme, ce travail doit aussi renforcer la fusion de diverses ressources lexicales en une seule ressource de très grande qualité. Néanmoins, les choix linguistiques derrière chaque ressource ont un impact : ainsi, le Lefff standard (version 3) fournit des entrées verbales plutôt factorisées (peu de distinctions sémantiques, cadres de sous-catégorisation factorisés) alors que LGLex liste de nombreuses entrées par verbes correspondant à divers sens et associées à des cadres de sous-catégorisation plus simple mais se chevauchant. Références Blanche-Benveniste C., Delofeu J., Stefanini J. & Eynde K. v. d. 1984. Pronom et syntaxe. L’approche pronominale et son application au français. Paris : SELAF. Constant M. & Tolone E. 2010. A generic tool to generate a lexicon for NLP from Lexicon-Grammar tables. In M. D. Gioia, Ed., Actes du 27e Colloque international sur le lexique et la grammaire (L’Aquila, 10-13 septembre 2008), Seconde partie, volume 1 of Lingue d’Europa e del Mediterraneo, Grammatica comparata , p. 79–193. Rome, Italie : Aracne. Danlos L. & Sagot B. 2008. Constructions pronominales dans DICOVALENCE et le Lexique-Grammaire : Intégration dans le Lefff. In Actes du 27ème Colloque Lexique et Grammaire, L’Aquila, Italie. de La Clergerie E. 2002. Construire des analyseurs avec DyALog. In Actes de la Conférence sur le Traitement Automatique des Langues Naturelles (TALN’02), Nancy, France. de La Clergerie E. 2005a. From metagrammars to factorized TAG/TIG parsers. In Proceedings of IWPT’05 (poster), p. 190–191, Vancouver, Canada. de La Clergerie É. 2005b. DyALog : a tabular logic programming based environment for NLP. In Proceedings of 2nd International Workshop on Constraint Solving and Language Processing (CSLP’05) , Barcelone, Espagne. Hamon O., Mostefa D., Ayache C., Paroubek P., Vilnat A. & de La Clergerie E. 2008. Passage : from French parser evaluation to large sized treebank. In Proceedings of the 6th Language Resource and Evaluation Conference (LREC’08), Marrakech, Maroc. Joshi A. K., Levy L. & Takahashi M. 1975. Tree Adjunct Grammars. Journal of Computer and System Science 10, 10(1), 136–163. Paroubek P., Pouillot L.-G., Robba I. & Vilnat A. 2005. EASy : campagne d’évaluation des analyseurs syntaxiques. In Actes de l’atelier EASy de TALN’05, Dourdan, France. Sagot B. 2010. The Lefff, a freely available and large-coverage morphological and syntactic lexicon for French. In Proceedings of the 7th Language Resources and Evaluation Conference (LREC’10) , La Valette, Malte. Sagot B. & Boullier P. 2008. SXPipe 2 : architecture pour le traitement présyntaxique de corpus bruts. Traitement Automatique des Langues (T.A.L.), 49(2), 155–188. Sagot B. & Danlos L. 2007. Améliorer un lexique syntaxique à l’aide des tables du Lexique-Grammaire : Constructions impersonnelles. Cahiers du Cental. Sagot B. & Danlos L. 2008. Méthodologie lexicographique de constitution d’un lexique syntaxique de référence pour le français. In Actes du colloque Lexicographie et informatique : bilan et perspectives , Nancy, France. Sagot B. & Fort K. 2007. Améliorer un lexique syntaxique à l’aide des tables du Lexique-Grammaire : adverbes en -ment. In Actes du 26ème Colloque Lexique et Grammaire (LGC’07), p. 145–152, Bonifacio, France. Sagot B. & Fort K. 2009. Description et analyse des verbes désadjectivaux et dénominaux en -ifier et -iser. Arena Romanistica, Journal of Romance Studies, 4, 102–110. Sagot B. & Villemonte de La Clergerie E. 2006. Error mining in parsing results. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics, p. 329–336, Sydney, Australia : Association for Computational Linguistics. Thomasset F. & Éric de La Clergerie 2005. Comment obtenir plus des méta-grammaires. In Proceedings of TALN’05, Dourdan, France. Tolone E. 2011. Analyse syntaxique à l’aide des tables du Lexique-Grammaire du français . Thèse de doctorat, LIGM, Université Paris-Est, France. (340 pp.). Tolone E. & Sagot B. 2011. Using Lexicon-Grammar tables for French verbs in a large-coverage parser. In Z. Vetulani, Ed., Human Language Technology, Forth Language and Technology Conference, LTC 2009, Poznań , Poland, November 2009, Revised Selected Papers , Lecture Notes in Artificial Intelligence (LNAI). Springer Verlag. À paraître. van den Eynde K. & Mertens P. 2006. Le dictionnaire de valence DICOVALENCE : manuel d’utilisation. http://bach.arts.kuleuven.be/dicovalence/manuel_061117.pdf.
1710.06406
1
1710
2017-10-17T17:34:31
Laying Down the Yellow Brick Road: Development of a Wizard-of-Oz Interface for Collecting Human-Robot Dialogue
[ "cs.CL", "cs.AI", "cs.HC", "cs.RO" ]
We describe the adaptation and refinement of a graphical user interface designed to facilitate a Wizard-of-Oz (WoZ) approach to collecting human-robot dialogue data. The data collected will be used to develop a dialogue system for robot navigation. Building on an interface previously used in the development of dialogue systems for virtual agents and video playback, we add templates with open parameters which allow the wizard to quickly produce a wide variety of utterances. Our research demonstrates that this approach to data collection is viable as an intermediate step in developing a dialogue system for physical robots in remote locations from their users - a domain in which the human and robot need to regularly verify and update a shared understanding of the physical environment. We show that our WoZ interface and the fixed set of utterances and templates therein provide for a natural pace of dialogue with good coverage of the navigation domain.
cs.CL
cs
Published in the 2017 AAAI Fall Symposium on Natural Communication for Human-Robot Collaboration https://www.aaai.org/ocs/index.php/FSS/FSS17 Laying Down the Yellow Brick Road: Development of a Wizard-of-Oz Interface for Collecting Human-Robot Dialogue Claire Bonial1, Matthew Marge1, Ron Artstein2, Ashley Foots1, Felix Gervits3, Cory J. Hayes1, Cassidy Henry1, Susan G. Hill1, Anton Leuski2, Stephanie M. Lukin1, Pooja Moolchandani1, Kimberly A. Pollard1, David Traum2, and Clare R. Voss1 1U.S. Army Research Laboratory, Adelphi, MD 20783 2USC Institute for Creative Technologies, Playa Vista, CA 90094 3Tufts University, Medford, MA 02155 [email protected] 7 1 0 2 t c O 7 1 ] L C . s c [ 1 v 6 0 4 6 0 . 0 1 7 1 : v i X r a Abstract We describe the adaptation and refinement of a graphical user interface designed to facilitate a Wizard-of-Oz (WoZ) approach to collecting human-robot dialogue data. The data collected will be used to develop a dialogue system for robot navigation. Building on an interface previously used in the development of dialogue systems for virtual agents and video playback, we add templates with open parameters which al- low the wizard to quickly produce a wide variety of utter- ances. Our research demonstrates that this approach to data collection is viable as an intermediate step in developing a dialogue system for physical robots in remote locations from their users – a domain in which the human and robot need to regularly verify and update a shared understanding of the physical environment. We show that our WoZ interface and the fixed set of utterances and templates therein provide for a natural pace of dialogue with good coverage of the navigation domain. Introduction For robots to become effective teammates with humans at collaborative tasks such as search-and-rescue operations and reconnaissance, they must be able to communicate ef- fectively with humans in dynamic environments. Ideally, these robot collaborators could engage in two-way spoken dialogue, which is both natural for humans and efficient for exchanging information about tasking, goals, situational awareness, and status updates. To develop a robot's dialogue capabilities, we need data on how people might talk to that robot. We collect these data through the Wizard-of-Oz (WoZ) methodology (Dahlbäck, Jönsson, and Ahrenberg 1993), used in virtual human dia- logue systems to refine and evaluate the domain and provide training data for automated natural language understanding (Traum et al. 2005; DeVault et al. 2014). A critical research question is whether or not this virtual-agent approach can be extended to and effective for the physically grounded, sit- uated language needed for communication with a robot in a collaborative task, especially if the human and robot are not co-present. Thus far, our results support the viability of this approach for our scenario. In this paper, we describe our progress, with particular attention paid to the adaptation and refinement of the wizard user interface for the research phase of collecting dialogues for training data. The importance of the interface is twofold. First, it eases the physical and cognitive overhead of the wizard (com- pared to manual typing). Second, decisions on the commu- nications built into the interface represent a critical research step: mapping the unconstrained language of a naïve partic- ipant into a set of communication intents that can be under- stood and acted upon by a dialogue system. The mappings, as collected in experiments, then serve to train an automated dialogue system. The interface limits communications to a fixed set, yet it must provide adequate coverage for commu- nicating about the tasks, environment, and overcoming mis- communication. Our results show that: (i) the interface facil- itates a faster pace of communication that approaches more natural dialogue exchanges and (ii) the set of utterances and templates it contains provides good coverage of the domain. Related Work The WoZ method involves one or more human "wizards" standing in as AI modules, performing functions that will eventually be performed by a final automated system. This behind-the-scenes human activity is unknown to the re- search participants (so long as the WoZ illusion is success- ful). The WoZ methodology is useful due to its low devel- opment cost when technology to support the desired func- tionality does not yet exist. In the human-robot interaction domain, natural language interpretation is one of the most common use cases for WoZ (Riek 2012). It has tradition- ally been used as a surrogate for automatic speech recog- nition (Zollo 1999; Skantze 2003), and to train a dialogue system by progressively adding automation over several de- velopment stages (Passonneau et al. 2011). Our setup relies on two wizards, one for dialogue manage- ment and one for robot navigation, as a result of prior pilot trials when a single wizard struggled to perform both func- tions (Cassidy, Voss, and Summers-Stay 2015). This setup is similar to the SimSensei project (DeVault et al. 2014), where during the data collection phase, two wizards stood in for what would ultimately be separate software compo- nents (i.e., verbal and non-verbal behaviors of the virtual agent). Green et al. (2004) investigated the use of multiple wizards for dialogue processing and navigation capabilities for a robot in a home touring scenario. This work found the multi-wizard approach to be valid in situations where the robot and human were co-present. We expand on this method by addressing remote (not co-present) human-robot communication. Other research focused on developing an adaptable WoZ interface like our interface includes the SUEDE tool (Klem- mer et al. 2000) and DOMER interface (Villano et al. 2011), both of which use a similar development strategy to ours, with iterative expansion and refinement of the responses to be included in the interface. Background & Approach The long-term vision of our work is to provide more natural ways for humans to interact with robots in shared tasks. The WoZ methodology facilitates a data-driven understanding of how people talk to robots in our collaborative domain. Sim- ilar to DeVault et al. (2014), we use the WoZ methodology only in the early stages of a multi-stage development pro- cess in order to refine and evaluate the domain and provide training data for automated dialogue system components. In all stages of this process, participants speak freely, even as increasing levels of automation are introduced in each sub- sequent stage or "experiment," using data from previous ex- periments. The first two experiments on the path to increased au- tomation use two wizards: a Dialogue Manager Wizard (DM-Wizard) who sends text messages and a Robot Nav- igator Wizard (RN-Wizard) who teleoperates the robot. A naïve participant is tasked with instructing a robot to nav- igate through a remote, unfamiliar house-like environment. The participant is seated at a workstation equipped with a microphone and a desktop computer displaying information collected by the robot: a map of the robot's position and its heading in the form of a 2D occupancy grid, the last still- image captured by the robot's front-facing camera, and a chat window showing text responses from "the robot." This layout is shown in the top, right-hand corner of Figure 1, which represents an overview of our WoZ setup. At the beginning of the study, the participant receives a list of robot capabilities: the robot understands basic ob- ject properties (e.g., most object labels, color, size), relative proximity, some spatial terms, and location history. Experi- menters do not give example instructions, but rather tell the participant that s/he can communicate in spoken language using natural expressions to complete tasks. In reality, the participant is speaking not to a robot, but to an unseen DM- Wizard who listens to the participant's spoken instructions and responds with text messages in a chat window. There are two high-level response options: 1) If the instructions are clear and executable in the cur- rent physical environment, then the DM-Wizard passes a simplified text version of the instructions to the RN-Wizard, who then joysticks the robot to complete the instructions. 2) If the instructions are problematic in some way, due to ambiguity or impossibility given either the current physical context or the robot's capabilities, then the DM-Wizard re- sponds directly to the participant in text via a chat window, in order to clarify the instructions and/or correct the partici- pant's understanding of the robot's capabilities. We engage each participant in three sessions: a training task and two main tasks. The two main tasks, lasting 20 Figure 1: WoZ setup (Marge et al. 2016a). minutes each, focus on slightly different search and analysis subtasks and start in distinct locations within a house-like environment. The subtasks were developed to encourage the participant to treat the robot as a teammate who helps search for certain objects, but also to encourage the participant to tap into their own real-world knowledge to analyze the en- vironment. An example search task was to locate shoes, re- lying on robot-provided images. An example analysis task was to consider whether the explored space was suitable as a headquarters-like environment. The human-robot communication data collected in Ex- periments (Exp) 1 and 2 allow us to incrementally build a fully automated dialogue system on-board a physical robot. In Exp 1, our goal was to elicit the full range of communi- cations that may arise in our domain. To allow for this, the DM-Wizard simply typed free responses to the participant following guidelines established during piloting that gov- erned the DM-Wizard's real-time decision-making (Marge et al. 2016a). The guidelines identified the minimal require- ments for an executable instruction: each must contain both a clear action and respective endpoint. The guidelines also provided response categories and templates, giving the DM- Wizard easily-remembered templates for elements of each response, but also flexibility in exact word choice. Data from ten participants was collected in Exp 1. The Exp 1 data was then analyzed to develop a set of communications to design into an interface for Exp 2, where messages sent via that interface would strike a balance be- tween tractability for an automatic system and full cover- age of the domain, including recovering from problematic instructions. With the interface, instead of typing free re- sponses, the DM-Wizard constructs a response by selecting buttons on a graphical user interface (GUI), where each but- ton press sends a text message either to the participant or the RN-Wizard. Aside from the DM-Wizard communicating via the interface, Exp 2 was conducted just like Exp 1. Ten new participants took part in Exp 2. APPROVED FOR PUBLIC RELEASE(cid:38)(cid:82)(cid:80)(cid:80)(cid:68)(cid:81)(cid:71)(cid:72)(cid:85)ParticipantVIEWS"Behind the scenes"RN MOVESROBOTDM-WIZARDRobot NavigatorVERBALCOMMANDS Before delving into the development of this interface that preceded running Exp 2, we should note that we have al- ready completed Exp 2 and used the collected data to train a classifier that automatically generates responses to partic- ular participant instructions. As a result, it is quite clear that additional training data is needed for a robust classifier and so in the planned Exp 3, we are simulating both the physical environment and the robot (Henry et al. 2017). The simula- tion will allow us to reduce the time and space overhead oth- erwise needed for performing this experiment using a phys- ical robot in a real environment; therefore speeding up the collection of training data. As we collect adequate levels of training data, in future experiments we will begin to auto- mate away individual components, currently using wizard stand-ins. For further discussion of this development pro- cess, see Ongoing & Future Work. Interface Development The DM-Wizard interface, which is the key change in the setup between Exps 1 and 2, sends a text response to ei- ther the participant or the RN-Wizard. The critical research challenge in developing this interface has been to capture the sum total of possible responses "the robot" can give to the RN-Wizard and participant, whose language is totally unconstrained and can vary widely. Thus, the quality of the trained model is contingent upon the GUI design decisions. However, the goal of domain coverage had to be balanced with the need to create an interface that was organized such that the wizard could easily and quickly find the appropriate button – presenting another development challenge. Software Overview The interface software was adapted from a design used for WoZ prototyping of a dialogue system in which humans can engage in time-offset interaction with a WWII Holocaust survivor (Artstein et al. 2015). In that application, people could ask a question of the system, and a pre-recorded video of the Holocaust survivor would be presented, answering the question. The interface is implemented as a web applica- tion that presents a collection of clickable buttons in a web browser window. In our study, the DM-Wizard uses the in- terface buttons to trigger a text response to be sent to the appropriate chat window in either the participant's screen or the RN-Wizard's screen. The system uses the VHMsg mes- saging protocol (Hartholt et al. 2013) built on top of the ActiveMQ message broker.1 The rest of the system com- ponents, including tools for logging, data visualization, and robot operation, interact via ROS (Robot Operating Sys- tem).2 We also implemented a software bridge that connects to VHMsg and the ROS message server and maps VHMsg messages onto ROS messages and vice versa automatically. There are a large number of responses, and therefore but- tons, needed in the interface to provide coverage for all of the participant instructions that must be passed to the RN- Wizard, and for all of the possible responses needed to clar- ify or acknowledge instructions. To organize the large num- 1http://activemq.apache.org 2http://www.ros.org Figure 2: DM-Wizard interface with Wiz-RN tab displayed: red buttons pass messages to RN-Wizard, blue to participant; all caps words indicate text-input slots labeled by input type. ber of buttons (that do not fit in a single screen), there are tabs to switch between five screens, which present themat- ically related buttons. Within each screen, there are labeled rows of buttons, which represent subthemes. As needed, a very frequently used button (e.g., "done") may appear in more than one location to speed up the DM-Wizard's ability to find it. Color-coding and a short label on the button aid in quick identification, and the full content of the message associated with a button can be viewed by hovering over it. A snippet of the interface is shown in Figure 2. The initial WoZ design assumed that the message tem- plates are static and can be fully configured before running the system. In our preliminary analysis, we observed that a significant proportion of DM-Wizard messages fell into well-defined patterns or templates, e.g., "I see a door on the left," "I see a door on the right," "I see a wall," etc. In such cases, we observed that it would be difficult to enumerate all but the most frequently occurring objects in the scenario. Thus, we extended the WoZ interface to allow the DM- Wizard to modify the message content on the fly. Specifi- cally, a button message text may now include a text-input slot. When the DM-Wizard clicks on such a button, a pop- up window appears with a text-input field, e.g., "I see ___." The DM-Wizard types the object description and sends the newly completed message to its recipient. Note that there is no entirely open response button, all buttons reflect, at a min- imum, an observed template of responses like "I see ___". Other text-input slots are shown in all caps in Figure 2. We used an iterative approach to develop the final in- terface. This was carried out by testing it in practice runs in which we replayed audio from Exp 1, followed by a round of real-time Exp 2 pre-piloting. The refinements can be broadly categorized into changes that affected the content of the interface (i.e. the messages associated with buttons) and changes in the layout of the buttons. Content The finite set of options included in the DM-Wizard in- terface were carefully selected to strike a balance between providing enough expressive options for the DM-Wizard to pass along executable instructions and overcome commu- nication problems, and limiting the options to a set that is tractable for automation. Although the WoZ methodology using a fixed set of messages has been shown to be effec- tive for communication with virtual agents, the adaptation of this approach to human-robot dialogue explored a new research question: whether this approach is viable for situ- ated language, where a shared understanding of the physical environment, including objects, locations, paths and orienta- tions, is needed, particularly when the human and robot are not co-present. Initial Content – To gain a preliminary understanding of the messages needed in the interface, we undertook thorough analysis and annotation of the Exp 1 data, in which the DM- Wizard had typed relatively free responses to the participant. The DM-Wizard responses were categorized first according to their recipient (either the participant or the RN-Wizard), and then by their function (e.g., feedback, clarify-distance, describe-capability) (Marge et al. 2016b). These annotations were used to create the first version of the interface, in which an effort was made to ensure that each DM-Wizard message occurring 2 or more times in Exp 1 was captured in the inter- face. For communications that occurred very frequently, al- ternatives were added with slightly different lexical choices. These can be alternated as needed to reduce the potentially unnatural, repetitive feel of the robot's communications. Metric References – While adding the appropriate but- ton was straightforward for many of the common messages sent to the participant (e.g., "I'm not sure which object you are referring to," "Executing," "Done"), this process was not as straightforward for instruction messages sent to the RN- Wizard, which regularly drew upon the physically grounded, situated nature of the language in this domain. Common in- structions include asking the robot to move forward a partic- ular number of feet, rotate left or right a particular number of degrees, and moving to an object or landmark in the physical surroundings (Marge et al. 2017). Despite these commonal- ities, providing coverage for these instructions in the inter- face was challenging given that the specific number of feet (or another unit of measurement) and degrees would vary. In lieu of including a button for every possible unit of move- ment, we took advantage of the interface capability for but- tons with text-input fields, which allow the DM-Wizard to type in the specific number of feet or degrees requested. Be- cause use of this type of button is more time-consuming, very common measurements found in the instructions were given their own, dedicated button (e.g., "turn left 90 de- grees," "move forward two feet"). Nonetheless, having some flexibility in certain common instructions allows for the gen- eralization needed to avoid an over-proliferation of buttons that would be unmanageable for the DM-Wizard. Location & Object References – Although it was also possible to use buttons with text-input fields to cite specific objects and landmarks used in instructions, we decided to create a map of our physical environment and assign unique identifiers to all spaces (i.e. rooms, hallways), objects, and doorways. We then added buttons accommodating instruc- tions to move to/through/parallel to each doorway in the environment, move to each object in the environment, and move into each specific room and hallway space in the en- vironment. Thus, for example, if a participant instructed the robot to "go ahead to the office/black/padded chair ahead," this would be translated to an RN-Wizard instruction using a specific identifier, e.g., "move to Conference Room Right Chair 1." Although this more than doubled the number of buttons in the interface, our hope was that this would make our training data more tractable for a preliminary system in which the environment is known, and particular locations and objects are assigned coordinates in that environment. To make the larger number of buttons more manageable, in- structions using unique identifiers associated with different spaces in the environment were separated out into different tabs/screens (see top row of tabs in Figure 2). Feedback Messages – In Exp 1 participants remarked on the slow pace of the experiment. Even in cases of entirely successful communications and executable instructions, the relatively slow pacing of the dialogue could lead the par- ticipant to believe that something had gone wrong. The in- troduction of an interface in Exp 2 partially addresses this problem simply because it allows the DM-Wizard to pass messages more quickly without typing. We also wanted to provide more transparency to participants as to what the robot had understood and what it was doing, ensuring they could be confident in the success of their communications. Thus, a major area of content additions to the interface were different types of feedback and back-channeling to im- prove the transparency of what the robot was doing (All- wood, Nivre, and Ahlsen 1992) and help to establish com- mon ground (Clark and Schaefer 1989). In Exp 1, the robot would often only respond with "Exe- cuting" when a set of instructions was underway and "Done" when instructions were completed. In Exp 2, the GUI al- lowed us to make this feedback much more nuanced. For clear cases of executable instructions, the DM-Wizard would immediately acknowledge that the instructions were heard and understood by responding with "ok" followed by a demonstration of that understanding in a repetition or para- phrasing of the instructions given. This repetition was either in the form of a description of what the robot was about to do, or a description of what the robot just did: "I'll move forward three feet," or "I moved forward three feet." On the other extreme, in cases where the executability of the in- structions was very uncertain and the DM-Wizard needed time to consider the surrounding physical environment, the immediate response was "Hmmm...," which could be fol- lowed either by a confirmation of the intention to complete the instructions or a description of the problem and a sugges- tion for an alternate, potentially helpful action (e.g., "There's an obstruction preventing me from doing that. Would you like me to send a picture?"). We can anecdotally report that these feedback additions seemed to help the robot to hold the floor when instructions were being completed – participants seemed less likely to assume something had gone wrong and abandon one strategy of instructions in favor of a new strat- egy (quantitative verification of this observation is under- way). Decomposing Complex Instructions – Another area of major content changes was the decomposition of complex instructions to the RN-Wizard. At this stage of our research, we have not fully fleshed out how the instructions passed to the RN-Wizard could be translated into policies executable by a robot's planning component. Nonetheless, in the devel- opment of the interface, we were forced to consider what policies might be associated with each button that passed a particular set of instructions to the RN-Wizard. For exam- ple, the interface button "Move to Kitchen Door" was orig- inally associated with a policy of (i) moving to the vicinity (within one robot's length) of the referenced door and then (ii) orienting to face the door – thus this was a "complex" instruction in the sense that it was associated with more than one move/turn action. Although we had hypothesized this sequence was what most participants would want the robot to do given this instruction, in pre-piloting we found that participants often used doorways as landmarks for moving certain distances, but they weren't always interested in the doorway itself. In these cases, they might say something like "Move parallel to the doorway ahead on the left," an action that we couldn't execute precisely since our set of instruc- tions always included a policy of both moving and orienting to face a referenced doorway. We discovered that the messages to the RN-Wizard could be much more flexible and composable if we limited the number of complex instructions (containing more than one move/turn instruction) included, and decomposed most into individual buttons/instructions associated with only one ac- tion. In the case of doorways, we opted to associate "Move to Kitchen Door" with moving into the vicinity (within one robot's length) of the referenced door only. We then added buttons for each door that accommodated instructions to move parallel to each door and turning to face each door in the environment. In general, the flexibility afforded by de- composing messages into the smallest action or intentional units led to similar decomposition in the DM-Wizard to par- ticipant communications. Layout During development, we changed the layout of the buttons and screens by shifting from a thematically related layout to one that better accommodated which buttons were often used together in a series in practice. The best example of this allowed for the DM-Wizard to quickly communicate in- structions to the RN-Wizard and corresponding feedback to the participant. In the original formulation of the interface, one screen was dedicated for communications to the partic- ipant, and a second screen for communications to the RN- Wizard. This layout forced the DM-Wizard to constantly switch screens in order to first provide instructions to the RN-Wizard and then feedback to the participant. In answer to this challenge, the screen previously dedicated to com- munications to the RN-Wizard was augmented with color- coded buttons that sent feedback to the participant. So, for example, next to the "Move forward three feet" button with instructions to the RN-Wizard, we added feedback buttons "I will move forward three feet" or "I moved forward three feet" to the participant. Examples can be seen in Figure 2, where color coding indicates the message recipient. This al- tered layout made it easier for the DM-Wizard to provide timely and specific feedback to the participant. In the future, we are considering the introduction of buttons that simulta- neously send one message to the RN-Wizard, and another corresponding feedback message to the participant. Impact of Interface The introduction of the interface in Exp 2 impacted the di- alogue data collected by limiting DM-Wizard utterances to the coverage available in the interface buttons, and by speed- ing up the pace of dialogue. Coverage In development, an effort was made to ensure that the Wiz- ard interface provided coverage for all DM-Wizard mes- sages with two or more occurrences collected in Exp 1. Out of a total of 2,728 DM-Wizard messages in Exp 1, there were 2,075 that occurred two or more times with 84 unique mes- sages covering 76% of the total. This regularity is expected, and arises in part from the nature of the domain and task, but also from the DM-Wizard being guided by the policies and templates for responses given in the Exp 1 guidelines. Of course, the singletons that we did not accommodate with a dedicated response button still require some type of re- sponse, so these were handled through one of the following strategies: 1) buttons with text-input fields accommodate less fre- quent measurements in common move or turn-type instruc- tions; 2) buttons with somewhat generalized vocabulary are available for clarifications (e.g., "the one on my left?" pro- vides coverage for a more specific response in Exp 1: "the crate on my left?"); and 3) buttons with very generic indications of the problem- atic nature of an instruction (e.g., "I'm not sure what you are asking me to do; can you describe it another way?") ac- commodate truly novel cases that may be off-topic, entirely outside of the robot's represented capabilities, or very am- biguous and/or nonsensical given the physical environment, (e.g., "rotate left 200 feet"). The final interface contained 404 buttons, organized into 5 screens, where the first two screens convey the most com- mon recipient for buttons on that page (either the partici- pant, called "Commander," or the RN-Wizard), and the last three screens contained buttons that reference different ob- jects/areas in the physical environment. After the iterations of interface refinement were com- pleted, its coverage was analyzed using string matching to compare all of the DM-Wizard messages in Exp 1 to the messages included in the finalized interface. We found that 88.7% of the messages in Exp 1 have an exact match in the interface buttons, while 10.5% have partial matches with fairly clear candidates for the best interface button, and 0.8% have no match and no clearly corresponding interface but- ton. In qualitative analysis, we see that the partial matches generally reflect cases handled with buttons with text-input fields or more general vocabulary (strategies (1) and (2) above), while the no-match cases are places where a more generic strategy of non-understanding would be used (strat- egy (3)). See Appendix for examples of parallel Exp 1 and 2 DM-Wizard responses. Speed Because of the DM-Wizard's cognitive and physical over- head, the pacing of dialogue in Exp 1 was quite slow.3 Al- though both the experimenter and "the robot" explain to the participant that "there may be lag times," the slow pacing certainly affected the participant's perception of the robot as an interlocutor. Schegloff (2007) notes that "preferred" re- sponses in dialogue tend to occur immediately after a single beat of silence that is the normal transition place from one interlocutor to another. On the other hand, a common fea- ture of "dispreferred" responses in dialogue is that they are delayed – there is a longer period of silence prior to the re- sponse. Thus, human interlocutors are tuned to understand timely feedback as an indication that everything is going well in the interaction, while silence can indicate a problem. Given these features of natural dialogue, we felt it important to speed up the pace of the interaction and avoid long si- lences where the participant was not receiving feedback as to what the robot was doing. The introduction of the interface facilitates faster responses and, since typing isn't needed, the feedback can also be longer and more specific (e.g., "Ok, I'll move forward three feet," as opposed to "Executing," in Exp 1). Currently, we are processing the data needed to examine exact differences in response times between Exps 1 and 2. However, we can gain a sense of the faster pace of dialogue in Exp 2 by examining how much the 10 participants were able to accomplish in Exp 1 compared to Exp 2. The time al- lotted (two 20-minute phases) and tasks in both experiments are the same; tasks can be broadly categorized as search and navigation tasks. Thus, most instructions are either requests for the robot to move or turn (navigation), or to send a pic- ture of the current environment to see if it includes target objects of interest (search). Anytime a move or turn action was successfully completed by the robot, completion feed- back was given (e.g., "done"). Similarly, anytime a request for a picture is fulfilled, completion feedback was given in the form of "sent." We can therefore report the number of times this type of completion feedback is given as a proxy measure for the pacing of dialogue. In Exp 1, across all 10 participants, there are 829 instances of completion feedback, indicating that 829 task-oriented actions were completed. In Exp 2, there are 1069 instances of completion feedback – indicating that participants were able to successfully com- plete more subtasks in Exp 2. Admittedly, this is a flawed measure, given that the participants may individually differ in how they approached the task and how successful they were. Nonetheless, it does reflect a trend in Exp 2 towards faster-pacing, which is closer to a natural human dialogue pace and which allows participants to complete more tasks in the allotted time. Ongoing & Future Work Creating the interface was our first step in automating the robot partner by providing a more advanced tool for the DM- Wizard's natural language generation tasks. We plan to au- tomate additional tasks, ultimately removing the wizards. Automating the Dialogue Manager – We are currently investigating use of the NPCEditor (Leuski and Traum 2011), which has been used extensively for virtual human applications (typically question-answer systems). It per- forms natural language understanding by learning a mapping between input utterances and their associated responses. In our case, the utterance-response mappings will be extracted from our experimental data. We expect the more structured language output from the GUI to simplify this process. Automating the Robot Navigator – In the current exper- iments, we rely on human intelligence to interpret high-level instructions including metric information and landmarks. While these instructions clearly specify some aspects of the endpoints, they are often underspecified in terms of the exact path to be taken and the final specific location and orienta- tion. We are designing a set of policies for a robot planner in order to interpret these high-level instructions and guide the robot to the appropriate endpoints. Since the path and final positioning derived by an automated planner might be dif- ferent from that taken by a human RN-Wizard, we may need additional feedback to and clarification from the participant. We are testing variations of the observed instructions and paths taken in order to provide a general action capability. Conclusions The progress described here demonstrates that WoZ ap- proaches taken in virtual human applications can also be successfully adapted to this new domain of human-robot di- alogue, where the interlocutors are not co-present and must rely on a shared understanding of the physical surroundings. Although we are in the early stages of our research, the implementation of a Wizard interface discussed here repre- sents an important milestone in establishing the feasibility of this approach. Our domain requires a great deal of flexibility in how "the robot" interacts with the physical en- vironment and handles various naïve participants' strategies in completing search and navigation tasks. We have shown that the interface provides coverage of the domain with a limited set of messages and templates, carefully crafted to generalize over distinct contexts. Additionally, the interface has been crucial in eliciting more natural dialogue since it allowed for faster-pacing of turns, to which humans are accustomed. Acknowledgments 3Observed DM-Wizard delays lasted well beyond 700 ms pause thresholds in spoken dialogue systems (Raux and Eskenazi 2008). This research was sponsored by the U.S. Army Research Laboratory. Appendix: Dialogue Samples The following dialogue snippets illustrate the difference between Exp. 1 "free" response mode and Exp. 2 GUI- structured Response Mode. The dialogues are between a Participant (P) and DM-Wizard (DM). Note the increased consistency of DM-Wizard responses to the open-ended in- structions "move forward" in Exp. 2. Exp. 1 Free Response Mode P move forward DM You can tell me to move to something that you see. P go forward four feet P continue to move down the hallway DM How far should I continue down the hallway? Would you like me to reach something that you see or go a certain distance? P go down the end of the hallway where it appears to be a clock on the wall Exp. 2 GUI-Structured Response Mode P robot go forward DM I'm not sure where or when to stop moving forward. You can tell me to move a certain distance or to move to an object. P robot move forward one feet P can you move forward DM I'm not sure where or when to stop moving forward. You can tell me to move a certain distance or to move to an object. P can you stop at the second door References Allwood, J.; Nivre, J.; and Ahlsen, E. 1992. On the semantics and pragmatics of linguistic feedback. Journal of Semantics 9. Artstein, R.; Leuski, A.; Maio, H.; Mor-Barak, T.; Gordon, C.; and Traum, D. R. 2015. How many utterances are needed to support time-offset interaction? In Proc. of FLAIRS. Cassidy, T.; Voss, C.; and Summers-Stay, D. 2015. Turn- Taking in Commander-Robot Navigator Dialog. In Proc. of AAAI Spring Symposium on Turn-Taking in Command-Robot Navigator Dialog. Clark, H. H., and Schaefer, E. F. 1989. Contributing to dis- course. Cognitive Science 13:259–294. Dahlbäck, N.; Jönsson, A.; and Ahrenberg, L. 1993. Wiz- ard of oz studies – why and how. Knowledge-Based Systems 6(4):258–266. DeVault, D.; Artstein, R.; Benn, G.; Dey, T.; Fast, E.; Gainer, A.; Georgila, K.; Gratch, J.; Hartholt, A.; Lhommet, M.; Lu- cas, G.; Marsella, S. C.; Fabrizio, M.; Nazarian, A.; Scherer, S.; Stratou, G.; Suri, A.; Traum, D.; Wood, R.; Xu, Y.; Rizzo, A.; and Morency, L.-P. 2014. SimSensei Kiosk: A virtual human interviewer for healthcare decision support. In Proc. of AAMAS. Green, A.; Huttenrauch, H.; and Eklundh, K. S. 2004. Apply- ing the Wizard-of-Oz framework to cooperative service dis- covery and configuration. In Proc. of ROMAN. Hartholt, A.; Traum, D.; Marsella, S. C.; Shapiro, A.; Stratou, G.; Leuski, A.; Morency, L.-P.; and Gratch, J. 2013. All to- gether now. In International Workshop on Intelligent Virtual Agents, 368–381. Springer. Henry, C.; Moolchandani, P.; Pollard, K.; Bonial, C.; Foots, A.; Hayes, C.; Artstein, R.; Voss, C.; Traum, D.; and Marge, M. 2017. Towards efficient human-robot dialogue collection: Moving fido into the virtual world. Proc. of ACL Workshop Women and Underrepresented Minorities in Natural Lan- guage Processing. Klemmer, S. R.; Sinha, A. K.; Chen, J.; Landay, J. A.; Aboobaker, N.; and Wang, A. 2000. Suede: a wizard of oz prototyping tool for speech user interfaces. In Proceedings of the 13th annual ACM symposium on User interface software and technology, 1–10. ACM. Leuski, A., and Traum, D. 2011. Npceditor: Creating virtual human dialogue using information retrieval techniques. Ai Magazine 32(2):42–56. Marge, M.; Bonial, C.; Byrne, B.; Cassidy, T.; Evans, A. W.; Hill, S. G.; and Voss, C. 2016a. Applying the Wizard-of-Oz Technique to Multimodal Human-Robot Dialogue. In Proc. of RO-MAN. Marge, M.; Bonial, C.; Pollard, K. A.; Artstein, R.; Byrne, B.; Hill, S. G.; Voss, C.; and Traum, D. 2016b. Assessing agreement in human-robot dialogue strategies: A tale of two In International Conference on Intelligent Virtual wizards. Agents, 484–488. Springer. Marge, M.; Bonial, C.; Foots, A.; Hayes, C.; Henry, C.; Pol- lard, K.; Artstein, R.; Voss, C.; and Traum, D. 2017. Explor- ing variation of natural human commands to a robot in a col- laborative navigation task. Proc. of ACL Workshop RoboNLP: Language Grounding for Robotics. Passonneau, R. J.; Epstein, S. L.; Ligorio, T.; and Gordon, J. 2011. Embedded wizardry. In Proceedings of the SIGDIAL 2011 Conference, 248–258. Association for Computational Linguistics. Raux, A., and Eskenazi, M. 2008. Optimizing endpointing thresholds using dialogue features in a spoken dialogue sys- In Proc. of 9th SIGdial Workshop on Discourse and tem. Dialogue, 1–10. Association for Computational Linguistics. Riek, L. 2012. Wizard of Oz Studies in HRI: A Systematic Review and New Reporting Guidelines. Journal of Human- Robot Interaction 1(1). Schegloff, E. A. 2007. Sequence organization in interac- tion: Volume 1: A primer in conversation analysis, volume 1. Cambridge University Press. Skantze, G. 2003. Exploring human error handling strategies: Implications for spoken dialogue systems. In ISCA Tutorial and Research Workshop on Error Handling in Spoken Dia- logue Systems. Traum, D.; Swartout, W.; Gratch, J.; Marsella, S. C.; Kenny, P. G.; Hovy, E.; Narayanan, S.; Fast, E.; Martinovski, B.; Baghat, R.; Robinson, S.; Marshall, A.; Wang, D.; Gandhe, S.; and Leuski, A. 2005. Dealing with Doctors: A Virtual Human for Non-team Interaction. In 6th SIGdial Conference on Discourse and Dialogue. Villano, M.; Crowell, C. R.; Wier, K.; Tang, K.; Thomas, B.; Shea, N.; Schmitt, L. M.; and Diehl, J. J. 2011. Domer: a wizard of oz interface for using interactive robots to scaffold social skills for children with autism spectrum disorders. In Proceedings of the 6th international conference on Human- robot interaction, 279–280. ACM. Zollo, T. 1999. A study of human dialogue strategies in In Proceedings the presence of speech recognition errors. of AAAI Fall Symposium on Psychological Models of Com- munication in Collaborative Systems, 132–139.
1907.12697
1
1907
2019-07-30T01:37:34
Dual-FOFE-net Neural Models for Entity Linking with PageRank
[ "cs.CL", "cs.IR", "cs.LG" ]
This paper presents a simple and computationally efficient approach for entity linking (EL), compared with recurrent neural networks (RNNs) or convolutional neural networks (CNNs), by making use of feedforward neural networks (FFNNs) and the recent dual fixed-size ordinally forgetting encoding (dual-FOFE) method to fully encode the sentence fragment and its left/right contexts into a fixed-size representation. Furthermore, in this work, we propose to incorporate PageRank based distillation in our candidate generation module. Our neural linking models consist of three parts: a PageRank based candidate generation module, a dual-FOFE-net neural ranking model and a simple NIL entity clustering system. Experimental results have shown that our proposed neural linking models achieved higher EL accuracy than state-of-the-art models on the TAC2016 task dataset over the baseline system, without requiring any in-house data or complicated handcrafted features. Moreover, it achieves a competitive accuracy on the TAC2017 task dataset.
cs.CL
cs
Published as a conference paper at ICANN 2019 Dual-FOFE-net Neural Models for Entity Linking with PageRank Feng Wei (), Uyen Trang Nguyen, and Hui Jiang Department of Electrical Engineering and Computer Science, York University, 4700 Keele St, Toronto, ON M3J 1P3, Canada {fwei,utn,hj}@cse.yorku.ca Abstract. This paper presents a simple and computationally efficient approach for entity linking (EL), compared with recurrent neural net- works (RNNs) or convolutional neural networks (CNNs), by making use of feedforward neural networks (FFNNs) and the recent dual fixed-size ordinally forgetting encoding (dual-FOFE) method to fully encode the sentence fragment and its left/right contexts into a fixed-size represen- tation. Furthermore, in this work, we propose to incorporate PageRank based distillation in our candidate generation module. Our neural linking models consist of three parts: a PageRank based candidate generation module, a dual-FOFE-net neural ranking model and a simple NIL entity clustering system. Experimental results have shown that our proposed neural linking models achieved higher EL accuracy than state-of-the-art models on the TAC2016 task dataset over the baseline system, without requiring any in-house data or complicated handcrafted features. More- over, it achieves a competitive accuracy on the TAC2017 task dataset. Keywords: Neural network · Entity linking · Knowledge base. 1 Introduction Named entities (NEs) have received much attention over the last two decades [17], mostly focused on recognizing the boundaries of textual NE mentions and classifying them as, e.g., Person (PER), Organization (ORG), Facility (FAC), Geo-political Entity (GPE) or Location (LOC). In 2009, NIST proposed the shared task challenge of EL [15]. EL is a similar but broader task than named entity disambiguation (NED). NED is concerned with disambiguating a textual NE mention where the correct entity is known to be one of the Knowledge Base (KB) entries, while EL also requires systems to deal with the case where there is no entry for the NE in the reference KB. In [10], the authors group and summarise different approaches to EL taken by participating systems. There is a vast body of research on NED, highlighted by [9]. The problem has been studied extensively by employing a variety of machine learning, and inference methods, including a pipeline of deterministic modules [13], simple classifiers [22], graphical models [3], classifiers augmented with ILP inference [1], and more recently, neural approaches [14,23,24,29]. 1 2 F. Wei et al. In this paper, we propose to use the recent dual-FOFE method [25] to fully encode the left/right contexts for each target mention, and then a simple FFNNs can be trained to make a precise linking for each target mention based on the fixed-size presentation of the contextual information. Moreover, we propose to incorporate PageRank based distillation in our candidate generation system. Compared with [14,24,29], our proposed neural linking models, without requiring any in-house data or complicated handcrafted features, can efficiently achieve higher EL accuracy in terms of computing than the baseline system, and achieves a competitive accuracy on both TAC2016 and TAC2017 task datasets. The remainder of this paper is organized as follows. Section 2 describes our proposed neural linking models. In Section 3, we discuss experimental results and compare the performance of our proposed models with that of existing state-of- the-art systems. Finally, Section 4 draws the conclusions and outlines our future work. 2 Our Proposed Neural Linking Models In this section, we discuss our proposed neural linking models, which consist of three parts: PageRank based candidate generation module, dual-FOFE-net neural ranking model and NIL entity clustering system. 2.1 PageRank based Candidate Generation Inspired by [19], we propose to extend the previous work in [14] to incorporate a PageRank based distillation in our candidate generation module to generate candidates for each detected mention. Candidates are generated based on KBs, including Freebase and Wikipedia [30]. Lucene fuzzy search strategy is applied in the implementation. The input to this module is a detected mention, and the output is a candidate list, which consists of a group of Freebase nodes potentially matching this mention, as shown in Figure 1. Following are five types of mention extensions implemented in the candidate generation module: -- Substring Extension: For each mention, all the recognized named entities in its original context document containing that mention will be selected. For instance, given the mention "Trump" in document d, "Donald Trump" will be selected as its substring extension if the named entity "Donald Trump" is found in d. -- Translation Extension: If a mention is in Chinese or Spanish, we invoke Google Translation to obtain its English translation as Translation Exten- sion. -- Country Extension: The abbreviation of a country name can be extended to a more concrete one. For example, the mention of the geo-political entity "UK" will be extended to "United Kingdom". -- Nominal Extension: The nearest recognized entity with the same entity type as its nominal extension will be selected to be added to the query list. Dual-FOFE-net Neural Models for Entity Linking with PageRank 3 Fig. 1. The diagram of the PageRank based candidate generation module. -- Traditional Chinese Extension: If a mention is in the form of simplified Chi- nese, its traditional Chinese version will be obtained. After the mention extensions, three parallel strategies are applied respec- tively: -- To invoke Lucene fuzzy search on Wikipedia titles, first paragraphs, docu- ment context and Freebase object names. -- To query a database with Wikipedia redirection and disambiguation infor- mation. -- To query a database with all Freebase entities. PageRank based Distillation. As discussed above, although in general the mention extension step helps to enhance the candidate coverage, it also products too many candidates for a single mention. This behavior leads to much noise, and slows down the whole system. In this work, inspired by [19], we propose to incorporate PageRank based distillation at the last step. As depicted in Figure 2, a toy document graph includes three entity mentions and seven candidates: three candidates generated for Lincolnshire, and two candidates generated for United F.C. and Devon White each. Each graph node e(m, c) is a pair of an entity mention m and a candidate c. An edge is drawn between two candidates of different entities whenever there is a link from the Wikipedia page for one candidate to the Wikipedia page for the other. There is no edge between candidates competing for the same entity. It is worth noting that edges in our graph model represent relations between candidates. We insert an edge between two candidates if the Wikipedia entry cor- responding to either of the two candidates contains a link to the other candidate. We assume that this relation is bidirectional and thus this edge is undirected. We rank the candidates of each mention based on their outbound link counts to all the recognized mentions in the same document, and keep the top τ can- 4 F. Wei et al. Fig. 2. A toy document graph for three entity mentions: United F.C., Lincolnshire, Devon White. Source: Adapted from Pershina et al. [21] didates for each mention, where τ is a distillation factor. We name this step "distillation". The score is calculated by the Wikipedia's anchors as follows: score(c) = count(c, m(cid:48)) (1) (cid:88) m(cid:48) where c is the candidate entity, m(cid:48) is the linked page (a mention identified in the same document) and count(c, m(cid:48)) is the total co-occurrence count of c and m(cid:48). erates a list of K candidates as C = {c1,··· , cK}, with K ∈ [0, τ ]. Finally, for each detected mention m, the candidate generation module gen- 2.2 Dual-FOFE-net Neural Ranking Models Dual Fixed-Size Ordinally Forgetting Encoding (Dual-FOFE). FOFE [31] was proposed as an alternative to commonly used sequence embedding rep- resentations, and achieved competitive results in language modeling. There is a nice theoretical property to guarantee that FOFE codes can almost uniquely encode any variable-length sequence of words into a fixed-size representation without losing any information. Given a vocabulary V , where each word can be represented by a 1-of-V one-hot vector. Let S = {w1,··· , wN} denote a sequence of N words from V , and en denote the one-hot vector of the n-th word in S, where 1 ≤ n ≤ N . Assuming z0 = 0, the FOFE code zn of the sequence from word w1 to wn is shown as follows: zn = α · zn−1 + en (2) where α is a constant forgetting factor. Thus, zn can be viewed as a fixed-size representation of the subsequence {w1,··· , wn}. We can see that, according to the theoretical properties presented in [31], any sequence of variable length can be uniquely and losslessly encoded into a fixed-size representation by FOFE. Dual-FOFE-net Neural Models for Entity Linking with PageRank 5 This simple ordinally-forgetting mechanism has been applied to some NLP tasks, e.g., [26,27,28] and have achieved very competitive results. The main idea of dual-FOFE is to generate augmented FOFE encoding codes by concatenating two FOFE codes using two different forgetting factors. Each of these FOFE codes is still computed in the same way as the mathematical formulation shown in Equation (2). The difference between them is that we may select to use two different values for the forgetting factor for additional modeling benefits. Our Proposed Dual-FOFE-net. As described in 2.1, we generate a candidate list C for each detected mention m. This list contains a special NIL candidate and some Freebase node IDs that match the mention in the candidate generation process. In this work, we propose to use a FFNNs probability ranking model to assign probabilities to all candidates in the list. The candidate with the highest probability is chosen as the final linking result. Each time, the FFNNs probability ranking model takes a mention m and a candidate ck from the list C to compute a matching score, ek. In order to do this, we make use of dual-FOFE to encode mention context features for the neural network. As shown in Figure 3, the input feature vector to the FFNNs probability ranking model is a concatenation of all the following features: -- Mention string embedding: Each detected mention is represented as a bag- of-words vector. This bag-of-words vector is projected into a 128-dimension dense vector. -- Document context: The left and right contexts of each mention are encoded by dual-FOFE, and projected into a 256-dimension dense vector. -- Knowledge base description: The corresponding KB, Freebase, description of each candidate and target mention is individually represented as one bag- of-words vectors (weighted using the TFIDF schema), which is mapped to a 128-dimension dense vector. As for Chinese and Spanish, since the languages have fewer resources than English in Freebase, we invoke Google APIs, which extract the translation to expand their Chinese and Spanish descriptions separately. In this paper, we use the rectified linear activation function, i.e., f (x) = max(0, x), to compute from activations to outputs in each hidden layer, which are in turn fed to the next layer as inputs. For the output layer, we make use of the softmax function to compute posterior probabilities between two nodes, standing for correct links or incorrect links, shown as follows: Pr(ckm) = . (3) (cid:80)K exp(ek) k=1 exp(ek) 2.3 NIL Entity Clustering For all mentions identified as NIL by the above dual-FOFE-net neural rank- ing model, we perform a simple rule-based algorithm to cluster them: Different 6 F. Wei et al. Fig. 3. Our proposed neural ranking model using dual-FOFE codes as input and a feed-forward neural network. named NIL mentions are grouped into one cluster only if their mention strings are the same (case-insensitive). 3 Experiments and Results In this section, we evaluate the effectiveness of our proposed methods on the benchmark datasets: TAC2016 and TAC2017 Trilingual Entity Discovery and Linking (EDL) tasks, and compare the performance of our proposed neural link- ing model with state-of-the-art models [14,29] on both TAC2016 and TAC2017 task datasets. In [14], the authors use some in-house data annotated by themselves, which consists of about 10,000 Chinese and English documents acquired through their web crawler. These documents are internally labelled using some annotation rules similar to the KBP guidelines. In [29], many complicated handcrafted features are created, including the mention level feature, entity level feature, mention- to-entity feature and entity-to-entity feature. It is worth noting that we have not used any in-house data or handcrafted features in our models, and all used features (either word or character level) are automatically derived from the data based on the simple FOFE formula. 3.1 Dataset Given a document collection in three languages (English, Chinese and Span- ish), the TAC trilingual EDL task [11,12] automatically identifies entities from a source collection of textual documents in multiple languages, as shown in Table Dual-FOFE-net Neural Models for Entity Linking with PageRank 7 Table 1. Number of Documents in TAC2015-2017 15 Train 15 Eval 16 Eval 17 Eval English Chinese Spanish ALL 444 500 503 500 168 167 168 167 129 167 168 166 147 166 167 167 1, classifies them into one of the following pre-defined five types: Person (PER), Geo-political Entity (GPE), Organization (ORG), Location (LOC) and Facility (FAC), links them to an existing KB (BaseKB)1, and clusters mentions for those NIL entities that do not have corresponding BaseKB entries. The corpus consists of news articles and discussion forum posts published in recent years, related to but non-parallel across languages. 3.2 Neural Model Setup Three models are trained and evaluated independently. Three sets of word em- beddings of 128 dimensions are derived from English Gigaword [20], Chinese Gigaword [5] and Spanish Gigaword [16], respectively. Since Chinese segmenta- tion is not reliable, based on a predefined set of all possible characters, we view the focus token as a character sequence and encode it using dual-FOFE. We then project the character encodings using a trainable character embedding matrix. Relying on the development experiments, the set of hyper-parameters used in our experiments is summarized as follows: i) Learning rate: All models are trained using the stochastic gradient descent (SGD) algorithm while the learning rate is set to be 0.1; ii) Network structure: Three hidden layers and ReLUs [18] as the nonlinear activation function, randomly initialized based on a uniform [4]; iii) Dropout [6] is adopted distribution between −(cid:113) 6 (cid:113) 6 and Ni+No Ni+No during training; iv) Number of epochs: 30; v) Chinese character embeddings: 64 dimensions, randomly initialized; vi) Forgetting factor: α = (0.5, 0.9) 2; vii) Distillation factor: τ = 20. 3.3 Evaluation Metrics To evaluate the effectiveness of our proposed models, we use the standard NERLC and CEAFmC metrics, which are combined measures of linking and clustering performance. 3 1 http://basekb.com/ 2 The choice of the forgetting factors α is empirical. We've evaluated on a development set in some early experiments. It turns out that α = (0.5, 0.9) is the best. As a result, (0.5, 0.9) is used for all EL tasks throughout this paper. 3 More details regarding data format and scoring metric can be found in http://nlp.cs.rpi.edu/kbp/ 8 F. Wei et al. Table 2. Performance comparison with the best system on the TAC2016 datasets (in terms of NERLC F1 and CEAFmC F1). [14] Our proposed TAC Rank 1 models NERLC CEAFmC NERLC CEAFmC Trilingual English Chinese Spanish 64.7 66.6 65.0 61.6 66.0 67.6 70.2 63.5 65.9 67.7 66.4 62.5 67.1 69.0 70.7 64.4 3.4 Results and Discussion Table 2 shows the performance of our proposed model on the TAC2016 task dataset along with the TAC Rank 1 system [14]. Our model outperforms the other system by 1.2% in terms of NERLC, and by 1.1% in terms of CEAFmC with the overall trilingual EL performance. Furthermore, each of the three indi- vidual models is better than its counterpart in the TAC Rank 1 system in terms of both NERLC and CEAFmC. As for the TAC2017 task dataset, shown in Ta- ble 3, encouragingly, the NERLC performance of English, Chinese and trilingual overall, outperforms the best system [29], by 0.4%, 0.6% and 0.2% separately, and the CEAFmC performance of English, Spanish and trilingual overall, is slightly better than the best system [29], by 0.5%, 0.4% and 0.4% separately. Following are the advantages of our proposed models over the state-of-the- art on both TAC2016 and TAC2017 task datasets. First, unlike the systems in [14,29], our models do not rely on any in-house data or complicated handcrafted features. It is very time consuming and labour intensive to prepare clean an- notated in-house data, or to collect and select good handcrafted features. More importantly, we have not used any handcrafted features in our models, and all used features (either word or character level) are automatically derived from the data based on the simple FOFE formula. Secondly, we present a simple and com- putationally efficient approach compared with recurrent neural networks (RNNs) or convolutional neural networks (CNNs), by making use of feedforward neural networks (FFNNs) and the recent dual fixed-size ordinally forgetting encoding (dual-FOFE) method to fully encode the sentence fragment and its left/right contexts into a fixed-size representation. Feedforward neural networks (FFNNs) use rather simple structures consisting of several fully-connected layers. These neural networks are known to be powerful as universal approximators [8], and they are simpler and faster to train and inference than the more recent variants such as long short-term memory (LSTM) [7], Gated Recurrent Unit (GRU) [2] or CNNs. Thus, our proposed dual-FOFE-net neural model is light and highly efficient compared with RNNs or CNNs. Last but not least, our proposed PageR- ank based distillation not only enhances the candidate coverage, but also speeds up the whole models. Dual-FOFE-net Neural Models for Entity Linking with PageRank 9 Table 3. Performance comparison with the best system on the TAC2017 datasets (in terms of NERLC F1 and CEAFmC F1). [29] Our proposed TAC Rank 1 models NERLC CEAFmC NERLC CEAFmC Trilingual English Chinese Spanish 67.8 66.8 71.0 65.0 70.5 68.8 73.2 68.9 68.0 67.2 71.6 64.8 70.9 69.3 72.4 69.3 4 Conclusion This paper presents a simple and computationally efficient approach to EL by applying FFNNs on top of dual-FOFE features. Furthermore, we propose to in- corporate PageRank based distillation in our candidate generation module. Our experiments have shown that, without requiring any in-house data or compli- cated handcrafted features, it achieves higher EL accuracy than state-of-the-art systems on the TAC2016 task dataset, and offers a competitive accuracy on the TAC2017 task dataset. In our future work, we will evaluate our neural linking models on more datasets and conduct more experiments to measure the sensitivity of the system to the values of some hyperparameters (e.g., number of hidden layers). In addi- tion, we will explore more architectures (e.g., convolutional layers), to quantify the contribution of some modules. References 1. Cheng, X., Roth, D.: Relational inference for wikification. In: Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. pp. 1787 -- 1796 (2013) 2. Cho, K., Van Merrienboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078 (2014) 3. Durrett, G., Klein, D.: A joint model for entity analysis: Coreference, typing, and linking. Transactions of the Association for Computational Linguistics 2, 477 -- 490 (2014) 4. Glorot, X., Bordes, A., Bengio, Y.: Deep sparse rectifier neural networks. In: Pro- ceedings of the fourteenth international conference on artificial intelligence and statistics. pp. 315 -- 323 (2011) 5. Graff, D., Chen, K.: Chinese gigaword. LDC Catalog No.: LDC2003T09, ISBN 1, 58563 -- 58230 (2005) 6. Hinton, G.E., Srivastava, N., Krizhevsky, A., Sutskever, I., Salakhutdinov, R.R.: Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580 (2012) 7. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation 9(8), 1735 -- 1780 (1997) 10 F. Wei et al. 8. Hornik, K.: Approximation capabilities of multilayer feedforward networks. Neural networks 4(2), 251 -- 257 (1991) 9. Ji, H.: Entity discovery and linking reading list. http://nlp.cs.rpi.edu/kbp/ 2014/elreading.html (2016) 10. Ji, H., Grishman, R.: Knowledge base population: Successful approaches and chal- lenges. In: Proceedings of the 49th Annual Meeting of the Association for Com- putational Linguistics: Human Language Technologies-Volume 1. pp. 1148 -- 1158. Association for Computational Linguistics (2011) 11. Ji, H., Nothman, J., Dang, H.T., Hub, S.I.: Overview of tac-kbp2016 tri-lingual edl and its impact on end-to-end cold-start kbp. Proceedings of TAC (2016) 12. Ji, H., Pan, X., Zhang, B., Nothman, J., Mayfield, J., McNamee, P., Costello, C., Hub, S.I.: Overview of tac-kbp2017 13 languages entity discovery and linking. In: Proceedings of the Tenth Text Analysis Conference (TAC2017) (2017) 13. Ling, X., Singh, S., Weld, D.S.: Design challenges for entity linking. Transactions of the Association for Computational Linguistics 3, 315 -- 328 (2015) 14. Liu, D., Lin, W., Wei, S., Zhang, S., Jiang, H.: The ustc nelslip systems for trilingual entity detection and linking tasks at tac kbp 2016. In: TAC (2016) 15. McNamee, P., Dang, H.T.: Overview of the tac 2009 knowledge base population track. In: Text Analysis Conference (TAC). vol. 17, pp. 111 -- 113 (2009) 16. Mendonca, A., Graff, D.A., DiPersio, D.: Spanish gigaword second edition. Lin- guistic Data Consortium (2009) 17. Nadeau, D., Sekine, S.: A survey of named entity recognition and classification. Lingvisticae Investigationes 30(1), 3 -- 26 (2007) 18. Nair, V., Hinton, G.E.: Rectified linear units improve restricted boltzmann ma- chines. In: Proceedings of the 27th international conference on machine learning (ICML-10). pp. 807 -- 814 (2010) 19. Page, L., Brin, S., Motwani, R., Winograd, T.: The pagerank citation ranking: Bringing order to the web. Tech. rep., Stanford InfoLab (1999) 20. Parker, R., Graff, D., Kong, J., Chen, K., Maeda, K.: English gigaword. Linguistic Data Consortium (2011) 21. Pershina, M., He, Y., Grishman, R.: Personalized page rank for named entity dis- ambiguation. In: Proceedings of the 2015 Conference of the North American Chap- ter of the Association for Computational Linguistics: Human Language Technolo- gies. pp. 238 -- 243 (2015) 22. Ratinov, L., Roth, D., Downey, D., Anderson, M.: Local and global algorithms for disambiguation to wikipedia. In: Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies-Volume 1. pp. 1375 -- 1384. Association for Computational Linguistics (2011) 23. Sil, A., Dinu, G., Kundu, G., Florian, R.: The ibm systems for entity discovery and linking at tac 2017. Proc. TAC2017 (2017) 24. Tang, S., Ren, Y., Yang, X., Liu, D., Hu, G., Wu, F., Zhuang, Y.: The zhi-edl system for entity discovery and linking at tac kbp 2017. In: TAC (2017) 25. Watcharawittayakul, S., Xu, M., Jiang, H.: Dual fixed-size ordinally forgetting encoding (fofe) for competitive neural language models. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. pp. 4725 -- 4730 (2018) 26. Xu, M., Jiang, H., Watcharawittayakul, S.: A local detection approach for named entity recognition and mention detection. In: Proceedings of the 55th Annual Meet- ing of the Association for Computational Linguistics (Volume 1: Long Papers). vol. 1, pp. 1237 -- 1247 (2017) Dual-FOFE-net Neural Models for Entity Linking with PageRank 11 27. Xu, M., Nosirova, N., Jiang, K., Wei, F., Jiang, H.: Fofe-based deep neural networks for entity discovery and linking. In: TAC (2017) 28. Xu, M., Wei, F., Watcharawittayakul, S., Kang, Y., Jiang, H.: The yorknrm systems for trilingual edl tasks at tac kbp 2016. In: TAC (2016) 29. Yang, T., Du, D., Zhang, F.: The tai system for trilingual entity discovery and linking track in tac kbp 2017. In: TAC (2017) 30. Zesch, T., Muller, C., Gurevych, I.: Extracting lexical semantic knowledge from wikipedia and wiktionary. In: LREC. vol. 8, pp. 1646 -- 1652 (2008) 31. Zhang, S., Jiang, H., Xu, M., Hou, J., Dai, L.: The fixed-size ordinally-forgetting encoding method for neural network language models. In: Proceedings of ACL (2015)
1604.05747
1
1604
2016-04-19T20:59:32
Syntactic and semantic classification of verb arguments using dependency-based and rich semantic features
[ "cs.CL" ]
Corpus Pattern Analysis (CPA) has been the topic of Semeval 2015 Task 15, aimed at producing a system that can aid lexicographers in their efforts to build a dictionary of meanings for English verbs using the CPA annotation process. CPA parsing is one of the subtasks which this annotation process is made of and it is the focus of this report. A supervised machine-learning approach has been implemented, in which syntactic features derived from parse trees and semantic features derived from WordNet and word embeddings are used. It is shown that this approach performs well, even with the data sparsity issues that characterize the dataset, and can obtain better results than other system by a margin of about 4% f-score.
cs.CL
cs
Syntactic and semantic classification of verb arguments using dependency based and rich semantic features Francesco Elia∗ Universit`a di Roma "La Sapienza" Abstract Corpus Pattern Analysis (CPA) has been the topic of Semeval 2015 Task 15, aimed at producing a system that can aid lexicographers in their efforts to build a dictionary of meanings for English verbs using the CPA anno- tation process. CPA parsing is one of the subtasks which this annotation process is made of and it is the focus of this report. A supervised machine- learning approach has been implemented, in which syntactic features de- rived from parse trees and semantic features derived from WordNet and word embeddings are used. It is shown that this approach performs well, even with the data sparsity issues that characterize the dataset, and can obtain better results than other system by a margin of about 4% f-score. 1 Introduction Recent research on Corpus Pattern Analysis, a corpus-driven technique for iden- tifying and assigning meaning to patterns of word usage in text, suggests that it may be useful to build a semantic resource that can be used in several NLP applications. As of now, the main output of CPA is the Pattern Dictionary of English Verbs (http://www.pdev.org.uk), a manually built collection of pat- terns with entries for each verb in the English language. Task 15 at SemEval 2015 focused on Corpus Pattern Analysis and PDEV, with the aim of producing systems that can automatically build a pattern dictionary for verbs using CPA. To perform this, several stages of processing are needed. The first one, called "CPA parsing", is the focus of this report. The CPA parsing task requires a system to identify and classify, from a syntactic and semantic perspective, the relevant arguments for a target verb in a given sentence. The task is similar to Semantic Role Labeling, but single tokens are identified in the dependency parsing paradigm, rather than phrases in the constituency parse tree. In this ∗[email protected] 1 report, a system that can perform this task using a learning-based approach is illustrated, by training three maximum entropy classifiers that perform ar- gument identification, syntactic and semantic classification. A rich set of both syntactic and semantic features has been used, showing that they are effective at performing the given task. The system improves on previous results on the same task, with an f-score increase of almost 4% on the best performing system. These results show that, despite the data sparsity that characterizes the dataset provided for this task, a learning-based approach can perform well with the use of descriptive features and that, most likely, this approach would perform even better if more data was available. 2 CPA parsing CPA parsing requires a system to analyze a sentence, extract the verb's main arguments and tag them both syntactically (see Table 2 for the syntactic tagset) and semantically (using the CPA ontology1). As an example, let's consider the following sentence, where the verb "continue" is the target verb, that is the verb whose arguments have to be extracted: European politicians continue to plead, sincerely, that Yugoslavia should endure. The goal of CPA parsing is to annotate this sentence as shown in Table 1. Token Syntactic tag Semantic tag subj v advprep acomp Human LexicalItem Activity European politicians continue to plead , sincerely , that Yugoslavia should endure . Table 1: An example of correctly annotated sentence using CPA syntactic and semantic tag sets In this task, the target verb is the only information passed to the system, since it is already marked in each sentence in the dataset and thus does not 1Available at: http://pdev.org.uk/#onto 2 need to be identified. The most important part in solving this task is un- doubtedly identifying which tokens in the sentence are actual arguments for the verb, because mistakes at this stage will reflect on all the following steps and will negatively impact the performance of the system. For this reason, simi- larly to the approach used in [1], I divided the CPA parsing task into three smaller subtasks: argument identification, syntactic classification and semantic classification. Although a single classifier could be used to jointly identify and syntactically classify each token (i.e., by directly assigning a label of "subj", "obj", etc... when a token is an argument and assigning a label of "none" when the token is not) this division allows to separately study which features work best for argument identification and thus improve it without having to worry about the syntactic classification yet. Tag Definition Object Subject obj subj advprep Adverbial preposition or other Adverbial/Verbal link acomp scomp iobj Adverbial or Verb complement Noun or Adjective complement Indirect object Table 2: Syntactic tagset for CPA parsing The three steps of argument identification, syntactic and semantic classi- fication all use a machine-learning approach, implemented with a maximum entropy classifier trained using the Stanford Classifier implementation2. Maxi- mum entropy models, also known as log-linear or exponential, have been widely used for several NLP tasks, for example question classification, named entity recognition and sentiment analysis; they provide the capability to be trained with several thousands features, which is very common for applications in NLP, and, to a certain extent, they can distringuish between more and less relevant features by automatically assigning higher weights to the former [2]. Figure 1 shows the data processing pipeline and how these three modules are arranged with respect to the other components of the system, namely preprocessing and feature extraction. The preprocessing step, described in detail in Section 2.1, is needed to parse the input sentence and compute syntactic and semantic information that is later used for feature extraction. Several features and their combinations have been tested for each classifier and the best performing ones have been chosen using a greedy hill-climbing algorithm as described in Section 2.2. The argument identification, syntactic and semantic classification processes are described in detail in Sections 2.3, 2.4 and 2.5 respectively. 2Available at: http://nlp.stanford.edu/software/classifier.shtml 3 Figure 1: Data processing pipeline 2.1 Preprocessing The preprocessing step augments each sentence in the dataset with the linguis- tic and syntactic information needed to later perform the feature extraction step. All the syntactic information is obtained by using the Stanford CoreNLP pipeline [3]: in particular, each sentence in the dataset is augmented with POS tags, lemmas, a constituency and a dependency parse tree. 2.2 Features and feature selection Despite the system has to work on three different tasks, features have not been created specifically for each one of them: considering the fact that the argument identification and syntactic classification tasks may require very similar features and that these features, despite syntactic in nature, may also benefit the seman- tic classification task anyway, a unique set of features has been devised and the work of selecting the best performing subset of features for each task is left to the feature selection algorithm. The algorithm starts with an initial, possibly empty, subset of features (provided by the user) and tries one new feature at a time: a new classifier is trained and tested with the new set of features and the new feature is kept if it improves the f-score on the dev set. When there are no more features to be added the algorithm terminates. 4 Data: S = initial subset of features, A = all the features excluding those in S Result: Subset of features S with the highest f-score bestFscore = 0; while A is not empty do feature = sample(A); A.remove(feature); fscore = fscore(S ∪ {f eature}); if f score > bestF score then S.add(feature); bestFscore = fscore; end end return S; Algorithm 1: Hill-climbing search for best combination of features For compactness reasons, the complete list of features, alogn with a descrip- tion for each one, is provided in Appendix A. 2.3 Argument identification Argument identification is performed by a binary classifier that works locally on each token in the sentence and decides whether it is an argument or not. The training set for this classifier is obtained by taking all the tokens in the training set and labeling them with the "argument" class when they have a syntactic label or with "none" otherwise. As an example, how a sample sentence gets annotated by the argument identification classifier: Token Class argument verb argument argument Universities continued to languish through the eighties Table 3: Output of the argument identification classifier on the example sen- tence. Tokens that do not represent arguments are labeled with "none" but, for simplicity, it is not shown in the table. It must be stressed that argument identification is probably the most im- portant step in the whole process, because if an argument is missed or a non- argument is erroneously identified as one, these errors will necessarily propagate through the pipeline rendering the execution of the following steps meaningless. 5 2.4 Syntactic classification This classifier operates on the output of the argument identification step. Tokens identified as arguments are passed to the syntactic classifier, which assigns each of them to one of the 6 possible syntactic classes (subj, obj, iobj, advprep, acomp, scomp). Continuing with the same example sentence, three tokens have been identified as arguments and they have to be classified syntactically: Token Syntactic class subj verb advprep acomp Universities continued to languish through the eighties Table 4: Output of the syntactic classifier on the example sentence. 2.5 Semantic classification The semantic classifier operates on the output of the previous steps and works in a similar fashion. Each token that has been recognized as an argument gets assigned a semantic label, chosen from the 118 labels present in the training set. Here's how the example sentence that has been considered up to now gets annotated: Token Syntactic class Semantic class subj verb advprep acomp Universities continued to languish through the eighties Institution LexicalItem Action Table 5: Output of the semantic classifier on the example sentence, which is now fully annotated. 6 3 Experiments 3.1 Overview of the dataset The performance of the system has been evaluated on the SemEval 2015 Task 15 dataset. The training set is made of 3249 sentences for 21 different verbs, while the test set contains 1280 sentences for 7 verbs. It must be noted that the verbs contained in the training set are different than those contained in the test set, in order to encourage researchers to work on systems that could generalize to different verbs than those they have been trained on. Table 6 shows the number of sentences for each verb in the training and test set. Verb # of sentences Verb # of sentences allow crave launch* propose execute* pray* announce battle* plead abandon answer abort squeal disable 150 75 207 169 213 180 228 190 205 172 171 60 20 51 sabotage recall claim applaud veto plan account undertake crush operate apprehend appreciate continue decline 77 263 212 198 123 130 155 228 170 140 123 215 203 201 Table 6: Number of sentences for each verb in the dataset. Underlined verbs are part of the test set. Verbs marked with * have been chosen for the dev set. The training set has a total of 7122 tokens with a syntactic and semantic label. Figure 3.1 shows how syntactic classes are distributed in the training set: the most frequent class (rank 0) is subj followed by obj, acomp, advprep, scomp and finally iobj. The last two classes (iobj and scomp) are an order of magnitude less frequent than all the other ones, but considering the fact that they do not appear in the test set, and thus do not affect the performance of the system, the frequency of the other classes is pretty balanced. Unfortunately, as can be seen from Figure 3, the distribution of semantic classes is instead very skewed, with the first three most common classes (i.e., Human, LexicalItem, Action) accounting for 57% of the total number of ex- amples. Out of the 118 semantic classes that appear in the training set, 77 of them do so less than 10 times and this is potentially an issue for the seman- tic classification task, that will be shown to be the less performing part of the system. 7 Figure 2: Distribution of syntactic classes in the training set. Figure 3: Distribution of semantic classes in the training set. As can be seen, the frequency of a class is roughly inversely proportial to its rank, leading to a very skewed distribution where the top 3 most frequent classes constitute more than half of the training set. 3.2 Metrics The metric used for the evaluation is the average f-score of the system over each verb in the test set: F1verb = 2 · Precisionverb · Recallverb Precisionverb + Recallverb 8 (cid:80) verb∈V F1verb V Score = Where V is the set of verbs contained in the test set. Precision and recall are calculated as follows: Precision = Correct tags Retrieved tags Recall = Correct tags Reference tags A tag is considered correct when it is placed on the exact same token and matches the annotation in the gold standard. For this reason, a good perfor- mance of the argument identification module is essential for good final results, seeing as errors at this stage will be reflected on all the following ones: if ar- guments are not identified this will impact recall for syntactic and semantic classification and if tokens are erroneously identified as arguments this will im- pact their precision, no matter what syntactic/semantic class is assigned to those tokens. 3.3 Results of feature selection Applying the feature selection algorithm results in three subsets of features, one for each of the three classifiers used in the pipeline, as shown in the following table. Feature name TokenLemma TokenWord TokenPos LemmasAroundToken WordsAroundToken PosAroundToken TokenIsVerb TokenIsPrepositionOfVerb TokenPhraseType TokenPhraseStructure TokenIsSubjOrObj TokenIsVerbChild TokenIsCapitalized TokenContainsDigit TokenIsUppercase TokenRelFromVerb TokenIsUniqueSubjOrObj VerbLemma ArgId SynClass SemClass • • • • • • • • • • • • • • • • • • 9 Feature name VerbPos LemmasAroundVerb PosAroundVerb VerbVoice VerbPosition IsVerbPrepositional VerbBy VerbPhraseStructure VerbIsRoot VerbHasNsubj VerbHasNsubjpass VerbHasDobj VerbHasIobj VerbHasCcomp VerbHasAcomp VerbHasXcomp VerbParentLemma VerbParentPos VerbFirstVpParentLemma RelVerbParentToVerb TokenDirDpathFromVerb TokenDirDpathFromVerbWithLemma TokenDirDpathFromVerbWithPos TokenUndDpathFromVerb TokenUndDpathFromVerbWithLemma TokenUndDpathFromVerbWithPos DirDpathVerbVpParentToVerb DirDpathVerbVpParentToVerbWithLemma DirDpathVerbVpParentToVerbWithPos TokenDirDpathFromVerbVpParent TokenDirDpathFromVerbVpParentWithLemma TokenDirDpathFromVerbVpParentWithPos TokenParentDirDpathFromVerb TokenParentDirDpathFromVerbWithLemma TokenParentDirDpathFromVerbWithPos TokenDirDpathFromVerbParent TokenDirDpathFromVerbParentWithLemma TokenDirDpathFromVerbParentWithPos TokenCpathFromVerb TokenCpathFromVerbParent VerbHypernymsMcs HypernymsMcs HypernymsDisambiguated TokenSimilarWords 10 ArgId SynClass SemClass • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • Feature name ArgId SynClass SemClass VerbSimilarWords TokenMostSimilarLabels VerbPreps VerbDistance DepDepthDifference ConDepthDifference DepPathToVerbLength ConPathToVerbLength • • • • • • • • • • The two tasks of argument identification and syntactic classification share several features: more precisely, most of the features that are useful for argu- ment identification are also useful in classification while this is not true the other way around. A quick look at the section containing Verb* features, shows that most of these are only used in classification. This is expected, since, for example, a combination of features like VerbPosition and VerbVoice is very useful in discriminating between a subject (which usually appears before/after the verb if the sentence is in active/passive form) and an object, which behaves inversely, but not very discriminative for argument identification in general. As could be expected, the VerbLemma feature does not improve the performance of any classifier, because the test/dev sets use sentences with different verbs than those seen during training. For this reason, many features derived from word embed- dings (e.g., VerbSimilarWords, TokenSimilarWords) proved to be really useful for semantic classification, allowing the classifier to "understand" when a new verb is similar to one it has already seen, thus better generalizing to new unseen verbs instead of treating them as completely unrelated to what it has seen during training. Classifier Precision Recall Fscore Argument identification Syntactic classification Semantic classification 0.862 0.945 0.695 0.751 0.802 -- -- -- -- Table 8: The performance of the three models on the test set, with the best subset of features resulting from the application of the feature selection algo- rithm. Table 8 shows the performance of the classifiers with the best subsets of features obtained by the feature selection algorithm. Recall and f-score are only shown for argument identification, because, as previously mentioned, recall of syntactic and semantic classification is a direct result of that of argument identification and is not considered during the feature selection process since the three steps are optimized independently from each other. 11 4 Results The performance of the system has been compared to the three other systems that participated at SemEval 2015 task 15 and to that of the baseline provided by the organizers of the task. The following results are obtained using the best performing features for each classifier as detailed in Table 8. The performance of each system, including mine and the baseline, is shown in Table 9. System F-score My system 0.661 0.624 baseline FANTASY 0.589 BLCUNLP 0.530 CMILLS 0.516 Table 9: Comparison of the scores of the CPA parsing systems. As previously noted, my system improves on the baseline with an increment of almost 4% f-score and on FANTASY, the best performing system submitted by participants, with an increment of around 7%. This final score, as explained in Section 3.2, is calculated as the average f-score for all the verbs in the test set, so a detailed breakdown of precision, recall and f-score for syntactic and semantic classification for each of them is shown in Table 10. Verb Syntactic stats Semantic stats Average stats precision recall fscore precision recall fscore precision recall fscore crush continue operate decline undertake apprehend appreciate 0.836 0.92 0.788 0.898 0.754 0.825 0.908 0.729 0.84 0.532 0.838 0.717 0.722 0.713 0.779 0.878 0.635 0.867 0.735 0.77 0.798 0.484 0.634 0.327 0.626 0.585 0.745 0.716 0.436 0.578 0.21 0.578 0.546 0.634 0.559 0.459 0.605 0.256 0.601 0.565 0.685 0.628 0.657 0.777 0.563 0.763 0.67 0.786 0.812 0.582 0.709 0.371 0.708 0.632 0.678 0.636 0.617 0.741 0.447 0.734 0.65 0.728 0.713 AVERAGE 0.847 0.727 0.78 0.588 0.506 0.543 0.718 0.617 0.661 Table 10: Detailed scores for each verb in the test set, obtained by using the scorer for the SemEval task available on the official website Syntactic classification is definitely the best performing part of the system and analyzing in detail the contribution of precision and recall to the final syntactic score, it can be seen that precision is much higher, which is usually a desirable property in a system that aims at minimizing the work that human annotaors have to do. Semantic classification has much lower scores, both in terms of precision and recall. As explained in Section 3, semantic classes in the training set follow a very skewed distribution with common classes such as Human appearing for 30% of the tokens. To show how the frequency of a semantic class impacts the f-score that the classifier ends up having, a plot of 12 the f-score of each class with respect to its frequency in the training set is shown in Appendix B. It is evident that the there is a strong correlation between the number of examples and the f-score for each semantic class and, indeed, the best performing classes are the most frequent in the training set. Category #Gold CMILLS FANTASY BLCUNLP baseline My system subj obj Human Activity acomp LexicalItem advprep State Of Affairs Institution Action 1,008 777 580 438 308 303 289 192 182 115 0.564 0.659 0.593 0.450 0.545 0.668 0.621 0.410 0.441 0.421 0.694 0.792 0.770 0.479 0.418 0.830 0.517 0.276 0.531 0.594 0.739 0.777 0.691 0.393 0.702 0.771 0.736 0.373 0.483 0.526 0.815 0.783 0.724 0.408 0.729 0.811 0.845 0.211 0.461 0.506 0.785 0.817 0.726 0.571 0.705 0.766 0.817 0.529 0.512 0.372 Table 11: F-scores for the top 10 most frequent classes, compared to those obtained by the other systems. Table 11 shows the performance of the systems on the top 10 most frequent classes, not distinguishing between syntactic and semantic ones. It can be seen that the baseline is still strong at predicting syntactic arguments using a rule- based approach, but gets beaten in every semantic class. The FANTASY system, which was the best performing one in this task, is not accompained by an article, so it is not possible to analyze their results in depth. 5 Conclusions The CPA parsing task, which has been discussed in this report, is the first step in the CPA annotation process and consists in identifying and classifying, from a syntactic and semantic perspective, the relevant arguments of a target verb in a sentence so that patterns can subsequently be extracted for each verb and clustered together according to their similarity. Syntactic classification had to be performed on a small syntactic tagset comprising the most common syntac- tic functions (subject, object, indirect object, adjective complement, adverbial complement) while semantic classification used the CPA ontology, which con- tains around 250 hierarchically organized semantic classes. CPA parsing proved to be a difficult task, as none of the systems that partic- ipated at SemEval 2015 Task 15 managed to beat the rule-based baseline that was provided by the task organizers, with the best performance being very close but still 3.5% lower than that of the baseline. The approach described in this report outperforms these systems and slightly improves on the baselines results as well, with an increase of almost 4% in terms of f-score. The system uses a pipeline of three maximum entropy classifiers, which, in turn, first identify the relevant verb arguments and then classify them syntactically and semantically. 13 Among these three steps the argument identification one is arguably the most important in the whole process, as errors at this stage will propagate to all the following steps and its performance is an upper bound to that of the whole sys- tem. In the proposed system, this stage performs well, with an f-score of 80%. Syntactic classification, however, is the best performing step in the pipeline: this is probably due to the fact that, given the way the data is structured, the training set contains a high and balanced number of examples for each syntac- tic class, resulting in easier training. While performance on the syntactic level can be considered good, that of the semantic layer is, unfortunately, very far from those of both argument identification and syntactic classification. There are multiple reasons for this to happen, but, most likely, this is due to the data sparsity problem that characterizes semantic classes in the training set and that has been previously discussed in Section 3.1. These three classifiers are trained with several kind of features, some inspired from previous work on Semantic Role Labeling and CPA parsing, while others are novel features or variations on known features designed by me during my work on this task. Given the high number of features, manually testing the effectiveness of each one is a hard task, so a simple feature selection algorithm has been employed in order to select the best subset for each of the three mod- els. Despite this, running the feature selection algorithm is still computationally expensive and I have been limited in the number of iterations I could actually execute. I believe that better feature subsets can be found and also that exper- imenting with other feature selection techniques could lead to improvements in the performance of the system. In conclusion, I presented a learning-based approach to CPA parsing which showed to perform better than previous attempts, thanks to descriptive fea- tures tailored to each of the subtasks that CPA parsing is made of. While most of previous CPA parsing systems either used rule-based approaches or relatively simple features for semantic classification (for example named entities) this work shows how dependency parse trees and WordNet and word embeddings can be used to derive a useful set of features to improves the performance of syntactic and semantic classification respectively. References [1] Mills, Chad, and Gina-Anne Levow. "CMILLS: Adapting Semantic Role Labeling Features to Dependency Parsing." [2] Manning, Christopher, and Dan Klein. "Optimization, maxent models, and conditional estimation without magic." Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Lin- guistics on Human Language Technology: Tutorials-Volume 5. Association for Computational Linguistics, 2003. 14 [3] Manning, Christopher D., et al. "The Stanford CoreNLP Natural Language Processing Toolkit." ACL (System Demonstrations). 2014. [4] Kolb, Peter. "Disco: A multilingual database of distributionally similar words." Proceedings of KONVENS-2008, Berlin (2008). [5] Mikolov, Tomas, et al. "Distributed representations of words and phrases and their compositionality." Advances in neural information processing sys- tems. 2013. [6] Feng, Yukun, Qiao Deng, and Dong Yu. "BLCUNLP: Corpus Pattern Anal- ysis for Verbs Based on Dependency Chain." Proceedings of SemEval (2015). 15 Appendices A List of features 1. TokenLemma The lemma of the token. 2. TokenWord The word form of the token. 3. TokenPos The POS tag of the token. 4. LemmasAroundToken Lemmas of the tokens immediately before and after the current one. If the token is at the start or at the end of the sentence, special <s> or </s> symbols are used to represent the previous or next token respectively. 5. WordsAroundToken Words immediately before and after the current to- ken. If the token is at the start or at the end of the sentence, special <s> or </s> symbols are used to represent the previous or next token respectively. 6. PosAroundToken POS tags of the tokens immediately before and after the current one. If the token is at the start or at the end of the sentence, special <s> or </s> symbols are used to represent the previous or next token respectively. 7. TokenIsVerb Whether the token is a verb. A token is considered a verb if its POS tag starts with V. 8. TokenIsPrepositionOfVerb Whether the token is a prepositional depen- dency of the target verb, that is whether the target verb node in the dependency parse tree has a prep dependency relation with the token as child. To compute this feature CoreNLP basic dependencies annotations are used (as opposed to the collapsed dependencies annotations that are used to compute the other features), because when using the other types of dependencies prepositions are collapsed into the edges and they don't have a corresponding node in the tree. 9. TokenPhraseType The phrase type the token belongs to according to the constituency parse tree. Formally, the value of the first non pre- terminal ancestor of the token node (the pre-terminal node contains POS tag annotations); in the case of the "Universities" token the value is token phrase type=NP. 10. TokenPhraseStructure This feature represents the structure of the sub- tree the token belongs to. As for the TokenPhraseType feature, the first non pre-terminal ancestor of the token node is identified, and then all its children are listed in left to right order; as for the example token the value is token phrase strcture=NP->NNS. 16 11. TokenIsSubjOrObj Whether the token has a parent with a nsubj, nsubj- pass or dobj relation in the dependency parse tree. 12. TokenIsVerbChild Whether the token is a child of the target verb in the dependency parse tree. 13. TokenIsCapitalized Whether the token is capitalized. This feature should be most useful for semantic classification, in recognizing many proper names that appear in the dataset. 14. TokenContainsDigit Whether the token contains digits. This feature should be most useful for semantic classification, in recognizing many in- stances of the Numerical Value semantic class. 15. TokenIsUppercase Whether the token is completely uppercase. This fea- ture should be most useful for semantic classification, since, for example, many instances of the Business Enterprise class are written in all upper- case characters. 16. TokenRelFromVerb The direct relation in the dependency parse tree from the target verb to token (if any). 17. TokenIsUniqueSubjOrObj Whether or not the current token is the only one in the sentence to have a parent with a nsubj, nsubjpass and dobj relation. More specifically, for each of these relations R the output is a boolean feature (so this actually adds three features at most) that takes its value according to the following rules: • if the token doesn't have a parent with relation R, this feature is not added; • if the token has a parent with relation R but there exists, in the dependency parse tree, two other tokens linked by R, the feature is set to false; • otherwise it is set to true. As for the example, the features for the nsubjpass and dobj dependencies will not be set, since the "Universities" token doesn't have such relations, and the feature for nsubj will be set to is unique nsubj=true because it is the only token in the whole dependency parse tree to have a parent linked by the nsubj relation. Features computed on the target verb: 18. VerbLemma Lemma of the target verb. 19. VerbPos POS tag of the target verb. 20. LemmasAroundVerb Lemmas of the tokens immediately before and after the target verb. If the target verb is at the start or at the end of the sentence, special <s> or </s> symbols are used to represent the previous or next token respectively. 17 21. PosAroundVerb POS tags of the tokens immediately before and after the verb. If the verb is at the start or at the end of the sentence, special <s> or </s> symbols are used to represent the previous or next token respectively. 22. VerbVoice Whether the target verb has active or passive voice, deter- mined through the use of dependencies: if the verb has any child with a relation of nsubjpass, csubjpass, auxpass or agent the voice is set to passive, otherwise it is set to active. 23. VerbPosition Whether the current token is before or after the target verb. 24. IsVerbPrepositional Whether the target verb belongs to a list of prepo- sitional verbs. The list contains verbs that commonly take prepositional arguments like "continue" (continue to), "thank" (thank for ), etc... and it is shown in Appendix A. 25. VerbBy Whether the target verb has a prep by dependency. If this hap- pens, the dependant is probably a passive subject. 26. VerbPhraseStructure The same as the ArgumentPhraseStructure fea- ture, but computed for the target verb token. In the example: verb phrase structure=VP->VBD-S 27. VerbIsRoot Whether the target verb is the root of the sentence in the dependency parse tree. 28. VerbHasNsubj Whether the target verb has a nsubj dependency. 29. VerbHasNsubjpass Whether the target verb has a nsubjpass dependency. 30. VerbHasDobj Whether the target verb has a dobj dependency. 31. VerbHasIobj Whether the target verb has a iobj dependency. 32. VerbHasCcomp Whether the target verb has a ccomp dependency. 33. VerbHasAcomp Whether the target verb has a acomp dependency. 34. VerbHasXcomp Whether the target verb has a xcomp dependency. 35. VerbParentLemma Lemma of the parent of the target verb in the depen- dency parse tree (if any). 36. VerbParentPos The POS tag of the parent of the target verb in the dependency parse tree. 37. VerbFirstVpParentLemma Lemma of the first ancestor of the target verb that is also a verb: if the parent of the target verb is a verb then this feature is the same as VerbParentLemma. 38. RelVerbParentToVerb The relation from the target verb parent to the target verb in the dependency parse tree (if any). 18 The following features are based on paths between nodes in the dependency parse tree. Six types of paths are considered and each path can be augments with lemmas or POS tags of the traversed nodes, giving rise to a total of 18 feature types based on dependency paths. 39. TokenDirPathFromVerb 40. TokenDirPathFromVerbWithLemma 41. TokenDirPathFromVerbWithPos The shortest directed path in the dependency parse tree from the target verb to the current token. The path is the list of dependency relations that are traversed to reach the candidate token from the verb and it can be augmented with lemmas or POS tags of the traversed nodes. In the example sentence shown before these three features will have the following values: • token dir dpath from verb=nsubj • token dir dpath from verb with lemma=nsubj-continue • token dir dpath from verb with pos=nsubj-VBD If such a path does not exist this feature is not set. 42. TokenUndDpathFromVerb 43. TokenUndDpathFromVerbWithLemma 44. TokenUndDpathFromVerbWithPos The shortest undirected path between the target verb and the current to- ken in the dependency parse tree, augmented with lemmas and POS tags of the traversed nodes similarity to the previous three features. This path is guaranteed to exist, so this feature is always set. 45. DirDpathVerbVpParentToVerb 46. DirDpathVerbVpParentToVerb 47. DirDpathVerbVpParentToVerb The shortest directed path from the first VP ancestor of the target verb to the target verb. 48. TokenDirDpathFromVerbVpParent 49. TokenDirDpathFromVerbVpParentWithLemma 50. TokenDirDpathFromVerbVpParentWithPos The shortest directed path from the first VP ancestor of the target verb to the current token. 51. TokenParentDirDpathFromVerb 52. TokenParentDirDpathFromVerbWithLemma 53. TokenParentDirDpathFromVerbWithPos The shortest directed path from the target verb to the token parent. 19 54. TokenDirDpathFromVerbParent 55. TokenDirDpathFromVerbParentWithLemma 56. TokenDirDpathFromVerbParentWithPos The shortest directed path from the verb parent in the dependency parse tree to the current token. Two features based on paths in the constituency parse tree: 57. TokenCpathFromVerb The path in the constituency parse tree from the target verb to the current token. 58. TokenCpathFromVerbParent The path in the constituency parse tree from the parent of the target verb to the current token. Purely semantic features: 59. HypernymsMCS All the inherited hypernyms of the current token, ob- tained from WordNet, up to the "entity" node (excluded). The lemma of the token and its POS tag are used to perform a WordNet lookup and the first WordNet sense (that usually is the most common one) is chosen. For each of the hypernym synsets the first word is taken and used as a feature. In the case of the example, four features are added: • hypernyms mcs=body, • hypernyms mcs=social group, • hypernyms mcs=group, • hypernyms mcs=abstraction. 60. HypernymsDisambiguated Same as the HypernymsMCS feature, but instead of selecting the most common sense makes use of the output of the disambiguation step done during preprocessing. If the current token has a Babel synset set, then the corresponding WordNet synset is obtained and the hypernyms are computed from that synset; if the token doesn't have a Babel synset the feature is not set. Although BabelNet provides relations between synsets, and thus hypernyms could have been computed without passing through WordNet, the latter has been preferred for the quality of its manually built taxonomy that, compared to that of BabelNet (that is built automatically) is more accurate and contains less noise. 61. VerbHypernymsMCS Same as HypernymsMCS but computed on the target verb. 62. TokenSimilarWords Top 50 similar words to the lemma of the current token. The words are obtained using the DISCO Java library [4] and a word2vec [5] model computed on the English Wikipedia. 63. VerbSimilarWords Same as the previous feature, computed for the verb. 20 64. TokenMostSimilarLabels The most similar semantic classes to the cur- rent token. Exploiting the compositionality of word2vec vectors, a vector representing each semantic class is computed as the average of the vectors of the (lowercased and lemmatized) words that compose the name of the class. For example, the vector for the Abstract Entity class is the average of the vector for "abstract" and "entity". These vectors are precomputed for each semantic class, and then, given a token, its cosine similarity with every class is computed: the top 10 most similar classes are used as fea- tures. Real-valued features: 65. VerbPreps This feature is an indicator of how likely it is that the target verb takes a prepositional argument and how related the verb is to each preposition. To compute this, a list of all the words tagged advprep is gathered from the training and test set (see Appendix A for the complete list of words): most of these words are prepositions but some are not; nonetheless, I will refer to them as prepositions in this section because they are to be considered prepositional arguments for the verb. For each word p in this list, and each verb v in the training and test set, the probability that verb v has an adjacent preposition p is computed as: P (v + p) = count(v + p) count(v) where count(v + p) is the number of times that the verb occurs adja- cent to p and count(v) is the occurrences of the verb. These values are computed on a corpus of around 300000 pages taken from the English version of Wikipedia. This feature is similar to the one used in the verb classification module implemented in [6], with some differences. First of all, they compute both the probability that a verb takes a prepositional argument (based on the dependency parse tree) and the probability that the argument is adjacent to the verb: since dependency parsing is slow and requires a lot of time with limited computational power, especially if parsing of a lot of sentences is necessary, I preferred to only compute the probability of the preposition being adjacent to the verb, thus avoiding the need to parse each sentence, since, although this may be less precise, it is very likely that if a preposition is adjacent to a verb it is also one of its dependencies. Secondly, one value is computed for each preposition, instead of computing just one feature grouping all of them: this allows to differentiate verbs that are related to different prepositions from each other. For example, as can be seen from Table 12, that shows the value of this feature for the verb "continue", this verb is highly correlated with the preposition "to" and not, or slightly, correlated with all the other ones. Computing a value for each preposition allows to know which one of them the verb is more related to, instead of just knowing whether the verb is likely to take an unspecified prepositional argument. 21 to in on into through from over how 0.451 0.031 0.023 0.011 0.010 0.003 0.002 0.001 ... ... Table 12: Value of the VerbPreps feature for the verb "continue". It can be seen that the verb is highly correlated with the preposition "to" and slightly correlated with all the other ones. 66. VerbDistance The distance between the token and the target verb, mea- sured in number of tokens. 67. DepDepthDifference The difference in depth in the dependency parse tree between the token and the target verb. 68. ConDepthDifference The difference in depth in the constituency parse tree between the token and the target verb. 69. DepPathToVerbLength The length of the shortest directed path between the token and the target verb in the dependency parse tree. 70. ConPathToVerbLength The length of the path between the token and the target verb in the constituency parse tree. 22 B F-scores with respect to class fre- quency Figure 4: F-scores for semantic classes with respect to the class frequency in the training set. Classes whose f-score is 0 are not plotted. 23
1903.00122
1
1903
2019-03-01T01:43:11
Improving Grounded Natural Language Understanding through Human-Robot Dialog
[ "cs.CL", "cs.HC" ]
Natural language understanding for robotics can require substantial domain- and platform-specific engineering. For example, for mobile robots to pick-and-place objects in an environment to satisfy human commands, we can specify the language humans use to issue such commands, and connect concept words like red can to physical object properties. One way to alleviate this engineering for a new domain is to enable robots in human environments to adapt dynamically---continually learning new language constructions and perceptual concepts. In this work, we present an end-to-end pipeline for translating natural language commands to discrete robot actions, and use clarification dialogs to jointly improve language parsing and concept grounding. We train and evaluate this agent in a virtual setting on Amazon Mechanical Turk, and we transfer the learned agent to a physical robot platform to demonstrate it in the real world.
cs.CL
cs
Improving Grounded Natural Language Understanding through Human-Robot Dialog Jesse Thomason∗, Aishwarya Padmakumar†, Jivko Sinapov‡, Nick Walker∗, Yuqian Jiang†, Harel Yedidsion†, Justin Hart†, Peter Stone†, and Raymond J. Mooney† 9 1 0 2 r a M 1 ] L C . s c [ 1 v 2 2 1 0 0 . 3 0 9 1 : v i X r a Abstract -- Natural language understanding for robotics can require substantial domain- and platform-specific engineering. For example, for mobile robots to pick-and-place objects in an environment to satisfy human commands, we can specify the language humans use to issue such commands, and connect concept words like red can to physical object properties. One way to alleviate this engineering for a new domain is to enable robots in human environments to adapt dynamically -- continually learning new language constructions and perceptual concepts. In this work, we present an end-to-end pipeline for translating natural language commands to discrete robot actions, and use clarification dialogs to jointly improve language parsing and concept grounding. We train and evaluate this agent in a virtual setting on Amazon Mechanical Turk, and we transfer the learned agent to a physical robot platform to demonstrate it in the real world. I. INTRODUCTION As robots become ubiquitous across diverse human en- vironments such as homes, factory floors, and hospitals, the need for effective human-robot communication grows. These spaces involve domain-specific words and affordances, e.g., turn on the kitchen lights, move the pallet six feet to the north, and notify me if the patient's condition changes. Thus, pre-programming robots' language understanding can require costly domain- and platform-specific engineering. In this paper, we propose and evaluate a robot agent that leverages conversations with humans to expand an initially low-resource, hand-crafted language understanding pipeline to reach better common ground with its human partners. We combine bootstrapping better semantic parsing through signal from clarification dialogs [1], previously using no sensory representation of objects, with an active learning ap- proach for acquiring such concepts [2], previously restricted to object identification tasks. Thus, our system is able to execute natural language commands like Move a rattling container from the lounge by the conference room to Bob's office (Figure 5) that contain compositional language (e.g., lounge by the conference room understood by the semantic parser and objects to be identified by their physical properties (e.g., rattling container). The system is initialized with a small seed of natural language data for semantic parsing, and no initial labels tying concept words to physical objects, instead learning parsing and grounding as needed through human-robot dialog. of Washington. [email protected] ∗Paul G. Allen School of Computer Science and Engineering, University † Department of Computer Science, University of Texas at Austin. ‡Department of Computer Science, Tufts University. Fig. 1: Through dialog, a robot agent can acquire task- relevant information from a human on the fly. Here, rattling is a new concept the agent learns with human guidance in order to pick out a remote target object later on. Our contributions are: 1) a dialog strategy to improve language understanding given only a small amount of ini- tial in-domain training data; 2) dialog questions to acquire perceptual concepts in situ rather than from pre-labeled data or past interactions alone (Figure 1); and 3) a deployment of our dialog agent on a full stack, physical robot platform. We evaluate this agent's learning capabilities and usability on Mechanical Turk, asking human users to instruct the agent through dialog to perform three tasks: navigation (Go to the lounge by the kitchen), delivery (Bring a red can to Bob), and relocation (Move an empty jar from the lounge by the kitchen to Alice's office). We find that the agent receives higher qualitative ratings after training on information extracted from previous conversations. We then transfer the trained agent to a physical robot to demonstrate its continual learning process in a live human-robot dialog.1 II. RELATED WORK Research on the topic of humans instructing robots spans natural language understanding, vision, and robotics. Re- cent methods perform semantic parsing using sequence-to- sequence [3] -- [5] or sequence-to-tree [6] neural networks, but these require hundreds to thousands of examples. In human-robot dialog, gathering information at scale for a given environment and platform is unrealistic, since each data point comes from a human user having a dialog interaction in the same space as a robot. Thus, our methods assume only a small amount of seed data. Semantic parsing has been used as a language under- standing step in tasks involving unconstrained natural lan- guage instruction, where a robot must navigate an unseen environment [7] -- [11], to generate language requests regard- ing a shared environment [12], and to tie language to 1A demonstration video can be viewed at https://youtu.be/PbOfteZ_CJc?t=5. Would you usethe word "rattling"when describingthis object?This container hasproperties that other"rattling" objects have. Fig. 2: User commands are parsed into semantic slots (left), which are grounded (center) using either a known map (for rooms and people) or learned concept models (for objects) to a distribution over possible satisfying constants (e.g., all rooms that can be described as an "office"). A clarification dialog (right) is used to recover from ambiguous or misunderstood slots (e.g., Q1), and to improve concept models on the fly (e.g., Q2). planning [13] -- [16]. Other work memorizes new semantic referents in a dialog, like this is my snack [17], but does not learn a general concept for snack. In this work, our agent can learn new referring expressions and novel perceptual concepts on the fly through dialog. Mapping from a referring expression such as the red cup to a referent in the world is an example of the symbol grounding problem [18]. Grounded language learning bridges machine representations with natural language. Most work in this space has relied solely on visual perception [19] -- [24], though some work explores grounding using audio, haptic, and tactile signals produced when interacting with an ob- ject [25] -- [28]. In this work, we explicitly model perceptual predicates that refer to visual (e.g., red), audio (e.g., rattling), and haptic properties (e.g., full) of a fixed set of objects. We gather data for this kind of perceptual grounding using in- teraction with humans, following previous work on learning to ground object attributes and names through dialog [29] -- [33]. We take the additional step of using these concepts to accomplish a room-to-room, pick-and-place task instructed via a human-robot dialog. To our knowledge, there is no existing end-to-end, grounded dialog agent with multi-modal perception against which to compare, and we instead ablate our model during evaluation. III. CONVERSATIONAL AGENT We present a end-to-end pipeline (Figure 2) for an task- driven dialog agent that fulfills requests in natural language.2 2The source code for this dialog agent, as well as the deployments described in the following section, can be found at https://github.com/thomason-jesse/grounded_dialog_ agent. A. Semantic Parser The semantic parsing component takes in a sequence of words and infers a semantic meaning representation of the task. For example, a relocate task moves an item (patient) from one place (source) to another (goal) (Figure 2). The agent uses the Combinatory Categorial Grammar (CCG) formalism [34] to facilitate parsing. Word embeddings [35] augment the lexicon at test time to recover from out-of-vocabulary words, an idea similar in spirit to previous work [36], but taken a step further via formal integration into the agent's parsing pipeline. This allows, for example, the agent to use the meaning of known word take for unseen word grab at inference time. B. Language Grounding The grounding component takes in a semantic meaning representation and infers denotations and associated confi- dence values (Figure 2). The same semantic meaning can ground differently depending on the environment. For ex- ample, the office by the kitchen refers to a physical location, but that location depends on the building. Perceptual concepts like red and heavy require considering sensory perception of physical objects. The agent builds multi-modal feature representations of objects by exploring them with a fixed set of behaviors. In particular, before our experiments, a robot performed a grasp, lower, drop, press, and push behavior on every object, recording audio information from an onboard microphone and haptic information from force sensors in its arm. That robot also looked at each object with an RGB camera to get a visual representation. Summary audio, haptic, and visual features are created for each applicable behavior (e.g., drop-audio, look-vision), and these features represent objects at training lift, User: "Move a yellow can from the kitchen to the office."Semantic Parser::action: relocatesource kitchengoal officepatient: yellow & canClarification DialogQ1 - clarify goal. "To where should I move something from room_2?"Q2 - improve yellow model. "Would you use the word yellow when describing this object?"Language Grounder::Map-basedsource room_2 (1)goal room_1 (.33), room_4 (.33), room_5 (.33)Concept Model-basedpatient: (.4), (.4), (.2) If Q2: re-train yellow model given new user annotation and update patient confidences.If Q1: re-run semantic parseron new user goal phrase. Min Prob B max per role (action, patient, recipient, source, goal) B Role (∅, ∅, ∅, ∅, ∅) (walk, ∅, ∅, ∅, r1) (deliver, ∅, p1, ∅, ∅) (relocate, ∅, ∅, ∅, ∅) (relocate, o1, ∅, r1, r2) All action patient source - Question Type What should I do? You want me to go somewhere? What should I deliver to p1? Where should I move something from on its way somewhere else? You want me to move o1 from r1 to r2? Clarification Confirmation Clarification Clarification Confirmation TABLE I: Samples of the agent's static dialog policy π for mapping belief states to questions. and inference time both in simulation and the real world.3 Feature representations of objects are connected to lan- guage labels by learning discriminative classifiers for each concept using the methods described in previous work [31], [37]. In short, each concept is represented as an ensemble of classifiers over behavior-modality spaces weighted according to accuracy on available data (so yellow weighs look-vision highly, while rattle weighs drop-audio highly). While the objects have already been explored (i.e., they have feature representations), language labels must be gathered on the fly from human users to connect these features to words. Different predicates afford the agent different certainties. Map-based facts such as room types (office) can be grounded with full confidence. For words like red, perceptual concept models give both a decision and a confidence value in [0, 1]. Since there are multiple possible groundings for ambiguous utterances like the office, and varied confidences for per- ceptual concept models on different objects, we associate a confidence distribution with the possible groundings for a semantic parse (Figure 2). C. Clarification Dialog We denote a dialog agent with A. Dialog begins with a human user commanding the agent to perform a task, e.g., grab the silver can for alice. The agent maintains a belief state modeling the unobserved true task in the user's mind, and uses the language signals from the user to infer that task. The command is processed by the semantic parsing and grounding components to obtain pairs of denotations and their confidence values. Using these pairs, the agent's belief state is updated, and it engages in a clarification dialog to refine that belief (Figure 2). The belief state, B, is a mapping from semantic roles (components of the task) to probability distributions over the known constants that can fill those roles (action, patient, recipient, source, and goal). The belief state models uncer- tainties from both the semantic parsing (e.g., prepositional ambiguity in "pod by the office to the north"; is the pod or the office north?) and language grounding (e.g., noisy concept models) steps of language understanding. The belief states for all roles are initialized to uniform probabilities over constants.4 We denote the beliefs from a single utterance, x, as Bx, itself a mapping from semantic 3That is, at inference time, while all objects have been explored, the language concepts that apply to them (e.g., heavy) must be inferred from their feature representations. 4Half the mass of non-action roles is initialized on the ∅ constant, a prior indicating that the role is not relevant for the not-yet-specified action. roles to the distribution over constants that can fill them. The agent's belief is updated with B(r, a) ← (1 − ρ)B(r, a) + ρBx(r, a), (1) for every semantic role r and every constant a. The parameter ρ ∈ [0, 1] controls how much to weight the new information against the current belief.5 After a belief update from a user response, the highest- probability constants for every semantic role in the current belief state B are used to select a question that the agent expects will maximize information gain. Table I gives some examples of the policy π. For updates based on confirmation question responses, the confirmed Bx constant(s) receive the whole probability mass for their roles (i.e., ρ = 1). If a user denies a confirmation, Bx is constructed with the constants in the denied question given zero probability for their roles, and other constants given uniform probability (so Equation 1 reduces the belief only for denied constants). A conversation concludes when the user has confirmed every semantic role. D. Learning from Conversations The agent improves its semantic parser by inducing train- ing data over finished conversations. Perceptual concept models are augmented on the fly from questions asked to a user, and are then aggregated across users in batch. a) Semantic Parser Learning From Conversations: The agent identifies utterance-denotation pairs in conversations by pairing the user's initial command with the final confirmed action, and answers to questions about each role with the confirmed role (e.g., robert's office as the goal location r1), similar to prior work [1]. Going beyond prior work, the agent then finds the latent parse for the pair: a beam of parses is created for the utterance, and these are grounded to discover those that match the target denotation. The agent then retrains its parser given these likely, latent utterance-semantic parse pairs as additional, weakly-supervised examples of how natural language maps to semantic slots in the domain. b) Opportunistic Active Learning: Some unseen words are perceptual concepts. If one of the neighboring words of unknown word xi is associated with a semantic form involving a perceptual concept, the agent asks: I haven't heard the word 'xi' before. Does it refer to properties of things, like a color, shape, or weight? If confirmed, the agent ranks the nearest neighbors of xi by distance and sequentially asks the user whether the next nearest neighbor 5We set ρ = 0.5 for clarification updates. tp is a synonym of xi. If so, new lexical entries are created to allow xi to function like tp, including sharing an underlying concept model (e.g., in our experiments, tall was identified as a synonym of the already-known word long). Otherwise, a new concept model is created for xi (e.g., in our experiments, the concept red). We introduce opportunistic active learning questions [2] as a sub-dialog, in which the agent can query about training objects local to the human and the robot (Figure 5). This facilitates on the fly acquisition of new concepts, because the agent can ask the user about nearby objects, then apply the learned concept to remote test objects (Section IV-C). IV. EXPERIMENTS We hypothesize that the learning capabilities of our agent will improve its language understanding and usability. We also hypothesize that the agent trained in a simplified world simulation on Mechanical Turk can be deployed on a phys- ical robot, and can learn non-visual concepts (e.g., rattling) on the fly that could not be acquired in simulation. A. Experiment Design The agent (and corresponding robot) can perform three high-level tasks: navigation (the agent goes to a location), delivery (the agent takes an object to a person), and re- location (the agent takes an object from a source location to a goal location). We denote 8 (randomly selected) of the 32 objects explored in prior work [38] as test objects and the remaining 24 as training objects available for active learning queries. We randomly split the set of possible task instantiations (by room, person, and object arguments) into initialization (10%), train (70%), and test sets (20%). a) Initialization Phase: Sixteen users (graduate stu- dents) were shown one of each type of task (from the initialization set) and gave two high-level natural language commands for each (initial and rephrasing). We used a subset of these utterances6 as a scaffold on which to build a seed language-understanding pipeline: an initial lexicon and a set of 44 utterance-semantic parse pairs, D0.7 b) Training Procedure: The initial pipeline is used by a baseline agent A1; we denote its parser P1 trained on D0, and denote untrained concept models for several predicates Pc,1. That is, the initial lexicon contains several concept words (like yellow), but no labels between objects and these concepts. All learning for the parsing and perception modules arises from human-agent conversations. We divide the training procedure into three phases, each associated with 8 different objects from the active training set of 24. The perceptual concept models are retrained on the fly during conversations as questions are asked (e.g., as in Figure 1). The parsing model is retrained between phases. Each phase i is carried out by agent Ai, and training on all phase conversations yields agent Ai+1 using concept models Pi+1 and parser Pc,i+1. In each phase of training, 6Commands that would introduce rare predicates were dropped. 7An experimenter performed the annotations to create these resources in about two hours. Fig. 3: The agent asks questions to clarify the command through dialog. Each clarification is used to induce weakly- supervised training examples for the agent's semantic parser. and when evaluating agents in different conditions, we recruit 150 Mechanical Turk workers with a payout of $1 per HIT. c) Testing and Performance Metrics: We test agent A3 with parser P3 and perception models Pc,3 against unseen tasks,8 and denote it Trained (Parsing+Perception). We also test an ablation agent, A∗ 1 and perception models Pc,4 (trained perception models with an initial, baseline parser with parsing rules only added for new concept model words), and denote it Trained (Perception). These agents are compared against the baseline agent A1, denoted Initial (Seed). 4, with parser P∗ We measure the number of clarification questions asked during the dialog to accomplish the task correctly. This metric should decrease as the agent refines its parsing and perception modules, needing to ask fewer questions about the unseen locations and objects in the test tasks. We also consider users' answers to survey questions about usability. Each question was answered on a 7-point Likert scale: from Strongly Disagree (1) to Strongly Agree (7). B. Mechanical Turk Evaluation We prompt users with instructions like: Give the robot a command to solve this problem: The robot should be at the X marked on the green map, with a green-highlighted map marking the target. Users are instructed to command the 8Empirically, parser P4 overfits the training data, so we evaluate with 4, this is not a concern since the initial parser parameters P∗ 1 P3. For A∗ are used. Agent In Tr∗ Tr Navigation (p) 3.02 ± 6.48 4.05 ± 8.81(.46) 1.35 ± 4.44(.11) Clarification Questions ↓ Delivery (p) 6.81 ± 8.69 8.16 ± 13.8(.53) 7.50 ± 9.93(.72) Relocation (p) 22.3 ± 9.15 23.5 ± 6.07(.67) 19.6 ± 7.89(.47) TABLE II: The average number of clarification questions agents asked among dialogs that reached the correct task. Also given are the p-values of a Welch's t-test between the Trained∗ (Perception) and Trained (Parsing+Perception) model ratings against the Initial model ratings. Usability Survey (Likert 1-7) ↑ Agent In Tr∗ Tr Navigation (p) 3.09 ± 2.04 3.51 ± 2.05(.09) 3.763.763.76 ± 2.07(.01) Delivery (p) 3.20 ± 2.12 3.60 ± 2.09(.12) 3.873.873.87 ± 2.10(.01) Relocation (p) 3.37 ± 2.17 3.60 ± 2.08(.37) 3.933.933.93 ± 2.16(.04) TABLE III: The average Likert rating given on usabil- ity survey prompts for each task across the agents. Bold indicates an average Trained∗ (Perception) and Trained (Parsing+Perception) model ratings significantly higher than the Initial model (p < 0.05) under a Welch's t-test. robot to perform a navigation, delivery, and relocation task in that order. The simple, simulated environment in which the instructions were grounded reflects a physical office space, allowing us to transfer the learned agent into an embodied robot (Section IV-C). Users type answers to agent questions or select them from menus (Figure 3). For delivery and relocation, target objects are given as pictures. Pictures are also shown alongside concept questions like Would you use the word 'rattling' when describing this object? Table II gives measures of the agents' performance in terms of the number of clarification questions asked before reaching the correct task specification to perform. For both navigation and relocation, there is a slight decrease in the number of questions between the Initial agent and the Trained (Parsing+Perception) agent. The Trained (Percep- tion) agent which only retrains and adds new concept models from conversation history sees slightly worse performance across tasks, possibly due to a larger lexicon of adjectives and nouns (e.g., can as a descriptive noun now polysemous with can as a verb -- can you...) without corresponding parsing up- dates. None of these differences are statistically significant, possibly because comparatively few users completed tasks correctly, necessary to use this metric.9 Table III gives measures of the agents' performance in terms of qualitative survey prompt responses from workers. Prompts were: I would use a robot like this to help navigate a new building, I would use a robot like this to get items for myself or others, and I would use a robot like this to move items from place to place. Across tasks, the Trained (Parsing+Perception) agent novel to this work is rated as more usable than both the Initial agent and the Trained 9Across agents, an average of 42%, 39%, and 9.5% workers completed navigation, delivery, and relocation tasks correctly, respectively. A necessary step in future studies is to improve worker success rates, possibly through easier interfaces, faster HITs, and higher payouts. Learned Concept Model for can 0.32 0.22 0.2 0.13 0.07 0.03 0.03 0 Fig. 4: Confidence distribution for the can concept model on the unseen test set objects after training. (Perception) agent that updated only its concept models from training conversations. The agent acquired new perceptual concept models (25 in total), and synonym words for existing concepts during training. Figure 4 shows the learned model for can on unseen test objects. The agent's ordering of test objects' can-ness qualitatively matches intuition. C. Physical Robot Implementation The browser-interfaced, Mechanical Turk agent enabled us to collect controlled training data, but our end goal is a human-robot interface in a physically shared environment. To establish that the agent and learning pipeline are robust and efficient enough to operate on real hardware in a live setting, we complement our Mechanical Turk evaluation with a demonstration of an embodied robot agent (Figure 5). We use the BWIBot [39], [40], which can perceive and manipulate objects (Xtion ASUS Pro camera, Kinova MICO arm), navigate autonomously (Hokuyo lidar), record and transcribe human speech (Blue Snowball microphone, Google Speech API10), and verbalize audio responses (Fes- tival Speech Synthesis System11). Tabletop perception is implemented with RANSAC [41] plane fitting and Euclidean clustering as provided by the Point Cloud Library [42]. The agent is trained on Mechanical Turk conversations, transferring learned linguistic (e.g., lounge by the conference room) and perceptual (e.g., object classes like can) knowl- edge across platforms from simple simulation to real world application. In a live human-robot dialog, an experimenter tells the agent to move a rattling container from the lounge by the conference room to bob's office, requiring the agent to select correct rooms and to learn the new, audio-grounded word rattling from the human user.12 V. CONCLUSION This paper proposes a robotic agent that leverages conver- sations with humans to expand small, hand-crafted language understanding resources both for translating natural language commands to abstract semantic forms and for grounding those abstractions to physical object properties. We make 10https://cloud.google.com/speech/ 11http://www.cstr.ed.ac.uk/projects/festival/ 12Demonstration video: https://youtu.be/PbOfteZ_CJc?t=5. R: What should I do? H: Move a rattling container from the lounge by the conference room to Bob's office. R: Does rattling refer to a property of H: Yes. R: Does rattling mean the same thing an object? as empty? H: No. R: R: I am still learning the meanings of some words. Show me an object you could use the word rattling when describing, or say "none of them." H: Watch. R: I am getting the objects on the table into focus. . . Okay, I see them. H: This one. The human picks up a small, full pill jar. R: R: R: R: I see. Show me an object you could not use the word rattling when describing, or say "all of them." H: Watch. This one. The human picks up a red water bottle. I see. Show me an object you could use the word rattling when describing, or say "none of them." H: Watch. This one. The human picks up a container half-full of beans. R: I see. R: Thanks. Now back to business. R: You want me to move an item from 3.514 to somewhere? H: Yes. R: H: Yes. I should move something from 3.514 to 3.510? [room numbers] (a) The human says move a rat- tling container. (b) The robot asks questions about local items to learn rattling. (c) The robot moves to the speci- fied location. (d) The robot infers and grasps a rattling container. (e) The robot navigates to the spec- ified destination room. (f) The robot hands over the item at the specified destination. Fig. 5: The Trained (Parsing+Perception) agent continues learning on the fly to achieve the specified goal. several key assumptions, and promising areas of future work involve removing or weakening those assumptions. In this work, the actions the robot can perform can be broken down into tuples of discrete semantic roles (e.g., patient, source), but, in general, robot agents need to reason about more continuous action spaces, and to acquire new, previously unseen actions from conversations with humans [15]. When learning from conversations, we also assume the human user is cooperative and truthful, but detecting and dealing with combative users is necessary for real world deployment, and would improve learning quality from Mechanical Turk dialogs. Making a closed world assumption, our agent has explored all available objects in the environment, but detect- ing and exploring objects on the fly using only task relevant behaviors [43], [44] would remove this restriction. Finally, dealing with complex adjective-noun dependencies (e.g., a fake gun is fake but is not a gun) and graded adjectives (e.g., a heavy mug weighs less than a light suitcase) is necessary to move beyond simple, categorical object properties like can. We hope that our agent and learning strategies for an end-to-end dialog system with perceptual connections to the real world inspire further research on grounded human-robot dialog for command understanding. ACKNOWLEDGEMENTS This work was supported by a National Science Founda- tion Graduate Research Fellowship to the first author, an NSF EAGER grant (IIS-1548567), and an NSF NRI grant (IIS- 1637736). This work has taken place in the Learning Agents Research Group (LARG) at UT Austin. LARG research is supported in part by NSF (CNS-1305287, IIS-1637736, IIS-1651089, IIS-1724157), TxDOT, Intel, Raytheon, and Lockheed Martin. REFERENCES [1] J. Thomason, S. Zhang, R. Mooney, and P. Stone, "Learning to interpret natural language commands through human-robot dialog," in Proceedings of the 24th International Joint Conference on Artificial Intelligence (IJCAI), July 2015. [2] J. Thomason, A. Padmakumar, J. Sinapov, J. Hart, P. Stone, and R. J. Mooney, "Opportunistic active learning for grounding natural language descriptions," in Proceedings of the 1st Annual Conference on Robot Learning (CoRL), vol. 78. Proceedings of Machine Learning Research, November 2017. [3] T. Kocisk`y, G. Melis, E. Grefenstette, C. Dyer, W. Ling, P. Blun- som, and K. M. Hermann, "Semantic parsing with semi-supervised sequential autoencoders," in Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. Austin, Texas: Association for Computational Linguistics, November 2016. [4] R. Jia and P. Liang, "Data recombination for neural semantic parsing," in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), 2016. [5] I. Konstas, S. Iyer, M. Yatskar, Y. Choi, and L. Zettlemoyer, "Neural amr: Sequence-to-sequence models for parsing and generation," in Proceedings of the 2017 Conference of the Association for Compu- tational Linguistics (ACL), 2017. [6] L. Dong and M. Lapata, "Language to logical form with neural atten- tion," in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), 2016. [7] T. Kollar, S. Tellex, D. Roy, and N. Roy, "Toward understanding natural language directions," in Proceedings of the 5th ACM/IEEE International Conference on Human-robot Interaction, ser. HRI '10, 2010. [8] C. Matuszek, E. Herbst, L. Zettlemoyer, and D. Fox, "Learning to language commands to a robot control system," in parse natural International Symposium on Experimental Robotics (ISER), 2012. [9] P. Anderson, Q. Wu, D. Teney, J. Bruce, M. Johnson, N. Sunderhauf, I. Reid, S. Gould, and A. van den Hengel, "Vision-and-Language Nav- igation: Interpreting visually-grounded navigation instructions in real environments," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. [10] X. Wang, W. Xiong, H. Wang, and W. Yang Wang, "Look before you leap: Bridging model-free and model-based reinforcement learning for planned-ahead vision-and-language navigation," in The European Conference on Computer Vision (ECCV), 2018. [11] P. Shah, M. Fiser, A. Faust, J. C. Kew, and D. Hakkani-Tur, "Fol- lownet: Robot navigation by following natural language directions with deep reinforcement learning," in International Conference on Robotics and Automation (ICRA) Third Workshop in Machine Learn- ing in the Planning and Control of Robot Motion, 2018. [12] S. Tellex, R. Knepper, A. Li, D. Rus, and N. Roy, "Asking for help using inverse semantics," in Proceedings of Robotics: Science and Systems (RSS), Berkeley, California, 2014. [13] E. C. Williams, N. Gopalan, M. Rhee, and S. Tellex, "Learning to parse natural language to grounded reward functions with weak supervision," in International Conference on Robotics and Automation (ICRA), 2018. [14] R. Skoviera, K. Stepanova, M. Tesar, G. Sejnova, J. Sedlar, M. Vavrecka, R. Babuska, and J. Sivic, "Teaching robots to imitate a human with no on-teacher sensors. what are the key challenges?" in International Conference on Intelligent Robots and Systems (IROS) Workshop on Towards Intelligent Social Robots: From Naive Robots to Robot Sapiens, 2018. [15] J. Y. Chai, Q. Gao, L. She, S. Yang, S. Saba-Sadiya, and G. Xu, "Language to action: Towards interactive task learning with physical agents," in Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI), 2018. [16] D. Nyga, S. Roy, R. Paul, D. Park, M. Pomarlan, M. Beetz, and N. Roy, "Grounding robot plans from natural language instructions with incomplete world knowledge," in Conference on Robot Learning (CoRL), 2018. [17] R. Paul, A. Barbu, S. Felshin, B. Katz, and N. Roy, "Temporal grounding graphs for language understanding with accrued visual- linguistic context," in Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence (IJCAI), 2017. [18] S. Harnad, "The symbol grounding problem," Physica D, vol. 42, pp. 335 -- 346, 1990. [19] C. Matuszek, N. FitzGerald, L. Zettlemoyer, L. Bo, and D. Fox, "A joint model of language and perception for grounded attribute learning," in Proceedings of the 29th International Conference on Machine Learning, Edinburgh, Scotland, UK, 2012. [20] N. FitzGerald, Y. Artzi, and L. Zettlemoyer, "Learning distributions over logical forms for referring expression generation," in Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. Seattle, Washington, USA: Association for Computa- tional Linguistics, October 2013. [21] J. Krishnamurthy and T. Kollar, "Jointly learning to parse and perceive: Connecting natural language to the physical world," Transactions of the Association for Computational Linguistics (TACL), 2013. [22] L. Zitnick and D. Parikh, "Bringing semantics into focus using visual abstraction," in Computer Vision and Pattern Recognition (CVPR), December 2013. [23] Y. Bisk, K. J. Shih, Y. Choi, and D. Marcu, "Learning interpretable spatial operations in a rich 3d blocks world," in Thirty-Second AAAI Conference on Artificial Intelligence, 2018. [24] N. Pillai and C. Matuszek, "Unsupervised selection of negative examples for grounded language learning," in Thirty-Second AAAI Conference on Artificial Intelligence, 2018. [25] V. Chu, I. McMahon, L. Riano, C. G. McDonald, Q. He, J. M. Perez-Tejada, M. Arrigo, N. Fitter, J. C. Nappo, T. Darrell, et al., "Using robotic exploratory procedures to learn the meaning of haptic adjectives," in International Conference on Robotics and Automation (ICRA), 2013. [26] G. Orhan, S. Olgunsoylu, E. S¸ahin, and S. Kalkan, "Co-learning nouns and adjectives," in 2013 IEEE Third Joint International Conference on Development and Learning and Epigenetic Robotics (ICDL). IEEE, 2013. [27] T. Nakamura, T. Nagai, K. Funakoshi, S. Nagasaka, T. Taniguchi, and N. Iwahashi, "Mutual learning of an object concept and language model based on mlda and npylm," in 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, 2014. [28] Y. Gao, L. A. Hendricks, K. J. Kuchenbecker, and T. Darrell, "Deep learning for tactile understanding from visual and haptic data," in International Conference on Robotics and Automation (ICRA), 2016. [29] A. Vogel, K. Raghunathan, and D. Jurafsky, "Eye spy: Improving vision through dialog," in Association for the Advancement of Artificial Intelligence (AAAI), 2010. [30] N. Parde, A. Hair, M. Papakostas, K. Tsiakas, M. Dagioglou, V. Karkaletsis, and R. D. Nielsen, "Grounding the meaning of words through vision and interactive gameplay," in Proceedings of the 24th International Joint Conference on Artificial Intelligence (IJCAI), Buenos Aires, Argentina, 2015. [31] J. Thomason, J. Sinapov, M. Svetlik, P. Stone, and R. Mooney, "Learning multi-modal grounded linguistic semantics by playing "I spy"," in Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI), July 2016. [32] J. Yang, J. Lu, S. Lee, D. Batra, and D. Parikh, "Visual curiosity: Learning to ask questions to learn visual recognition," in Conference on Robot Learning (CoRL), 2018. [33] A. Vanzo, J. L. Part, Y. Yu, D. Nardi, and O. Lemon, "Incrementally learning semantic attributes through dialogue interaction," in Proceed- ings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, 2018. [34] M. Steedman and J. Baldridge, "Combinatory categorial grammar," in Non-Transformational Syntax: Formal and Explicit Models of Grammar, R. Borsley and K. Borjars, Eds. Wiley-Blackwell, 2011. [35] T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean, "Dis- tributed representations of words and phrases and their composition- ality," in Proceedings of the 26th International Conference on Neural Information Processing Systems, Lake Tahoe, Nevada, 2013. [36] E. Bastianelli, D. Croce, A. Vanzo, R. Basili, and D. Nardi, "A discriminative approach to grounded spoken language understanding in interactive robotics." in Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI), July 2016. [37] J. Sinapov, C. Schenck, and A. Stoytchev, "Learning relational object categories using behavioral exploration and multimodal perception," in IEEE International Conference on Robotics and Automation (ICRA), 2014. [38] J. Sinapov, P. Khante, M. Svetlik, and P. Stone, "Learning to order objects using haptic and proprioceptive exploratory behaviors," in Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI), 2016. [39] P. Khandelwal, F. Yang, M. Leonetti, V. Lifschitz, and P. Stone, "Planning in Action Language BC while Learning Action Costs for Mobile Robots," in Proceedings of the International Conference on Automated Planning and Scheduling (ICAPS), 2014. [40] P. Khandelwal, S. Zhang, J. Sinapov, M. Leonetti, J. Thomason, F. Yang, I. Gori, M. Svetlik, P. Khante, V. Lifschitz, J. K. Aggarwal, R. Mooney, and P. Stone, "BWIBots: A platform for bridging the gap between ai and human -- robot interaction research," The International Journal of Robotics Research (IJRR), vol. 36, February 2017. [41] M. A. Fischler and R. C. Bolles, "Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography," Commun. ACM, vol. 24, no. 6, June 1981. [42] R. B. Rusu and S. Cousins, "3D is here: Point Cloud Library (PCL)," in IEEE International Conference on Robotics and Automation (ICRA), Shanghai, China, 2011. [43] J. Thomason, J. Sinapov, R. Mooney, and P. Stone, "Guiding ex- ploratory behaviors for multi-modal grounding of linguistic descrip- tions," in Proceedings of the 32nd Conference on Artificial Intelligence (AAAI), February 2018. [44] S. Amiri, S. Wei, S. Zhang, J. Sinapov, J. Thomason, and P. Stone, "Multi-modal predicate identification using dynamically learned robot controllers," in Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI-18), July 2018.
1909.09595
1
1909
2019-09-13T05:59:40
SANVis: Visual Analytics for Understanding Self-Attention Networks
[ "cs.CL", "cs.LG", "cs.NE" ]
Attention networks, a deep neural network architecture inspired by humans' attention mechanism, have seen significant success in image captioning, machine translation, and many other applications. Recently, they have been further evolved into an advanced approach called multi-head self-attention networks, which can encode a set of input vectors, e.g., word vectors in a sentence, into another set of vectors. Such encoding aims at simultaneously capturing diverse syntactic and semantic features within a set, each of which corresponds to a particular attention head, forming altogether multi-head attention. Meanwhile, the increased model complexity prevents users from easily understanding and manipulating the inner workings of models. To tackle the challenges, we present a visual analytics system called SANVis, which helps users understand the behaviors and the characteristics of multi-head self-attention networks. Using a state-of-the-art self-attention model called Transformer, we demonstrate usage scenarios of SANVis in machine translation tasks. Our system is available at http://short.sanvis.org
cs.CL
cs
SANVis: Visual Analytics for Understanding Self-Attention Networks Cheonbok Park* Korea University Bum Chul Kwon§ Inyoup Na* Korea University Jian Zhao¶ IBM Research University of Waterloo Yongjang Jo† Korea University Hyungjong Noh NCSOFT Co., LTD. Sungbok Shin‡ University of Maryland Yeonsoo Lee NCSOFT Co., LTD. Jaehyo Yoo* Korea University Jaegul Choo* Korea University Figure 1: Overview of SANVis. (A) The network view displays multiple attention patterns for each layer according to three type of visualization options: (A-1) the attention piling option, (A-2) the Sankey diagram option, and (A-3) the small multiples option. (A-4) The bar chart shows the average attention weights for all heads (each colored with its corresponding hue) per each layer. (B) The HeadLens view helps the user analyze what the attention head learned by showing representative words and by providing statistical information of part-of-speech tags and positions. ABSTRACT Attention networks, a deep neural network architecture inspired by humans' attention mechanism, have seen significant success in im- age captioning, machine translation, and many other applications. Recently, they have been further evolved into an advanced approach called multi-head self-attention networks, which can encode a set of input vectors, e.g., word vectors in a sentence, into another set of vectors. Such encoding aims at simultaneously capturing diverse syntactic and semantic features within a set, each of which corre- sponds to a particular attention head, forming altogether multi-head attention. Meanwhile, the increased model complexity prevents users from easily understanding and manipulating the inner workings of models. To tackle the challenges, we present a visual analytics sys- tem called SANVis, which helps users understand the behaviors and the characteristics of multi-head self-attention networks. Using a state-of-the-art self-attention model called Transformer, we demon- strate usage scenarios of SANVis in machine translation tasks. Our system is available at http://short.sanvis.org. *{cb park, windy9898, vkfwlsdhs, jchoo}@korea.ac.kr †[email protected][email protected] §[email protected][email protected]; work was completed while at FXPAL. {nohhj0209,yeonsoo}@ncsoft.com Index Terms: Deep neural networks, visual analytics, natural lan- guage processing, interpretability, self-attention networks 1 INTRODUCTION Attention-based deep neural networks, inspired by humans' attention mechanism, are widely used for sequence-to-sequence modeling, e.g., neural machine translation The attention module allows the model to dynamically utilize different parts of the input sequence, which leads to state-of-the-art performances in natural language processing (NLP) tasks [4, 14, 32]. However, conventional approaches using recurrent neural net- works (RNNs) had limitations that (1) they utilize only a single attention module that can capture only a particular characteristic of a given input and that (2) they cannot properly capture long-range dependencies due to the loss in memory content over multiple time steps. To address these limitations, Vaswani et al. [26] recently proposed multi-head self-attention networks (in short, self-attention networks), which replace an RNN-based sequence encoding module with a so- phisticated attention module. This module is composed of multiple different attention heads, each of which captures its own syntactic and/or semantic features within a set. Owing to these advantages, self-attention-based models have achieved state-of-the-art perfor- mances in machine translation, and it has been further extended in other NLP tasks [8, 20] and computer vision domains [31, 35]. However, their highly sophisticated model architecture prevents users from deeply understanding and interacting with them. In re- sponse, this paper presents a visual analytics system for self-attention networks, called SANVis, as well as its comprehensive usage sce- narios using widely-used networks called Transformer [26]. Figure 3: Diverse attention patterns found in the encoder of Trans- former. Some attention heads show diagonal patterns indicating that a query word attends to itself (1) or its immediate previous (5) or next word (3). Some other attention heads attend to a common, single word (2). In other attention heads, each group of consecutive words attends commonly to a single word within that group (4). vectors, and the decoder turns the vectors into a sequence of output words (e.g., French words). Each encoder and decoder respectively consists of multiple lay- ers of computing functions inside. Furthermore, each layer in the encoder includes two sequential sub-layers, which are a multi-head self-attention and a position-wise feed-forward network. In addition to the multi-layer architecture of the encoder, the decoder has an additional attention layer, which is called as an encoder-decoder attention and helps the model to give attention to the encoders' in- ternal states. Each layer of both encoder and decoder also consists of skip-connection and layer normalization in their computation pipeline. Overall encoder and decoder architecture are the stacks of L identical encoder layers or decoder layers, including an embedding layer. We summarize the computation process with mathematical nota- tions, so readers are advised to read the remaining section for details: Let us denote dmodel as the size of hidden state vector and h as the number of heads in multi-head self-attention. Each dimension of query, key, and value vector is dq = dk = dv = dmodel/h. The embedding layer transforms the input token xi to its embed- ding space ei using a word embedding and adds the position informa- tion for each input token using sinusoidal functions (see Steps 1 and 2 in Figure 2), where xi is the i-th input token in X = [x1,··· ,xT ]. At each attention head, we transform encoded word vectors into three matrices of a query, a key, and a value, Q ∈ RT×dq, K ∈ RT×dk , and V ∈ RT×dv, respectively, for h times, which in turn generated h×3 matrices, using the linear transformation and compute the attention-weighted combinations of value vectors as (cid:16) QKT√ dmodel (cid:17) (cid:17) V (1) (cid:16) QW Q i ,VWV i ,KW K i Attention(Q,K,V )= Softmax MultiHeadAttention= Concat (head1, . . . ,headh)W O , and W Q i where headi = Attention i and W K indicate the linear transformation matrices at the i-th head. In i multi-head self-attention, which consists of h parallel attention heads, transformation matrices of each head are randomly initialized, and then each set is used to project input vectors onto a different repre- sentation subspace. For this reason, every attention head is allowed to have different attention shapes and patterns. This characteristic en- courages each head differently to attend adjacent words or linguistics relation words. , WV In the encoder layer, source words (input words to the encoder) work as the input to the query, key, and value transformations at the i-th head. In the decoder layer, the input can vary by attention types. While the decoders' self-attention takes target words (output words of the decoder) as its input, the encoder-decoder attention has target words as input to a query transformation but source words as the input to a key and a value transformation. Figure 2: How a multi-head self-attention module works. Steps 1 and 2 correspond to the embedding layer, while Steps 3 to 6 correspond to a single-layer multi-head self-attention module. 2 RELATED WORK We discuss related work from two perspectives: (1) visual analytic approaches for interpreting and interacting with various deep neu- ral networks and (2) interpretation and analysis of self-attention networks mainly in NLP domains. Regarding the former, various visual analytic approaches have been proposed for convolutional neural networks mainly com- puter vision domains [2, 6, 12, 13, 19, 34] and RNNs in NLP do- mains [5, 11, 17, 23, 24]. Visual analytic approaches have also been integrated with other advanced neural network architectures, such as generative adversarial networks [9, 30], deep reinforcement learn- ing [29]. Among them, Strobelt et al. [22] developed a visual analytic system for RNN-based attention models, mainly for the exploration and understanding of sequence-to-sequence modeling tasks. How- ever, despite the success of multi-head self-attention networks, such as BERT [8] and XLNet [33], visual analytic approaches for these advanced attention networks have not existed before. In NLP domains, recent studies [7, 8, 27] have analyzed diverse behaviors of different attention heads in a self-attention model and have drawn linguistic interpretations as to what kind of syntactic and/or semantic features each attention head captures. Another line of research [25, 28] have attempted to leverage insights obtained from such in-depth analysis to improve the prediction accuracy and computational efficiency by, say, removing unnecessary heads and refining them. However, these approaches have not properly utilized the potential of interactive visualization, so in this respect, our work is one of the first sophisticated visual analytics systems for self-attention networks. 3 PRELIMINARIES: SELF-ATTENTION NETWORKS This section briefly reviews the self-attention module originally pro- posed in Transformer [26]. Transformer adopts an encoder-decoder architecture to solve sequence-to-sequence learning tasks, e.g., neu- ral machine translation, which converts a sentence in one language into that in another language. It converts a sequence of words in one domain into that in another domain. For example, for machine translation tasks, it translates a sentence in one language into that in another language. In this process, the encoder of Transformer converts input words (e.g., English words) to internal, hidden-state Figure 4: Attention sorting result. The user can sort a set of multiple attention patterns with respect to different criteria such as the entropy measure (A) and the relative positional offset from query words (B). 4 DESIGN RATIONALE We consider our design rationale of SANVis as follows: R1: Grasping the information flow across multiple layers. R2: Identifying and making sense of attention patterns of each attention head. R3: Visualizing syntactic and semantic information to allow of exploring the attention head in their query and key vectors. 5 SANVIS We present SANVis,1 a visual analytics system for deep under- standing of self-attention models, as shown in Figure 1. SANVis is composed of the network view and the HeadLens view. (1) The network view allows the user to understand the overall information flow through our visualization across the multiple layers (T1). More- over, this view provides additional visualization options that assist the user in distinguishing distinct patterns from multiple attention patterns within a layer (T2). (2) The HeadLens view reveals the characteristics of the query and the key vectors and their relationship of a particular head (T3). 5.1 Network View Network view mainly visualizes the overview of attention patterns across multiple layers using the Sankey diagram (T1). Additionally, this view supports 'piling' and 'sorting' capabilities to understand common as well as distinct attention patterns among multiple atten- tion heads (T2). For example, one can replace the Sankey diagram with a multiple heatmap view, where multiple heatmaps correspond- ing to different heads can be sorted by several different criteria (Figure, 1 (A-3)). The attention piling view aggregates multiple attention patterns into a small number of clusters (Figure 1(A-1)). As shown in Figure 1(A), a set of words are sequentially aligned vertically in each layer, and represented the histogram according to attention weights from multiple heads. In Figure 1(A-4), each bar corresponds to a particular head within the layer where its height represents the total amount of attention weights assigned to those words by a specific head. As with Figure 1(A-2), if the fourth head in the layer attended to the word 'planet' more highly than others, the fourth bar would be higher than the others. In this manner, the user easily recognizes which heads highly attend those words based on the height of histogram bars. Furthermore, when the user moves the mouse over the particular color bar, we show an attention heat map of the corresponding head in that layer. Sankey diagram. As shown in Figure 1(A-2), the edge weight between them represents the average attention weight across multiple heads within a particular layer. In this figure, we can see the strong link between 'planet' in layer 2 to the preposition words('on'), the same word and that article('the') in layer 3. It means a significant amount of information of 'planet' in layer 2 is conveyed to encode each word of a phrase ("on the planet") in layer 3. This pattern shows the model captures the context meaning of the word, which is 1Our demo is available at http://short.sanvis.org. Figure 5: Attention piling example in the encoder layer and encoder- decoder layer. In the encoder-decoder example, piling results do not have a gray diagonal line because of the difference between the count of query words and key words. defined as the linguistic phrase in the given sentence, for improving the quality of translation. Attention Sorting. Figure 3 shows various attention patterns between query (y-axis) and key (x-axis) words for the different at- tention head in different layers, where a gray diagonal line indicates the position of attending itself for detecting attention patterns. We focus on reducing the users' efforts to find the distinguish attention patterns by using sorting algorithms, which is based on relative positional information and the entropy value in the attention (Figure 3). Relative positional information, such as whether the attention goes mainly toward the left, right, or the current location, as well as the column-wise mean entropy value of the attention matrix, allow the users to detect these patterns easily. Figure 4 shows the sorted results of attention patterns based on our position or entropy sorting algorithms. When sorted by position, a number of attention is unambiguous that attention that inclines towards the past words are placed near the control panel at the top while those that lean towards the future words are placed relatively close to the bottom. When sorted by entropy, the uppermost attention has the lowest entropy and exhibits bar-shaped attention, which numerous query words attend the same word. At the bottom, the user can find that no more words focused on the same word. Attention Piling. Inspired by the heatmap piling methods [3,21], we applied this piling idea to summarize multiple attention patterns in a single layer, as shown in the encoder part of Figure 5. To this end, we compute the feature vector of each attention head and perform clustering to the form of piles (or clusters) of multiple attention patterns. (cid:17) The feature vector of a particular attention on the attention head is defined as a flattened n2-dimensional vector of its Ai ∈ RT×T attention matrix, where Ai is calculated from Softmax on the i-th head, concatenated with additional three-dimensional vector of (1) the sum of the upper triangular part of the matrix, (2) that of the lower-triangular part, and (3) the sum of diagonal entries. This three-dimensional vector indicates the proportions how much attention is assigned to (1) the previous words of a query word, (2) its next words, (3) and the query itself, respectively. (cid:16) QKT√ dmodel Using these feature vectors of multiple attention heads within a single layer, we perform hierarchical clustering based on their Euclidean distances. In this manner, multiple attention patterns are grouped, forming an aggregated heatmap visualization per computed pile along with head indices belonging to each pile, as shown in Figure 5. It helps the user to easily find the similar patterns and distinct patterns in the same layer by adjusting Euclidean distance. 5.2 HeadLens To analyze a particular attention head, SANVis offers a novel view called the HeadLens, as shown in Figure 1(B). This view facilitates detailed analysis of the query and key representations of the selected attention head, such as which linguistic or positional feature they en- coded (T3). This view opens when a user clicks a particular heatmap corresponding to an attention head in the network view. The HeadLens is generated as follows. (1) It performs clustering on query and key vectors separately. (2) For each pair of a query and a key cluster centroids, its pairwise similarity is computed, forming a heatmap visualization in Figur 1 (B-2). (3) Additionally, the POS tagging and the positional information is summarized for each of the query and the key clusters (Figure 1(B-3)). (4) Once a user clicks a particular cell in a heatmap, its corresponding query and a key cluster are summarized in terms of their representative keywords (Figure 1(B-4)). To be specific, in the first step, we consider all the sentences in a validation set and obtain the query and the key vectors of all the words from these sentences. These query and key vectors are the results of applying a query and a key transformation of input words for a given attention head. Next, we perform the K-means++ [18] algorithm for each of the above-described query and key vector sets, by using the pre-defined number of clusters, e.g., 16 in our case. We empirically set this number of clusters by using an elbow method. In the second step, we obtain the cluster centroid vectors from the set of clusters for query vectors as well as those centroid vectors for key vectors. In the third step, we compute all the pairwise inner product similarities between each pair of a query cluster centroid and a key cluster one, which are visualized as a heatmap (Figure 1 (B-2)). We choose the inner product as a similarity measure since the attention weight is mainly computed based on the inner product between a query and a key vector. Within each heatmap, the color of cells is marked red(or blue) if it has high(or low) similarity. High inner product between a query set and a key set means that the words in the query set are likely to attend to the words in the key set. In the third step, the HeadLens provides a summary of each of the query and the key clusters. Each query (or key) cluster contains those words whose query (or key) vectors belong to the cluster. For those words, we obtain their part-of-speech (POS) tags and position indices within the sentence which each of them appears in. For POS tags, we used universal POS tagger [15]. Afterward, the relative amount of those words with each POS tag type out of the entire words within a single cluster is shown as a horizontal bar width with its encoded color, as shown in the left bar of Figure 1 (B-3). In addition, the relative amount of those words shown in a particular position of their original sentences are color-coded (a higher value colored as a red), as shown in the right bar of Figure 1 (B-3). Finally, in the fourth step, the user can click a particular entry in the cluster-level heatmap, e.g., a pair of a query and a key cluster with high similarity (a red cell highlighted in a black square in Figure 1(B-2)). Then, the summary of the corresponding query and key cluster are indicated by a black-colored edge (Figure 1(B-3)). Additionally, the word cloud visualization of such user-selected query and key cluster are used to highlight the frequently appearing words in each cluster, color-coded with their own POS tag types (Figure 1(B-4)). For example, the selected entry in Figure 1(B-2) indicates that the query cluster 15 has high similarity with the key cluster 15. The selected query cluster mainly contains auxiliary verb words (orange-colored), while the selected key cluster mainly contains noun words (purple-colored) in Figure 1(B-3). Furthermore, their most appearing words are shown in the word cloud view (Figure 1(B- 3)), which means that this head assigns a high attention weight to these noun words, e.g., 'world' and 'life' when a query word is given as an auxiliary verb word, e.g., 'is' and 'are.' This result shows the Figure 6: HeadLens showing the encoder-decoder attention of head 7 in layer 4. selected head have captured the linguistic relationship of noun and auxiliary verb. 6 USAGE SCENARIOS This section demonstrates usage scenarios of SANVis, mainly focus- ing on the recently proposed Transformer. This model has shown su- perior performances in machine translation tasks, including English- French and English-German translation tasks in the WMT chal- lenger [1]. Our implementation of the Transformer is based on the annotated Transformer [10]. Our model parameter setting followed the base model in the original paper [26]. We set our target task as English-French translation, where the collection of the scripts from TED lectures is used as our dataset [16]. The BLEU score of our model is shown as 38.4, which validates a reasonable level of performance. For evaluating our system, we used the validation set, which is not seen during training. Attention Piling. In Figure 5, the encoder-decoder part shows the attention piling visualization in encoder-decoder attention. In this example, one can observe that a number of attention heads have a diagonal attention pattern. An appropriate explanation of this diagonal shape would be that the words in French and English are generally aligned in the same order [4]. For the debugging purpose, it proves that the model properly learned a linguistic alignment between the source sequence and the corresponding target sequence. HeadLens. In the earlier example, we saw that most attention patterns between the English and the French words are diagonally- shaped between English and French words. One can analyze this pattern in detail by using our HeadLens. As shown in Figure 6, we chose head 4 in layer 7, which has such a diagonal attention pattern, and applied the HeadLens. Once selecting the query and the key cluster pair with a high similarity (Figure 6 (A)), it is shown that the query clusters commonly have an pronoun as a dominant POS tag type (brown-colored in Figure 6 (B)). Most of query cluster words are subject words in French, for instance, 'nous' and 'vous' mean 'we' and 'you' in English, respectively. The corresponding key clusters' representative words are mostly verbs. This result demonstrates that the model attends verb words to predict verb tokens for translating from English to French, when the input token is subject. 7 CONCLUSIONS In this paper, we present SANVis, a visual analytics system for self- attention networks, which supports in-depth understanding of multi- head self-attention networks at different levels of granularity. Using several usage scenarios, we demonstrate that our system provides the user with a deep understanding of the multi-head self-attention model in machine translation. As future work, we plan to extend our HeadLens to perform clustering of value vectors. We evaluate our system by various re- searchers who use the multi-head self-attention networks. We also apply our method in other state-of-the-art self-attention based mod- els, such as BERT [8] and XLNet [33]. ACKNOWLEDGMENTS The authors wish to thank all reviewers who provided constructive feedback for our project. This work was partially supported by NCSOFT NLP Center. This work was also supported by the National Research Foundation of Korea (NRF) grant funded bythe Korean government (MSIP) (No. NRF-2018M3E3A1057305). REFERENCES [1] ACL 2014 Ninth Workshop on Statistical Machine Translation. [2] B. Alsallakh, A. Jourabloo, M. Ye, X. Liu, and L. Ren. Do convolu- tional neural networks learn class hierarchy? IEEE Transactions on Visualization and Computer Graphics (TVCG), 24:152 -- 162, 2018. (TVCG), 25:353 -- 363, 2018. [23] H. Strobelt, S. Gehrmann, M. Behrisch, A. Perer, H. Pfister, and A. M. Rush. SEQ2seq-VIS : A Visual Debugging Tool for Sequence-to- Sequence Models. IEEE Transactions on Visualization and Computer Graphics, 25(1):353 -- 363, 2019. [24] H. Strobelt, S. Gehrmann, H. Pfister, and A. M. Rush. Lstmvis: A tool for visual analysis of hidden state dynamics in recurrent neural networks. IEEE Transactions on Visualization and Computer Graphics (TVCG), 24(1):667 -- 676, 2018. [25] E. Strubell, P. Verga, D. Andor, D. Weiss, and A. McCallum. Linguistically-informed self-attention for semantic role labeling. Proc. the Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5027 -- 5038, 2018. [26] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, and I. Polosukhin. Attention is all you need. In Proc. the Advances in Neural Information Processing Systems (NeurIPS), pp. 5998 -- 6008. 2017. [27] J. Vig and Y. Belinkov. Analyzing the structure of attention in a transformer language model. ArXiv, abs/1906.04284, 2019. [28] E. Voita, D. Talbot, F. Moiseev, R. Sennrich, and I. Titov. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. ArXiv, abs/1905.09418, 2019. [29] J. Wang, L. Gou, H. Shen, and H. Yang. Dqnviz: A visual analyt- ics approach to understand deep q-networks. IEEE Transactions on Visualization and Computer Graphics, 25(1):288 -- 298, 2019. [30] J. Wang, L. Gou, H. Yang, and H.-W. Shen. Ganviz: A visual analytics approach to understand the adversarial game. IEEE Transactions on Visualization and Computer Graphics (TVCG), 24:1905 -- 1917, 2018. [31] X. Wang, R. B. Girshick, A. Gupta, and K. He. Non-local neural networks. The Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7794 -- 7803, 2018. [32] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. Proc. the International Conference on Machine Learning (ICML), 37:2048 -- 2057, 2015. [33] Z. Yang, Z. Dai, Y. Yang, J. G. Carbonell, R. Salakhutdinov, and Q. V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. ArXiv, abs/1906.08237, 2019. [34] M. D. Zeiler and R. Fergus. Visualizing and understanding convo- lutional networks. In Proc. the European Conference on Computer Vision, pp. 818 -- 833. 2014. [35] H. Zhang, I. J. Goodfellow, D. N. Metaxas, and A. Odena. Self- attention generative adversarial networks. ArXiv, abs/1805.08318, 2018. [3] B. Bach, N. H. Riche, T. Dwyer, T. M. Madhyastha, J.-D. Fekete, and T. J. Grabowski. Small multipiles: Piling time to explore temporal patterns in dynamic networks. Proceedings of EG/VGCT Conference on Visualization (EuroVis), 34:31 -- 40, 2015. [4] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. Proc. the International Conference on Learning Representations (ICLR), 2014. [5] D. Cashman, G. Patterson, A. Mosca, N. Watts, S. Robinson, and R. Chang. RNNbow: Visualizing Learning Via Backpropagation Gra- dients in RNNs. IEEE Computer Graphics and Applications, 38(6):39 -- 50, 2018. [6] S. Chung, C. Park, S. Suh, K. Kang, J. Choo, and B. C. Kwon. Revacnn: Steering convolutional neural network via real-time visual analytics. Future of Interactive Learning Machines Workshop(FILM at NerIPS), 2016. [7] K. Clark, U. Khandelwal, O. Levy, and C. D. Manning. What does bert look at? an analysis of bert's attention. ArXiv, abs/1906.04341, 2019. [8] J. Devlin, M. Chang, K. Lee, and K. Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. Proc. the Annual Meeting of the Association for Computational Linguistics (ACL), 2019. [9] M. Kahng, N. Thorat, D. H. Chau, F. Vi´egas, and M. Wattenberg. GAN Lab: Understanding Complex Deep Generative Models using Interac- tive Visual Experimentation. IEEE Transactions on Visualization and Computer Graphics (TVCG), 25:310 -- 320, 2019. [10] G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. Opennmt: Open-source toolkit for neural machine translation. In Proc. the Annual Meeting of the Association for Computational Linguistics (ACL), 2017. [11] B. C. Kwon, M. Choi, J. T. Kim, E. Choi, Y. B. Kim, S. Kwon, J. Sun, and J. Choo. RetainVis: Visual Analytics with Interpretable and Interac- tive Recurrent Neural Networks on Electronic Medical Records. IEEE Transactions on Visualization and Computer Graphics, 25(1):299 -- 309, 2019. [12] D. Liu, W. Cui, K. Jin, Y. Guo, and H. Qu. DeepTracker: Visualiz- ing the Training Process of Convolutional Neural Networks. ACM Transactions on Intelligent Systems and Technology (TIST), 2019. [13] M. Liu, J. Shi, Y. Li, C. Li, J. Zhu, and S. Liu. Towards better anal- ysis of deep convolutional neural networks. IEEE Transactions on Visualization and Computer Graphics (TVCG), 23:91 -- 100, 2016. [14] T. Luong, H. Pham, and C. D. Manning. Effective approaches to attention-based neural machine translation. Proc. the Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1412 -- 1421, 2015. [15] C. Manning, M. Surdeanu, J. Bauer, J. Finkel, S. Bethard, and D. Mc- Closky. The stanford corenlp natural language processing toolkit. In Proc. the Annual Meeting of the Association for Computational Lin- guistics: System Demonstrations, pp. 55 -- 60, 2014. [16] P. Michel and G. Neubig. Extreme adaptation for personalized neural machine translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 312 -- 318. Association for Computational Linguistics, 2018. [17] Y. Ming, S. Cao, R. Zhang, Z. Li, Y. Chen, Y. Song, and H. Qu. Un- IEEE derstanding hidden memories of recurrent neural networks. Conference on Visual Analytics Science and Technology (VAST), pp. 13 -- 24, 2017. [18] R. Ostrovsky, Y. Rabani, L. J. Schulman, and C. Swamy. The effective- ness of lloyd-type methods for the k-means problem. IEEE Symposium on Foundations of Computer Science (FOCS), (165-176). [19] N. Pezzotti, T. Hollt, J. V. Gemert, B. P. F. Lelieveldt, E. Eisemann, and A. Vilanova. Deepeyes: Progressive visual analytics for designing deep neural networks. IEEE Transactions on Visualization and Computer Graphics (TVCG), 24(1):98 -- 108, 2018. [20] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. 2019. [21] N. H. Riche, J.-D. Fekete, and M. J. McGuffin. Nodetrix: a hybrid visualization of social networks. IEEE Transactions on Visualization and Computer Graphics (TVCG), 13, 2007. [22] H. Strobelt, S. Gehrmann, M. Behrisch, A. Perer, H. Pfister, and A. M. Rush. Seq2seq-vis: A visual debugging tool for sequence-to-sequence models. IEEE Transactions on Visualization and Computer Graphics
1710.03255
2
1710
2019-02-17T22:52:59
Multitask training with unlabeled data for end-to-end sign language fingerspelling recognition
[ "cs.CL", "cs.CV" ]
We address the problem of automatic American Sign Language fingerspelling recognition from video. Prior work has largely relied on frame-level labels, hand-crafted features, or other constraints, and has been hampered by the scarcity of data for this task. We introduce a model for fingerspelling recognition that addresses these issues. The model consists of an auto-encoder-based feature extractor and an attention-based neural encoder-decoder, which are trained jointly. The model receives a sequence of image frames and outputs the fingerspelled word, without relying on any frame-level training labels or hand-crafted features. In addition, the auto-encoder subcomponent makes it possible to leverage unlabeled data to improve the feature learning. The model achieves 11.6% and 4.4% absolute letter accuracy improvement respectively in signer-independent and signer-adapted fingerspelling recognition over previous approaches that required frame-level training labels.
cs.CL
cs
MULTITASK TRAINING WITH UNLABELED DATA FOR END-TO-END SIGN LANGUAGE FINGERSPELLING RECOGNITION Bowen Shi, Karen Livescu Toyota Technological Institute at Chicago {bshi, klivescu}@ttic.edu 9 1 0 2 b e F 7 1 ] L C . s c [ 2 v 5 5 2 3 0 . 0 1 7 1 : v i X r a ABSTRACT We address the problem of automatic American Sign Lan- guage fingerspelling recognition from video. Prior work has largely relied on frame-level labels, hand-crafted fea- tures, or other constraints, and has been hampered by the scarcity of data for this task. We introduce a model for fingerspelling recognition that addresses these issues. The model consists of an auto-encoder-based feature extractor and an attention-based neural encoder-decoder, which are trained jointly. The model receives a sequence of image frames and outputs the fingerspelled word, without relying on any frame-level training labels or hand-crafted features. In addition, the auto-encoder subcomponent makes it possible to leverage unlabeled data to improve the feature learning. The model achieves 11.6% and 4.4% absolute letter accuracy improvement respectively in signer-independent and signer- adapted fingerspelling recognition over previous approaches that required frame-level training labels. Index Terms -- American Sign Language, fingerspelling recognition, end-to-end neural network, auto-encoder 1. INTRODUCTION Automatic recognition of sign language from video could enable a variety of services, such as search and retrieval for Deaf social and news media (e.g., deafvideo.tv, aslized.org). Sign language recognition involves a number of challenges. For example, sign languages each have their own grammatical structure with no built-in writ- ten form; "transcription" of sign language with a written language is therefore a translation task. In addition, sign languages often involve the simultaneous use of handshape, arm movement, and facial expressions, whose related com- puter vision problems of articulated pose estimation and hand tracking still remain largely unsolved. Rather than treating the problem as a computer vision task, many researchers have therefore chosen to address it as a linguistic task, with speech recognition-like approaches. In this paper, we focus on recognition of fingerspelling, a part of ASL in which words are spelled out letter by letter (using the English alphabet) and each letter is represented by a distinct handshape. Fingerspelling accounts for 12 - 35% of ASL [1] and is mainly used for lexical items that do not have their own ASL signs. Fingerspelled words are typically names, technical words, or words borrowed from another lan- guage, which makes its lexicon huge. Recognizing finger- spelling has great practical importance because fingerspelled words are often some of the most important context words. One problem in fingerspelling recognition is that rela- tively little curated labeled data exists, and even less data labeled at the frame level. Recent work has obtained encour- aging results using models based on neural network classifiers trained with frame-level labels [2]. One goal of our work is to eliminate the need for frame labels. In addition, most prior work has used hand-engineered image features, which are not optimized for the task. A second goal is to develop end-to- end models that learn the image representation. Finally, while labeled fingerspelling data is scarce, unlabeled fingerspelling or other hand gesture data is more plentiful. Our final goal is to study whether such unlabeled data can be used to improve recognition performance. We propose a model that jointly learns image frame fea- tures and sequence prediction with no frame-level labels. The model is composed of a feature learner and an attention-based neural encoder-decoder. The feature learner is based on an auto-encoder, enabling us to use unlabeled data of hand im- ages (from both sign language video and other types of ges- ture video) in addition to transcribed data. We compare our approach experimentally to prior work and study the effect of model differences and of training with external unlabeled data. Compared to the best prior results on this task, we obtain 11.6% and 4.4% improvement respectively in signer-adapted and signer-independent letter error rates. 2. RELATED WORK Automatic sign language recognition can be approached similarly to speech recognition, with signs being treated analogously to words or phones. Most previous work has used approaches based on hidden Markov models (HMMs) [3, 4, 5, 6, 7]. This work has been supported by the collection of several sign language video corpora, such as RWTH- PHOENIX-Weather [8, 9], containing 6,861 German Sign Language sentences, and the American Sign Language Lexi- con Video Dataset (ASLLVD [10, 11, 12]), containing video recordings of almost 3000 isolated signs. Despite the importance of fingerspelling in spontaneous sign language, there has been relatively little work explicitly addressing fingerspelling recognition. Most prior work on fingerspelling recognition is focused on restricted settings. One typical restriction is the size of the lexicon. When the lexicon is fixed to a small size (20-100 words), excellent recognition accuracy has been achieved [13, 14, 15], but this restriction is impractical. For ASL fingerspelling, the largest available open-vocabulary dataset to our knowledge is the TTIC/UChicago Fingerspelling Video Dataset (Chicago- FSVid), containing 2400 open-domain word instances pro- duced by 4 signers [2], which we use here. Another impor- tant restriction is the signer identity. In the signer-dependent setting, letter error rates below 10% can be achieved for un- constrained (lexicon-free) recognition on the Chicago-FSVid dataset [16, 17, 2]; but the error rate goes above 50% in the signer-independent setting and is around 28% after word- level (sequence-level) adaptation [2]. Large accuracy gaps between signer-dependent and signer-independent recog- nition have also been observed for general sign language recognition beyond fingerspelling [7]. The best-performing prior approaches for open-vocabulary fingerspelling recognition have been based on HMMs or seg- mental conditional random fields (SCRFs) using deep neural network (DNN) frame classifiers to define features [2]. This prior work has largely relied on frame-level labels for train- ing data, but these are hard to obtain. In addition, because of the scarcity of data, prior work has largely relied on human- engineered image features, such as histograms of oriented gradients (HOG) [18], as the initial image representation. Our goal here is to move away from some of the restric- tions imposed in prior work. To our knowledge, this paper represents the first use of end-to-end neural models for fin- gerspelling recognition without any hand-crafted features or frame labels, as well as the first use of external unlabeled video data to address the lack of labeled data. 3. METHODS Fingerspelling recognition from raw image frames, like many sequence prediction problems, can be treated conceptually as the following task: (x1, x2, ..., xS) → (z1, z2, ..., zS) → (y1, y2, ..., yT ), where {xi}, {zi} (1 ≤ i ≤ S) are raw image frames and image features, respectively, and {yj} (1 ≤ j ≤ T ) are predicted letters. Our model is composed of two main parts (which can be trained separately or jointly): a feature extractor trained as an auto-encoder (AE) and an attention- based encoder-decoder for sequence prediction (see Figure 1). The attention-based model maps from (z1, z2, ..., zS) to (y1, y2, ..., yT ) and is similar to recent sequence-to-sequence models for speech recognition [19] and machine translation Fig. 1. Structure of the proposed model (blue region: auto- encoder, ⊕: concatenation). The decoder component of the auto-encoder (the blue box on the right) is used only at train- ing time. [20]. For the feature extractor, we consider three types of auto-encoders: Vanilla Auto-Encoder (AE) [21]: A feedforward neural network consisting of an encoder that maps the input (image) x ∈ Rdx to a latent variable z ∈ Rdz, where dz < dx and a decoder that maps z ∈ Rdz to output x ∈ Rdx. The objective is to minimize the reconstruction error L(x) = x − x2 while keeping dz small. In our models we use multi-layer perceptrons (MLP) for both encoder and decoder. Denoising Auto-Encoder (DAE) [22]: An extension of the vanilla auto-encoder where the input x at training time is a corrupted version of the original input x(cid:48). The training loss of the DAE is L(x; x(cid:48)) = x(cid:48) − x2 Variational Auto-Encoder (VAE) [23, 24] Unlike the vanilla and denoising auto-encoders, a variational auto- encoder models the joint distribution of the input x and latent variable z: pθ(x, z) = pθ(xz)pθ(z). VAEs are trained by optimizing a variational lower bound on the likelihood p(x): L(x) = −DKL[qφ(zx)pθ(z)] + Eqφ(zx)[log pθ(xz)] (1) The two terms are the KL divergence between qφ(zx) and pθ(z) and a reconstruction term Eqφ(zx)[log pθ(xz)]. The prior pθ(z) is typically assumed to be a centered isotropic multivariate Gaussian distribution N (0, I), and the poste- rior qφ(zx) and conditional distribution pθ(xz) are as- sumed to be multivariate Gaussians with diagonal covariance N (µµµz, σσσ2 KL divergence can be computed as zI) and N (µµµx, σσσ2 xI). Under these assumptions, the DKL[qφ(zx)pθ(z)] = 1 2 (1 + log(σ2 d) − µ2 d − σ2 d) (2) where µµµz = (µ1, ..., µd) and σσσz = (σ1, ..., σd) are approxi- mated as the outputs of an MLP taking x as input. Similarly to the AE and DAE, we use an MLP to model µµµx and σσσx. The loss of the VAE can thus be rewritten as L(x) = − 1 2 + 1 L (1 + log(σ2 d) − µ2 d − σ2 d) log N (x; µµµl x, σσσl x) (3) D(cid:88) d=1 D(cid:88) L(cid:88) d=1 l=1 where L is a number of samples used to approximate the ex- pectation in 1 (in practice we set L = 1 as in prior work [23]). µµµz is the feature vector z and µµµx serves the role of the recon- structed input x in Figure 1. RNN encoder-decoder: The latent variable sequence output by the auto-encoding module is fed into a long short- term memory (LSTM [25]) recurrent neural network (RNN) for encoding: (z1, z2, ..., zS) → (h1, h2, ..., hS). The LSTM states are fed into an RNN decoder that outputs the final letter sequence (y1, y2, ..., yT ). Attention [26] weights are applied to (h1, h2, ..., hS) during decoding in order to focus on certain chunks of image frames. If the hidden state of the decoder LSTM at time step t is dt, the probability of outputting letter yt, p(yty1:t−1, z1:T ), is given by αit = softmax(vT tanh(Whhi + Wddt)) d(cid:48) t = p(yty1:t−1, z1:T ) = softmax(Wo[dt; d(cid:48) S(cid:88) t] + bo) αithi (4) i=1 and dt is given by the standard LSTM update equation [25]. The loss for the complete model is a multitask loss: L(x1:T , y1:S) = − 1 S log p(yjy1:j−1, z1:T ) (5) Lae(xi) S(cid:88) T(cid:88) j=1 i=1 + λae T where Lae(·) is one of the losses of the AE, DAE or VAE, and λae measures the relative weight of the feature extraction loss vs. the prediction loss. includes 4 native signers each fingerspelling 600 word in- stances consisting of 2 repetitions of a 300-word list con- taining common English words, foreign words, and names.1 We follow the same preprocessing steps as in [2] consist- ing of hand detection and segmentation, producing 347,962 frames of hand regions. In addition, we also collect extra unlabeled handshape data consisting of 65,774 ASL finger- spelling frames from the data of [27] and 63,175 hand ges- ture frames from [28]. We chose these external data sets be- cause they provide hand bounding boxes; obtaining additional data from video data sets without bounding boxes is possible (and is the subject of future work), but would require hand tracking or detection. Despite the smaller amount of exter- nal data, and although it is noisier than the UChicago-FSVid dataset (it includes diverse backgrounds), it provides exam- ples of many additional individuals' hands, which is help- ful for signer-independent recognition. All image frames are scaled to 64 × 64 before feeding into the network. Our experiments are done in three settings: signer- dependent (SD), signer-independent (SI) and signer-adapted (SA). We use the same setup as in [16, 17, 2], reviewed here for completeness. For the SD case, models are trained and tested on a single signer's data. The data for each signer is divided into 10 subsets for k-fold experiments. 80%, 10% and 10% of the data are respectively used as train, valida- tion, and test sets in each fold. 8 out of 10 possible folds are used (reserving 20% of the data for adaptation), and the reported result is the average letter error rate (LER) over the test sets in those 8 folds. For the SI case, we train on three signers' data and test on the fourth. For the SA case, the model is warm-started from a signer-independent model and fine-tuned with 20% of the target signer data.2 10% of the target signer data is used for hyperparameter tuning and test results are reported on the rest. Previous work has considered two types of adaptation, using frame-level labels (alignments) for adaptation data or only word-level labels; here we only consider word-level adaptation. Model details The auto-encoder consists of a 2-layer MLP encoder and 2-layer MLP decoder with 800 ReLUs in each hidden layer and dimensionality of the latent variable z fixed at 100. Weights are initialized with Xavier initialization [29]. Dropout is added between layers at a rate of 0.8.3 For the sequence encoder and decoder, we use a one-layer LSTM RNN with hidden dimensionality of 128 and letter embedding dimensionality of 128. We use the Adam optimizer [30] with initial learning rate 0.001, which is decayed by a factor of 0.9 when the held-out accuracy stops increasing. Beam search is used for decoding; the effect of beam width will be discussed later. The default value for λae in the multitask loss function (Equation 5) is 1, but it can be tuned. The model is trained 4. EXPERIMENTS Data and experimental setup: We use the TTIC/UChicago ASL Fingerspelling Video Dataset (Chicago-FSVid), which 1The recognition models do not use knowledge of the word list. 2In previous work on signer adaptation [17, 2], multiple approaches were compared and this was the most successful one. 3Dropout rate refers to the probability of retaining a unit. Fig. 2. Attention visualization for the example word "LIBYA". Colors correspond to the attention weights αit in Equation 4, where i and t are column and row index, respectively. Lighter color corresponds to higher value. At the top are subsampled image frames for this word; frames with a plus (+) are the ones with highest attention weights, which are also the most canonical handshapes in this example. (Alignments between image frames and attention weights are imperfect due to frame subsampling effects.) Model Best prior results [2] 1 HOG + enc-dec 2 CNN + enc-dec 3 DNN + enc-dec 4 CNN + enc-dec+ 5 E2E CNN-enc-dec 6 E2E DNN-enc-dec 7 AE + enc-dec 8 9 DAE + enc-dec 10 VAE + enc-dec 11 12 13 14 15 16 E2E AE-enc-dec E2E DAE-enc-dec E2E VAE-enc-dec E2E AE-enc-dec* E2E DAE-enc-dec* E2E VAE-enc-dec* SD SI 7.6a 11.1 9.1 9.9 10.7 11.8 12.1 21.7 17.5 18.8 11.8 11.9 10.6 10.0 9.5 8.1 55.3b 50.3 50.7 50.9 50.4 48.4 47.9 61.2 56.4 58.2 48.1 45.0 43.8 47.3 44.3 43.7 SA 27.9c 29.1 28.7 29.3 29.2 27.5 26.9 40.3 34.4 37.8 30.2 28.9 23.8 29.2 27.2 23.5 Table 1. Letter error rates (%) of different models. SD: signer-dependent, SI: signer-independent, SA: signer- adapted. Model names with an asterisk (*) and a plus (+) use extra unlabeled hand image data and augmented data re- spectively. Best prior results are obtained with SCRFs (a = 2-pass SCRF, b = rescoring SCRF, c = first-pass SCRF). first with the unlabeled data, using only the auto-encoder loss, and then the labeled data using the multitask loss. We also experimented with iteratively feeding unlabeled and labeled data, but this produced worse performance. 4.1. Baselines We compare the performance of our approach with the best prior published results on this dataset, obtained with various types of SCRFs and detailed in [2]. These prior approaches are trained with frame-level labels. In addition to the results in [2], we consider the following extra baselines. Baseline 1 (HOG + enc-dec): We use a classic hand- engineered image descriptor, histogram of oriented gradient (HOG [18]), and directly feed it into the attention encoder- decoder. We use the same HOG feature vector as in [2]. This baseline allows us to compare engineered features with fea- tures learned by a neural network. Baseline 2 (CNN + enc-dec, DNN + enc-dec): A CNN or DNN frame classifier is trained using frame letter labels, and its output (pre-softmax layer) is used as the feature in- put z in the attention encoder-decoder. The classifier network is not updated during encoder-decoder training. This base- line tests whether frame-level label information is beneficial for the neural encoder-decoder. The input for both CNN and DNN are the 64 × 64 image pixels concatenated over a 21- frame window (10 before and 10 following the current frame). The DNNs have three hidden layers of sizes 2000, 2000 and 512. Dropout is added between layers at a rate of 0.6. The CNNs are composed of (in order) 2 convolutional layers, 1 max-pooling layer, 2 convolutional layers, one max-pooling layer, 3 fully connected layers, and 1 softmax layer. The stride in all convolutional layers is 1 and the filter sizes are respec- tively: 3 × 3 × 21 × 32, 3 × 3 × 32 × 32, 3 × 3 × 32 × 64, 3 × 3 × 64 × 64. Max-pooling is done over a window of size 2 × 2 with stride 2. Finally the fully connected layers are of sizes 2000, 2000 and 512. Dropout at a rate of 0.75 and 0.5 is used for the convolutional and fully connected lay- ers, respectively. The fully connected layers in both CNN and DNN have rectified linear unit (ReLU) [31] activation func- tions. Training is done via stochastic gradient descent with initial learning rate 0.01, which is decayed by a factor of 0.8 when the validation accuracy decreases after the first several epochs. The network structural parameters (number and type of layers, number of units, etc.) are tuned according to the validation error, and the above architectures are the best ones in our tuning. Baseline 3 (E2E CNN/DNN+enc-dec): End-to-end ver- sion of CNN/DNN + enc-dec. In this baseline, the CNN/DNN parameters are learned jointly with the encoder-decoder and no frame labels are used. Baseline 4 (AE/DAE/VAE + enc-dec): Separate training of auto-encoder and encoder-decoder modules, each with its own loss. Baselines 3 and 4 are used to study the effectiveness of end-to-end training. Fig. 3. Visualization via a 2-D t-SNE embedding [32] of image frame features extracted in the end-to-end VAE model and the CNN classifier for example word "KERUL" in the signer-dependent (SD) and signer-independent (SI) settings. 4.2. Results The overall results are shown in Table 1. Our main findings are as follows: Best-performing model: The proposed end-to-end model, when using a VAE and the external unlabeled data (line 16), achieves the best results in the signer-independent (SI) and signer-adapted (SA) cases, improving over the previous best published results by 11.6% and 4.4% absolute, respectively. In all of our end-to-end models (11-16), the VAE outper- forms the AE and DAE. In the signer-dependent case, our best model is 0.5% behind the best published SCRF result, presumably because our model is more data-hungry and the SD condition has the least training data. Encoder-decoders vs. prior approaches: More gener- ally, models based on RNN encoder-decoders (lines 2-16) of- ten outperform prior approaches (line 1) in the SI and SA set- tings but do somewhat worse in the signer-dependent case. We visualize the attention weights in Figure 2. The frame cor- responding to the canonical handshape often has the highest attention weight. The alignment between the decoder output and image frames is generally monotonic, though we do not use any location-based priors. The effect of end-to-end training: We measure the effect of end-to-end training vs. using frame labels by comparing the separately trained CNN/DNN + enc-dec (lines 3-4) with their end-to-end counterparts (lines 6-7), as well as separately trained AEs (lines 8-10) vs. their E2E counterparts (lines 11- 13). We find that separate training of a frame classifier can improve error rate by about 2% in the signer-dependent set- ting, but in the other two settings, end-to-end models trained without frame labels consistently outperform their separate training counterparts. Features learned by a frame classifier seem to not generalize well across signers. The non-end-to- end AE-based models do much worse than their E2E counter- parts, presumably because the feature extractor does not get any supervisory signal. We visually compare the features of each image frame trained through an end-to-end model vs. a frame classifier via t-SNE [32] embeddings (Figure 3). We find that both feature types show good separation in the SD Fig. 4. Comparison of different models with and without ex- tra data (*: with external data, +: with augmented data). setting, but in the SI setting the end-to-end VAE encoder- decoder has much clearer clusters corresponding to letters. Does external unlabeled data help? The extra data gives a consistent improvement for all three auto-encoding models in all settings (lines 11-13 vs. 14-16 and Figure 4). The aver- age accuracy improvements for the three settings are respec- tively 2.1%, 0.6%, and 0.7%. The SI and SA improvement is smallest for the best (VAE-based) model, but the overall consistent trend suggests that we may be able to further im- prove results with even more external data. The improvement is largest in the SD setting, perhaps due to the relatively larger amount of extra data compared to the labeled training data. Would data augmentation have the same effect as ex- ternal data? We compare the extra-data scheme to clas- sic data augmentation techniques [33], which involve adding replicates of the original training data with geometric trans- formations applied. We perform the following transforma- tions: scaling by a ratio of 0.8 and translation in a random direction by 10 pixels, rotation of the original image at a ran- dom angle up to 30 degrees both clockwise and counterclock- wise. We generate augmented data with roughly the same size as the external data (960 word and 168,950 frames) and Fig. 5. Letter confusion matrix under three settings (from left to right: signer-dependent (SD), signer-independent (SI) and signer-adapted (SA)). The color in each cell corresponds to the empirical probability of predicting a hypothesized letter (hori- zontal axis) given a certain ground-truth letter (vertical axis). The diagonal in each matrix has been removed for visual clarity. then train the CNN/DNN + enc-dec model (with frame la- bels). The results (Figure 4 and Table 1 line 5 vs. 3) show that data augmentation hurts performance in the SD and SA settings and achieves a 0.3% improvement in the SI setting. We hypothesize that the extra unlabeled hand data provides a richer set of examples than do the geometric transformations of the augmented data. Effect of beam width: We analyze the influence of beam width on error rates, shown in Figure 6. Beam search is im- portant in the SD setting. In this setting, the main errors are substitutions among similar letter handshapes (like e and o), as seen from the confusion matrix in Figure 5. Using a wider beam can help catch such near-miss errors. However, in the SI and SA settings, there are much more extreme differences between the predicted and ground-truth words, evidenced by the large number of deletion errors in Figure 5. Therefore it is hard to increase accuracy through beam search. Some ex- amples of predicted words are listed in Table 2. SD SI B=1 B=3 Ground-truth FIRSWIUO FIREWIUE FIREWIRE NOTEBEEK NOTEBOOK NOTEBOOK NOTEBOOK AAQANNIS AOQAMIT TANZANIA POPLDCE POPULCE AOQUNIR POPULOE SPRUCE B=5 FIREWIRE Table 2. Example outputs with different beam sizes in signer- dependent and signer-independent settings. 5. CONCLUSION Fig. 6. Letter error rate (%) with different beam widths in signer-dependent (SD), signer-independent (SI) and signer- adapted (SA) settings. end-to-end models consistently improve accuracy in signer- independent and signer-adapted settings, and the use of ex- ternal unlabeled data further slightly improves the results. Although our model does not improve over the best previous (SCRF-based) approach in the signer-dependent case, this prior work required frame labels for training while our ap- proach does not. Future work includes collecting data "in the wild" (online) and harvesting even more unlabeled data. We have introduced an end-to-end model for ASL finger- spelling recognition that jointly learns an auto-encoder based feature extractor and an RNN encoder-decoder for sequence prediction. The auto-encoder module enables us to use un- labeled data to augment feature learning. We find that these Acknowledgements We are grateful to Greg Shakhnarovich and Hao Tang for helpful suggestions and discussions. This research was funded by NSF grant 1433485. 6. REFERENCES [1] C. Padden and D. C. Gunsauls, "How the alphabet came to be used in a sign language," Sign Language Studies, vol. 4, no. 1, pp. 10 -- 33, 2003. [2] T. Kim, J. Keane, W. Wang, H. Tang, J. Rig- gle, G. Shakhnarovich, D. Brentari, and K. Livescu, "Lexicon-free fingerspelling recognition from video: data, models, and signer adaptation," Computer Speech and Language, pp. 209 -- 232, November 2017. [3] T. Starner, J. Weaver, and A. Pentland, "Real-time American Sign Language recognition using desk and wearable computer based video," IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(12) 1998. [4] C. Vogler and D. Metaxas, "Parallel hidden Markov models for American Sign Language recognition," in ICCV, 1999. [5] K. Grobel and M. Assan, "Isolated sign language recog- nition using hidden Markov models," in International Conference on System Man and Cybernetics, 1997. [6] P. Dreuw, D. Rybach, T. Deselaers, M. Zahedi, and H. Ney, "Speech recognition techniques for a sign lan- guage recognition system," in Interspeech, 2007. [7] O. Koller, J. Forster, and H. Ney, "Continuous sign lan- guage recognition: Towards large vocabulary statistical recognition systems handling multiple signers," Com- puter Vision and Image Understanding, vol. 141, pp. 108 -- 125, 2015. [8] J. Forster, C. Schmidt, T. Hoyoux, O. Koller, U. Zelle, J. Piater, and H. Ney, "RWTH-PHOENIX-Weather: A large vocabulary sign language recognition and transla- tion corpus," Language Resources and Evaluation, pp. 3785 -- 3789, 2012. Representation and Processing of Sign Language: In- teractions between Corpus and Lexicon, 2012. [12] "American Sign Language Lexicon Video Dataset," http://www.bu.edu/av/asllrp/dai-asllvd.html. [13] P. Goh and E.-J. Holden, "Dynamic fingerspelling recognition using geometric and motion features," in ICIP, 2006. [14] S. Liwicki and M. Everingham, "Automatic recognition of fingerspelled words in British Sign Language," in 2nd IEEE workshop on CVPR for Human Communicative Behavior Analysis, 2009. [15] S. Ricco and C. Tomasi, "Fingerspelling recognition through classification of letter-to-letter transitions," in ACCV, 2009. [16] T. Kim, G. Shakhnarovich, and K. Livescu, "Finger- spelling recognition with semi-Markov conditional ran- dom fields," in ICCV, 2013. [17] T. Kim, W. Wang, H. Tang, and K. Livescu, "Signer- independent fingerspelling recognition with deep neural network adaptation," in ICASSP, 2016. [18] N. Dalal and B. Triggs, "Histogram of oriented gradi- ents for human detection," in CVPR, 2005. [19] W. Chan, N. Jaitly, Q. V. Le, and O. Vinyals, "Listen, Attend and Spell: A neural network for large vocabulary conversational speech recognition," in ICASSP, 2016. [20] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine translation by jointly learning to align and translate," in ICLR, 2015. [21] P. Baldi, "Auto-encoders, unsupervised learning and deep architectures," in International Conference on Un- supervised and Transfer Learning Workshop, 2011. [9] J. Forster, C. Schmidt, O. Koller, M. Bellgardt, and H. Ney, "Extensions of the sign language recognition and translation corpus RWTH-PHOENIX-Weather," Computer Vision and Image Understanding, vol. 141, pp. 108 -- 125, 12 2015. [22] V. Pascal, H. Larochelle, I. Lajoie, Y. Bengio, and P.A. Manzagol, "Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion," Journal of Machine Learning Re- search, vol. 11, Dec. 2010. [10] V. Athitsos, C. Neidle, S. Sclaroff, J. Nash, A. Stefan, A. Thangali, H. Wang, and Q. Yuan, "Large lexicon project: American sign language video corpus and sign language indexing/retrieval algorithms," in Workshop on the Representation and Processing of Sign Languages: Corpora and Sign Language Technologies, 2010. [23] D. P Kingma and M. Welling, "Auto-encoding varia- tional Bayes," in ICLR, 2014. [24] D. J. Rezende, S. Mohamed, and D Wierstra, "Stochas- tic backpropagation and approximate inference in deep generative models," in ICML, 2014. [11] C. Neidle and C. Vogler, "A new web interface to fa- cilitate access to corpora: Development of the ASLLRP data access interface (DAI)," in LREC Workshop on the [25] S. Hochreiter and J. Schmidhuber, "Long Short-Term Memory," Neural Computation, vol. 9, pp. 1735 -- 1780, Nov. 1997. [26] O. Vinyals, Ł. Kaiser, T. Koo, S. Petrov, I. Sutskever, and G. Hinton, "Grammar as a foreign language," in NIPS 28, pp. 2773 -- 2781. 2015. [27] N. Pugeault and R. Bowden, "Spelling it out: Real-time asl fingerspelling recognition," in Proceedings of the 1st IEEE Workshop on Consumer Depth Cameras for Computer Vision, jointly with ICCV, 2011. [28] T.-K. Kim and R. Cipolla, "Canonical correlation analy- sis of video volume tensors for action categorization and detection," IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1415 -- 1428, 31(8) 2009. [29] X. Glorot and Y. Bengio, "Understanding the difficulty of training deep feedforward neural networks," in AIS- TATS, 2010. [30] D. P. Kingma and J. L. Ba, "ADAM: A method for stochastic optimization," in ICLR, 2015. [31] Vinod Nair and Geoffrey E Hinton, "Rectified lin- ear units improve restricted Boltzmann machines," in ICML, 2010. [32] L. van der Maaten and G. E. Hinton, "Visualizing high- Journal of Machine dimensional data using t-SNE," Learning Research, vol. 9, pp. 2579 -- 2605, 2008. [33] A. G. Howard, "Some improvements on deep convo- lutional neural network based image classification," in CoRR, 2013.
1905.06649
1
1905
2019-05-16T10:43:58
What do Entity-Centric Models Learn? Insights from Entity Linking in Multi-Party Dialogue
[ "cs.CL" ]
Humans use language to refer to entities in the external world. Motivated by this, in recent years several models that incorporate a bias towards learning entity representations have been proposed. Such entity-centric models have shown empirical success, but we still know little about why. In this paper we analyze the behavior of two recently proposed entity-centric models in a referential task, Entity Linking in Multi-party Dialogue (SemEval 2018 Task 4). We show that these models outperform the state of the art on this task, and that they do better on lower frequency entities than a counterpart model that is not entity-centric, with the same model size. We argue that making models entity-centric naturally fosters good architectural decisions. However, we also show that these models do not really build entity representations and that they make poor use of linguistic context. These negative results underscore the need for model analysis, to test whether the motivations for particular architectures are borne out in how models behave when deployed.
cs.CL
cs
What do Entity-Centric Models Learn? Insights from Entity Linking in Multi-Party Dialogue Carina Silberer∗ Ionut-Teodor Sorodoc∗ Laura Aina∗ Matthijs Westera∗ Gemma Boleda Universitat Pompeu Fabra Barcelona, Spain {firstname.lastname}@upf.edu 9 1 0 2 y a M 6 1 ] L C . s c [ 1 v 9 4 6 6 0 . 5 0 9 1 : v i X r a Abstract Humans use language to refer to entities in the external world. Motivated by this, in recent years several models that incorporate a bias towards learning entity representations have been proposed. Such entity-centric models have shown empirical success, but we still know little about why. In this paper we analyze the behavior of two re- cently proposed entity-centric models in a ref- erential task, Entity Linking in Multi-party Di- alogue (SemEval 2018 Task 4). We show that these models outperform the state of the art on this task, and that they do better on lower frequency entities than a counterpart model that is not entity-centric, with the same model size. We argue that making models entity- centric naturally fosters good architectural de- cisions. However, we also show that these models do not really build entity representa- tions and that they make poor use of linguis- tic context. These negative results underscore the need for model analysis, to test whether the motivations for particular architectures are borne out in how models behave when de- ployed. Introduction 1 Modeling reference to entities is arguably crucial for language understanding, as humans use language to talk about things in the world. A hypothesis in recent work on referential tasks such as co-reference resolution and entity link- ing (Haghighi and Klein, 2010; Clark and Manning, 2016; Henaff et al., 2017; Aina et al., 2018; Clark et al., 2018) is that encouraging models to learn and use entity representations will help them better carry out referential tasks. To illustrate, creating an entity representation with the relevant information upon reading a woman should make it easier to ∗denotes equal contribution. JOEY TRIBBIANI (183): ". . . see Ross, because I think you love her ." 335 183 335 306 Figure 1: Character identification: example. resolve a pronoun mention like she.1 In the men- tioned work, several models have been proposed that incorporate an explicit bias towards entity representations. Such entity-centric models have shown empirical success, but we still know little about what it is that they effectively learn to model. In this analysis paper, we adapt two previous entity-centric models (Henaff et al., 2017; Aina et al., 2018) for a recently proposed referential task and show that, despite their strengths, they are still very far from modeling entities.2 The task is character identification on multi- party dialogue as posed in SemEval 2018 Task 4 (Choi and Chen, 2018).3 Models are given dia- logues from the TV show Friends and asked to link entity mentions (nominal expressions like I, she or the woman) to the characters to which they refer in each case. Figure 1 shows an example, where the mentions Ross and you are linked to entity 335, mention I to entity 183, etc. Since the TV series revolves around a set of entities that recur over many scenes and episodes, it is a good benchmark to analyze whether entity-centric models learn and use entity representations for referential tasks. Our contributions are three-fold: First, we adapt two previous entity-centric models and show that they do better on lower frequency entities 1Note the analogy with traditional models in formal lin- guistics like Discourse Representation Theory (Kamp and Reyle, 2013). 2Source code for our model, the training procedure and the new dataset is published on https://github.com/ amore-upf/analysis-entity-centric-nns. 3https://competitions.codalab.org/ competitions/17310. (a significant challenge for current data-hungry models) than a counterpart model that is not entity- centric, with the same model size. Second, through analysis we provide insights into how they achieve these improvements, and argue that making models entity-centric fosters architectural decisions that result in good inductive biases. Third, we create a dataset and task to evaluate the models' ability to encode entity information such as gender, and show that models fail at it. More generally, our paper underscores the need for the analysis of model be- havior, not only through ablation studies, but also through the targeted probing of model represen- tations (Linzen et al., 2016; Conneau et al., 2018). 2 Related Work Modeling. Various memory architectures have been proposed that are not specifically for entity- centric models, but could in principle be employed in them (Graves et al., 2014; Sukhbaatar et al., 2015; Joulin and Mikolov, 2015; Bansal et al., 2017). The two models we base our results on (Henaff et al., 2017; Aina et al., 2018) were explic- itly motivated as entity-centric. We show that our adaptations yield good results and provide a closer analysis of their behavior. Tasks. The task of entity linking has been for- malized as resolving entity mentions to referential entity entries in a knowledge repository, mostly Wikipedia (Bunescu and Pas¸ca, 2006; Mihalcea and Csomai, 2007 and much subsequent work; for recent approaches see Francis-Landau et al., 2016; Chen et al., 2018). In the present entity linking task, only a list of entities is given, without associated encyclopedic entries, and information about the entities needs to be acquired from scratch through the task; note the analogy to how a human audi- ence might get familiar with the TV show charac- ters by watching it. Moreover, it addresses multi- party dialogue (as opposed to, typically, narrative text), where speaker information is crucial. A task closely related to entity linking is coreference res- olution, i.e., predicting which portions of a text refer to the same entity (e.g., Marie Curie and the scientist). This typically requires clustering men- tions that refer to the same entity (Pradhan et al., 2011). Mention clusters essentially correspond to entities, and recent work on coreference and lan- guage modeling has started exploiting an explicit notion of entity (Haghighi and Klein, 2010; Clark and Manning, 2016; Yang et al., 2017). Previous work both on entity linking and on coreference reso- lution (cited above, as well as Wiseman et al., 2016) often presents more complex models that incorpo- rate e.g. hand-engineered features. In contrast, we keep our underlying model basic since we want to systematically analyze how certain architectural de- cisions affect performance. For the same reason we deviate from previous work to entity linking that uses a specialized coreference resolution module (e.g., Chen et al., 2017). Analysis of Neural Network Models. Our work joins a recent strand in NLP that systematically analyzes what different neural network models learn about language (Linzen et al., 2016; K´ad´ar et al., 2017; Conneau et al., 2018; Gulordava et al., 2018b; Nematzadeh et al., 2018, a.o.). This work, like ours, has yielded both positive and negative results: There is evidence that they learn complex linguistic phenomena of morphological and syn- tactic nature, like long distance agreement (Gulor- dava et al., 2018b; Giulianelli et al., 2018), but less evidence that they learn how language relates to situations; for instance, Nematzadeh et al. (2018) show that memory-augmented neural models fail on tasks that require keeping track of inconsistent states of the world. 3 Models We approach character identification as a clas- sification task, and compare a baseline LSTM (Hochreiter and Schmidhuber, 1997) with two models that enrich the LSTM with a memory mod- ule designed to learn and use entity representations. LSTMs are the workhorse for text processing, and thus a good baseline to assess the contribution of this module. The LSTM processes text of dialogue scenes one token at a time, and the output is a probability distribution over the entities (the set of entity IDs are given). 3.1 Baseline: BILSTM The BILSTM model is depicted in Figure 2. It is a standard bidirectional LSTM (Graves et al., 2005), with the difference with most uses of LSTMs in NLP that we incorporate speaker information in addition to the linguistic content of utterances. The model is given chunks of dialogue (see Ap- pendix for hyperparameter settings such as the chunk size). At each time step i, one-hot vectors for token ti and speaker entities si are embedded Figure 2: BILSTM applied to "...think you love..." as spoken by Joey (from Figure 1), outputting class scores for mention "you" (bias bo not depicted). via two distinct matrices Wt and We and concate- nated to form a vector xi (Eq. 1, where (cid:107) denotes concatenation; note that in case of multiple simulta- neous speakers Si their embeddings are summed). xi = Wt ti (cid:107)(cid:88) s∈Si We s (1) The vector xi is fed through the nonlinear acti- vation function tanh and input to a bidirectional −→ hi of a unidirectional LSTM. The hidden state LSTM for the ith input is recursively defined as a combination of that input with the LSTM's −→ hi−1. For a bidirectional previous hidden state ←− LSTM, the hidden state hi is the concatenation of the hidden states hi of two unidirectional LSTMs which process the data in opposite directions (Eqs. 2-4). −→ hi and −→ hi = LSTM(tanh(xi), ←− hi = LSTM(tanh(xi), −→ hi (cid:107) ←− hi = hi −→ hi−1) ←− hi+1) (2) (3) (4) For every entity mention ti (i.e., every token4 that is tagged as referring to an entity), we obtain a distribution over all entities, oi ∈ [0, 1]1×N , by applying a linear transformation to its hidden state hi (Eq. 5), and feeding the resulting gi to a softmax classifier (Eq. 6). gi = Wo hi + bo oi = softmax(gi) (5) (6) Eq. 5 is where the other models will diverge. Figure 3: ENTLIB; everything before hi, omitted here, is the same as in Figure 2. 3.2 ENTLIB (Static Memory) The ENTLIB model (Figure 3) is an adaptation of our previous work in Aina et al. (2018), which was the winner of the SemEval 2018 Task 4 competition. This model adds a simple memory module that is expected to represent entities because its vectors are tied to the output classes (accordingly, Aina et al., 2018, call this module entity library). We call this memory 'static', since it is updated only during training, after which it remains fixed. Where BILSTM maps the hidden state hi to class scores oi with a single transformation (plus softmax), ENTLIB instead takes two steps: It first transforms hi into a 'query' vector qi (Eq. 7) that it will then use to query the entity library. As we will see, this mechanism helps dividing the labor between representing the context (hidden layer) and doing the prediction task (query layer). qi = Wq hi + bq (7) A weight matrix We is used as the entity library, which is the same as the speaker embedding in Eq. 1: the query vector qi ∈ R1×k is compared to each vector in We (cosine), and a gate vector gi is obtained by applying the ReLU function to the cosine similarity scores (Eq. 8).5 Thus, the query extracted from the LSTM's hidden state is used as a soft pointer over the model's representation of the entities. gi = ReLU(cos(We, qi)) (8) As before, a softmax over gi then yields the dis- tribution over entities (Eq. 6). So, in the ENTLIB 4For multi-word mentions this is done only for the last token in the mention. 5In Aina et al. (2018), the gate did not include the ReLU nonlinear activation function. Adding it improved results. Joey you...softmaxWtWeJoey: thinkJoey: youJoey: love{.........Inputs: ("Speaker: token")Class scores:oBiLSTM:ixiWo......hi-1hihi+1cos qoiiWqWegisoftmax......hi...Query & library:Class scores:Gate:(from BiLSTM) as in the previous models (Eq. 6). gi = ReLU(cos(We, qi) + cos(Vi, qi)) (9) The values Vi are initialized at the start of ev- ery scene (i = 0) as being identical to the keys (V0 = We). After processing the ith token, new information can be added to the values. Eq. 10 computes this new information Vi,j, for the jth entity, where Q, R and S are learned linear trans- formations and PReLU denotes the parameterized rectified linear unit (He et al., 2015): Vi,j = PReLU(QWej + RVi,j + Sqi) (10) This information Vi,j, multiplied by the respective gate gi,j, is added to the values to be used when processing the next (i + 1th) token (Eq. 11), and the result is normalized (Eq. 12): Vi+1,j = Vj + gi,j ∗ Vi,j Vi+1,j = Vi+1,j (cid:107)Vi+1,j(cid:107) (11) (12) Our adaptation of the Recurrent Entity Network involves two changes. First, we use a biLSTM to process the linguistic utterance, while Henaff et al. (2017) used a simple multiplicative mask (we have natural dialogue, while their main evaluation was on bAbI, a synthetic dataset). Second, in the original model the gates were used to retrieve and output information about the query, whereas we use them directly as output scores because our task is referential. This also allows us to tie the keys to the characters of the Friends series as in the previous model, and thus have them represent entities (in the original model, the keys represented entity types, not instances). 4 Character Identification The training and test data for the task span the first two seasons of Friends, divided into scenes and episodes, which were in turn divided into ut- terances (and tokens) annotated with speaker iden- tity.7 The set of all possible entities to refer to is given, as well as the set of mentions to resolve. Only the dialogues and speaker information are available (e.g., no video or descriptive text). Indeed, are that we compute the gate using cosine similarity instead of dot product, and the obtained similarities are fed through a ReLU nonlinearity instead of sigmoid. 7The dataset also includes automatic linguistic annotations, e.g., PoS tags, which our models do not use. Figure 4: ENTNET; everything before hi, omitted here, is the same as in Figure 2. model Eqs. 7 and 8 together take the place of Eq. 5 in the BILSTM model. Our differs implementation from Aina et al. (2018) in one important point that we will show to be relevant to model less frequent entities (training also differs, see Section 4): The original model did not do parameter sharing between speakers and referents, but used two distinct weight matrices. Note that the contents of the entity library in ENTLIB do not change during forward propagation of activations, but only during backpropagation of errors, i.e., during training, when the weights of We are updated. If anything, they will encode permanent properties of entities, not properties that change within a scene or between scenes or episodes, which should be useful for reference. The next model attempts to overcome this limitation. 3.3 ENTNET (Dynamic Memory) ENTNET is an adaptation of Recurrent Entity Net- works (Henaff et al., 2017, Figure 4) to the task. Instead of representing each entity by a single vec- tor, as in ENTLIB, here each entity is represented jointly by a context-invariant or 'static' key and a context-dependent or 'dynamic' value. For the keys the entity embedding We is used, just like the entity library of ENTLIB. But the values Vi can be dynamically updated throughout a scene. As before, an entity query qi is first obtained from the BILSTM (Eq. 7). Then, ENTNET com- putes gate values gi by estimating the query's simi- larity to both keys and values, as in Eq. 9 (replacing Eq. 8 of ENTLIB).6 Output scores oi are computed 6Two small changes with respect to the original model (motivated by empirical results in the hyperparameter search) Vi-1 qoiiWqgisoftmaxVi.........hi...Vi+1...cosWecos+RQ+SV~i(from BiLSTM)×+(Keys)(Values) all (78) #par F1 - - models 41.1 SemEv-1st SemEv-2nd 13.5 BILSTM 3.4M 34.4 ENTLIB ENTNET main (7) F1 Acc 77.2 79.4 82.1 83.4 85.0 83.5 3.3M 49.6∗ 77.6∗ 84.9 84.2 3.4M 52.5∗ 77.5∗ 84.8 83.9 Acc 74.7 68.6 74.6 Table 1: Model parameters and results on the char- acter identification task. First block: top systems at SemEval 2018. Results in the second block marked with ∗ are statistically significantly better than BIL- STM at p < 0.001 (approximate randomization tests, Noreen, 1989). one of the most interesting aspects of the SemEval data is the fact that it is dialogue (even if scripted), which allows us to explore the role of speaker in- formation, one of the aspects of the extralinguistic context of utterance that is crucial for reference. We additionally used the publicly available 300- dimensional word vectors that were pre-trained on a Google News corpus with the word2vec Skip- gram model (Mikolov et al., 2013a) to represent the input tokens. Entity (speaker/referent) embed- dings were randomly initialized. We train the models with backpropagation, using the standard negative log-likelihood loss function. For each of the three model architectures we per- formed a random search (> 1500 models) over the hyperparameters using cross-validation (see Ap- pendix for details), and report the results of the best settings after retraining without cross-validation. The findings we report are representative of the model populations. Results. We follow the evaluation defined in the SemEval task. Metrics are macro-average F1-score (which computes the F1-score for each entity sep- arately and then averages these over all entities) and accuracy, in two conditions: All entities, with 78 classes (77 for entities that are mentioned in both training and test set of the SemEval Task, and one grouping all others), and main entities, with 7 classes (6 for the main characters and one for all the others). Macro-average F1-score on all entities, the most stringent, was the criterion to define the leaderboard. Table 1 gives our results in the two evaluations, comparing the models described in Section 3 to the best performing models in the SemEval 2018 Task 4 competition (Aina et al., 2018; Park et al., Figure 5: Accuracy on entities with high (>1000), medium (20 -- 1000), and low (<20) frequency. 2018). Recall that our goal in this paper is not to optimize performance, but to understand model behavior; however, results show that these models are worth analyzing, as that they outperform the state of the art. All models perform on a par on main entities, but entity-centric models outperform BILSTM by a substantial margin when all char- acters are to be predicted (the difference between ENTLIB and ENTNET is not significant). The architectures of ENTLIB and ENTNET help with lower frequency characters, while not hurting performance on main characters. Indeed, Figure 5 shows that the accuracy of BILSTM rapidly deteri- orates for less frequent entities, whereas ENTLIB and ENTNET degrade more gracefully. Deep learn- ing approaches are data-hungry, and entity men- tions follow the Zipfian distribution typical of lan- guage, with very few high frequency and many lower-frequency items, such that this is a welcome result. Moreover, these improvements do not come at the cost of model complexity in terms of number of parameters, since all models have roughly the same number of parameters (3.3 − 3.4 million).8 Given these results and the motivations for the model architectures, it would be tempting to con- clude that encouraging models to learn and use entity representations helps in this referential task. However, a closer look at the models' behavior reveals a much more nuanced picture. Figure 6 suggests that: (1) models are quite good at using speaker information, as the best perfor- mance is for first person pronouns and determiners (I, my, etc.); (2) instead, models do not seem to be very good at handling other contextual infor- mation or entity-specific properties, as the worst 8See Appendix for a computation of the models' parame- ters. model type main BILSTM 0.39 0.82 ENTLIB 0.92 ENTNET #pairs 21 all 0.02 0.13 0.16 22155 Table 2: RSA correlation between speaker/referent em- beddings We and token embeddings Wt of the entities' names, for main entities vs. all entities (right) simple BILSTM baseline needs to independently learn the mapping between speaker embedding and output entities, and so it can only learn to resolve even first-person pronouns for entities for which it has enough data. For proper nouns (character names), entity- centric models learn to align the token embeddings with the entity representations (identical to the speaker embeddings). We show this by using Rep- resentation Similarity Analysis (RSA) (Kriegesko- rte et al., 2008), which measures how topologically similar two different spaces are as the Spearman correlation between the pair-wise similarities of points in each space (this is necessary because en- tities and tokens are in different spaces). For in- stance, if the two spaces are topologically similar, the relationship of entities 183 and 335 in the en- tity library will be analogous to the relationship between the names Joey and Ross in the token space. Table 2 shows the topological similarities between the two spaces, for the different model types.10 This reveals that in entity-centric models the space of speaker/referent embeddings is topo- logically very similar to the space of token embed- dings restricted to the entities' names, and more so than in the BILSTM baseline. We hypothesize that entity-centric models can do the alignment better because referent (and hence speaker) embeddings are closer to the error signal, and thus backprop- agation is more effective (this again helps with lower-frequency entities). Further analysis revealed that in entity-centric models the beneficial effect of weight sharing be- tween the speaker embedding and the entity repre- sentations (both We) is actually restricted to first- person pronouns. For other expressions, having 10As an entity's name we here take the proper noun that is most frequently used to refer to the entity in the training data. Note that for the all entities condition the absolute values are lower, but the space is much larger (over 22K pairs). Also note that this is an instance of slow learning; models are not encoding the fact that a proper noun like Rachel can refer to different people. Figure 6: F1-score (all entities condition) of the three models, per mention type, and token frequency of each mention type. performance is for third person mentions and com- mon nouns, which require both;9 (3) ENTLIB and ENTNET behave quite similarly, with performance boosts in (1) and smaller but consistent improve- ments in (2). Our analyses in the next two sections confirm this picture and relate it to the models' architectures. 5 Analysis: Architecture We examine how the entity-centric architectures improve over the BILSTM baseline on the refer- ence task, then move to entity representations (Sec- tion 6). Shared speaker/referent representation. We found that an important advantage of the entity- centric models, in particular for handling low- frequency entities, lies in the integrated represen- tations they enable of entities both in their role of speakers and in their role of referents. This ex- plains the boost in first person pronoun and proper noun mentions, as follows. that Recall the integrated representation is achieved by parameter sharing, using the same weight matrix We as speaker embedding and as en- tity library/keys. This enables entity-centric models to learn the linguistic rule "a first person pronoun (I, me, etc.) refers to the speaker" regardless of whether they have a meaningful representation of this particular entity: It is enough that speaker rep- resentations are distinct, and they are because they have been randomly initialized. In contrast, the 91st person: I, me, my, myself, mine; 2nd person: you, your, yourself, yours; 3rd person: she, her, herself, hers, he, him, himself, his, it, itself, its. Figure 7: ENTLIB, 2D TSNE projections of the activations for first-person mentions in the test set, colored by the entity referred to. The mentions cluster into entities already in the hidden layer hi (left graph; query layer qi shown in the right graph). Best viewed in color. Figure 8: ENTLIB, 2D TSNE projections of the activations for mentions in the test set (excluding first person mentions), colored by the entity referred to. While there is already some structure in the hidden layer hi (left graph), the mentions cluster into entities much more clearly in the query qi (right graph). Best viewed in color. two distinct matrices yielded almost the same per- formance as having one (but still higher than the BILSTM, thanks to the other architectural advan- tage that we discuss below). In the case of first-person pronouns, the speaker embedding given as input corresponds to the target entity. This information is already accessible in the hidden state of the LSTM. Therefore, mentions cluster into entities already at the hidden layer hi, with no real difference with the query layer qi (see Figure 7). Advantage of query layer. The entity querying mechanism described above entails having an ex- tra transformation after the hidden layer, with the query layer q. Part of the improved performance of entity-centric models, compared to the BILSTM baseline, is due not to their bias towards 'entity representations' per se, but due to the presence of this extra layer. Recall that the BILSTM baseline maps the LSTM's hidden state hi to output scores oi with a single transformation. Gulordava et al. (2018a) observe in the context of Language Mod- eling that this creates a tension between two con- flicting requirements for the LSTM: keeping track of contextual information across time steps, and encoding information useful for prediction in the current timestep. The intermediate query layer q in entity-centric models alleviates this tension. This explains the improvements in context-dependent mentions like common nouns or second and third pronouns. We show this effect in two ways. First, we com- pare the average mean similarity s of mention pairs Te = {(tk, tk(cid:48)) tk → e ∧ k (cid:54)= k(cid:48)} referring to the same entity e in the hidden layer (Eq. 13) and the BILSTM ENTLIB qi 0.48 hi 0.34 hi 0.24 ENTNET hi qi 0.60 0.27 Table 3: Average cosine similarity of mentions with the same referent. query layer.11 s = 1 E (cid:88) e∈E (cid:88) (tk,tk(cid:48) )∈Te 1 Te cos(htk , htk(cid:48) ) (13) Table 3 shows that, in entity-centric models, this similarity is lower in the hidden layer hi than in the case of the BILSTM baseline, but in the query layer qi it is instead much higher. The hidden layer thus is representing other information than referent- specific knowledge, and the query layer can be seen as extracting referent-specific information from the hidden layer. Figure 8 visually illustrates the divi- sion of labor between the hidden and query layers. Second, we compared the models to variants where the cosine-similarity comparison is replaced by an ordinary dot-product transformation, which con- verts the querying mechanism into a simple further layer. These variants performed almost as well on the reference task, albeit with a slight but consistent edge for the models using cosine similarity. No dynamic updates in ENTNET. A surprising negative finding is that ENTNET is not using its dynamic potential on the referential task. We con- firmed this in two ways. First, we tracked the values Vi of the entity representations and found that the pointwise difference in Vi at any two adjacent time steps i tended to zero. Second, we simply switched off the update mechanism during testing and did not observe any score decrease on the reference task. ENTNET is thus only using the part of the entity memory that it shares with ENTLIB, i.e., the keys We, which explains their similar performance. This finding is markedly different from Henaff et al. (2017), where for instance the BaBI tasks could be solved only by dynamically updating the entity representations. This may reflect our different language modules: since our LSTM module already has a form of dynamic memory, unlike the simpler sentence processing module in Henaff et al. (2017), it may be that the LSTM takes this burden off of the entity module. An alternative is that it is due to differences in the datasets. the query layer, Eq. 13 is equivalent, with 11For cos(qtk , qtk(cid:48) ). This person is {a/an/the} <PROPERTY> [and {a/an/the} <PROPERTY>]{0,2}. This person is the brother of Monica Geller. This person is a paleontologist and a man. Figure 9: Patterns and examples (in italics) of the dataset for information extraction as entity linking. We leave an empirical comparison of these potential explanations for future work, and focus in Section 6 on the static entity representations We that ENTNET essentially shares with ENTLIB. 6 Analysis: Entity Representations The foregoing demonstrates that entity-centric ar- chitectures help in a reference task, but not that the induced representations in fact contain meaning- ful entity information. In this section we deploy these representations on a new dataset, showing that they do not -- not even for basic information about entities such as gender. Method. We evaluate entity representations with an information extraction task including attributes and relations, using information from an indepen- dent, unstructured knowledge base -- the Friends Central Wikia.12 To be able to use the models as is, we set up the task in terms of entity linking, asking models to solve the reference of natural lan- guage descriptions that uniquely identify an entity. For instance, given This person is the brother of Monica Geller., the task is to determine that person refers to Ross Geller, based on the information in the sentence.13 The information in the descriptions was in turn extracted from the Wikia. We do not retrain the models for this task in any way -- we simply deploy them. We linked the entities from the Friends dataset used above to the Wikia through a semi-automatic procedure that yielded 93 entities, and parsed the Wikia to extract their attributes (gender and job) and relations (e.g., sister, mother-in-law; see Appendix for details). We automatically generate the natural language descriptions with a simple pattern (Figure 9) from combinations of properties that uniquely identify a given entity within the set of Friends characters.14 We 12http://friends.wikia.com. 13The referring expression is the whole DP, This person, but we follow the method in Aina et al. 2018 of asking for reference resolution at the head noun. 14Models require inputting a speaker; we use speaker UN- could improve the use of context. 7 Conclusions Recall that the motivation for entity-centric models is the hypothesis that incorporating entity represen- tations into the model will help it better model the language we use to talk about them. We still think that this hypothesis is plausible. However, the ar- chitectures tested do not yet provide convincing support for it, at least for the data analyzed in this paper. On the positive side, we have shown that framing models from an entity-centric perspective makes it very natural to adopt architectural decisions that are good inductive biases. In particular, by exploiting the fact that both speakers and referents are entities, these models can do more with the same model size, improving results on less frequent entities and emulating rule-based behavior such as "a first person expression refers to the speaker". On the negative side, we have also shown that they do not yield operational entity representations, and that they are not making good use of contextual information for the referential task. More generally, our paper underscores the need for model analysis to test whether the motivations for particular architectures are borne out in how the model actually behaves when it is deployed. Acknowledgments We gratefully acknowledge Kristina Gulordava and Marco Baroni for the feedback, advice and sup- port. We are also grateful to the anonymous re- viewers for their valuable comments. This project has received funding from the European Research Council (ERC) under the European Unions Hori- zon 2020 research and innovation programme (grant agreement No 715154), and from the Span- ish Ram´on y Cajal programme (grant RYC-2015- 18907). We are grateful to the NVIDIA Corpora- tion for the donation of GPUs used for this research. We are also very grateful to the Pytorch developers. This paper reflects the authors' view only, and the EU is not responsible for any use that may be made of the information it contains. model RANDOM BILSTM ENTLIB ENTNET description gender 1.5 0.4 2.2 1.3 50 - 55 61 job 20 - 27 24 Table 4: Results on the attribute and relation prediction task: percentage accuracy for natural language descrip- tions, mean reciprocal rank of characters for single at- tributes (lower is worse). consider unique descriptions comprising at most 3 properties. Each property is expressed by a noun phrase, whereas the article is adapted (definite or indefinite) depending on whether that property applies to one or several entities in our data. This yields 231 unique natural language descriptions of 66 characters, created on the basis of overall 61 relation types and 56 attribute values. Results. The results of this experiment are nega- tive: The first column of Table 4 shows that models get accuracies near 0. A possibility is that models do encode informa- tion in the entity representations, but it doesn't get used in this task because of how the utterance is encoded in the hidden layer, or that results are due to some quirk in the specific setup of the task. How- ever, we replicated the results in a setup that does not encode whole utterances but works with single attributes and relations. While the methodological details are in the Appendix, the 'gender' and 'job' columns of Table 4 show that results are a bit better in this case but models still perform quite poorly: Even in the case of an attribute like gender, which is crucial for the resolution of third person pronouns (he/she), the models' results are quite close to that of a random baseline. Thus, we take it to be a robust result that entity- centric models trained on the SemEval data do not learn or use entity information -- at least as recov- erable from language cues. This, together with the remainder of the results in the paper, suggests that models rely crucially on speaker information, but hardly on information from the linguistic context.15 Future work should explore alternatives such as pre-training with a language modeling task, which KNOWN. 15Note that 44% of the mentions in the dataset are first per- son, for which linguistic context is irrelevant and the models only need to recover the relevant speaker embedding to suc- ceed. However, downsampling first person mentions did not improve results on the other mention types. References Laura Aina, Carina Silberer, Ionut-Teodor Sorodoc, Matthijs Westera, and Gemma Boleda. 2018. AMORE-UPF at SemEval-2018 Task 4: BiLSTM with Entity Library. In Proc. of SemEval. Trapit Bansal, Arvind Neelakantan, and Andrew Mc- Callum. 2017. RelNet: End-to-End Modeling of En- tities & Relations. CoRR, abs/1706.07179. Razvan Bunescu and Marius Pas¸ca. 2006. Using Ency- clopedic Knowledge for Named Entity Disambigua- tion. In Proc. of EACL. Henry Y. Chen, Ethan Zhou, and Jinho D. Choi. 2017. Robust Coreference Resolution and Entity Linking on Dialogues: Character Identification on TV Show Transcripts. In Proc. of CoNLL 2017. Hui Chen, Baogang Wei, Yonghuai Liu, Yiming Li, Jifang Yu, and Wenhao Zhu. 2018. Bilinear Joint Learning of Word and Entity Embeddings for Entity Linking. Neurocomputing, 294:12 -- 18. Jinho D Choi and Henry Y Chen. 2018. SemEval 2018 Task 4: Character Identification on Multiparty Dia- logues. In Proc. of SemEval. Elizabeth Clark, Yangfeng Ji, and Noah A Smith. 2018. Neural Text Generation in Stories Using Entity Rep- resentations as Context. In Proc. of NAACL. Kevin Clark and Christopher D. Manning. 2016. Im- proving Coreference Resolution by Learning Entity- Level Distributed Representations. In Proc. of ACL. Alexis Conneau, Germ´an Kruszewski, Guillaume Lam- ple, Loıc Barrault, and Marco Baroni. 2018. What You Can Cram into a Single $&!#* Vector: Probing Sentence Embeddings for Linguistic Properties. In Proc. of ACL. Nick Craswell. 2009. Mean Reciprocal Rank. In En- cyclopedia of Database Systems, pages 1703 -- 1703. Springer. Matthew Francis-Landau, Greg Durrett, and Dan Klein. 2016. Capturing Semantic Similarity for Entity Linking with Convolutional Neural Networks. In Proc. of NAACL:HLT. Mario Giulianelli, Jack Harding, Florian Mohnert, Dieuwke Hupkes, and Willem Zuidema. 2018. Un- der the Hood: Using Diagnostic Classifiers to In- vestigate and Improve how Language Models Track Agreement Information. In Proc. of EMNLP Work- shop BlackboxNLP: Analyzing and Interpreting Neu- ral Networks for NLP. Alex Graves, Santiago Fern´andez, and Jurgen Schmid- huber. 2005. Bidirectional LSTM Networks for Im- proved Phoneme Classification and Recognition. In Proc. of ICANN. Alex Graves, Greg Wayne, and Ivo Danihelka. 2014. Neural Turing Machines. CoRR, abs/1410.5401. Kristina Gulordava, Laura Aina, and Gemma Boleda. 2018a. How to Represent a Word and Predict it, too: Improving Tied Architectures for Language Mod- elling. In Proc. of EMNLP. Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. 2018b. Colorless Green Recurrent Networks Dream Hierarchically. In Proc. of NAACL. Aria Haghighi and Dan Klein. 2010. Coreference Reso- lution in a Modular, Entity-Centered Model. In Proc. of NAACL. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2015. Delving Deep into Rectifiers: Surpass- ing Human-Level Performance on ImageNet Classi- fication. In Proc. of ICCV. Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. 2017. Tracking the World In Proc. of State with Recurrent Entity Networks. ICLR. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long Short-Term Memory. Neural Computation, 9(8):1735 -- 1780. Armand Joulin and Tomas Mikolov. 2015. Inferring Algorithmic Patterns with Stack-Augmented Recur- rent Nets. In Proc. of NIPS. Akos K´ad´ar, Grzegorz Chrupała, and Afra Alishahi. 2017. Representation of Linguistic Form and Func- tion in Recurrent Neural Networks. Computational Linguistics, 43(4):761 -- 780. Hans Kamp and Uwe Reyle. 2013. From Discourse to Logic: Introduction to Model-theoretic Semantics of Natural Language, Formal Logic and Discourse Representation Theory, volume 42. Springer Sci- ence+Business Media. Diederik P. Kingma and Jimmy Ba. 2014. Adam: CoRR, A Method for Stochastic Optimization. abs/1412.6980. Nikolaus Kriegeskorte, Marieke Mur, and Peter A Ban- dettini. 2008. Representational Similarity Analysis -- Connecting the Branches of Systems Neuroscience. Frontiers in Systems Neuroscience, 2:4. Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. 2016. Assessing the Ability of LSTMs to Learn Syntax-Sensitive Dependencies. TACL, 4(1):521 -- 535. Rada Mihalcea and Andras Csomai. 2007. Wikify!: Linking Documents to Encyclopedic Knowledge. In Proc. of CIKM. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Cor- rado, and Jeffrey Dean. 2013a. Distributed Repre- sentations of Words and Phrases and Their Compo- sitionality. In Proc. of NIPS. Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013b. Linguistic Regularities in Continuous Space Word Representations. In Proc. of NAACL. Aida Nematzadeh, Kaylee Burns, Erin Grant, Alison Gopnik, and Tom Griffiths. 2018. Evaluating The- In Proc. of ory of Mind in Question Answering. EMNLP. E.W. Noreen. 1989. Computer-Intensive Methods for Testing Hypotheses: An Introduction. Wiley. Cheon-Eum Park, Heejun Song, and Changki Lee. 2018. KNU CI System at SemEval-2018 Task4: Character Identification by Solving Sequence- Labeling Problem. In Proc. of SemEval. Sameer Pradhan, Lance Ramshaw, Mitchell Marcus, Martha Palmer, Ralph Weischedel, and Nianwen Xue. 2011. CoNLL-2011 Shared Task: Modeling Unrestricted Coreference in OntoNotes. In Proc. of CoNLL. Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. 2015. End-to-End Memory Networks. In Proc. of NIPS. Sam Wiseman, Alexander M Rush, and Stuart M Shieber. 2016. Learning Global Features for Coref- erence Resolution. In Proc. of NAACL:HLT. Zichao Yang, Phil Blunsom, Chris Dyer, and Wang Ling. 2017. Reference-Aware Language Models. In Proc. of EMNLP. A Appendices A.1 Hyperparameter search Besides the LSTM parameters, we optimize the token embeddings Wt, the entity/speaker embed- dings We, as well as Wo, Wq, and their corre- sponding biases, where applicable (see Section 3). We used five-fold cross-validation with early stop- ping based on the validation score. We found that most hyperparameters could be safely fixed the same way for all three types. Specifically, our final models were all trained in batch mode using the Adam optimizer (Kingma and Ba, 2014), with each batch covering 25 scenes given to the model in chunks of 750 tokens. The token embeddings (Wt) are initialized with the 300-dimensional word2vec vectors, hi is set to 500 units, and entity (or speaker) embeddings (We) to k = 150 units.With this hyperparameter setting, ENTLIB has fewer pa- rameters than BILSTM: the linear map Wo of the latter (500× 401) is replaced by the query extractor Wq (500 × 150) followed by (non-parameterized) similarity computations. This holds even if we take into account that the entity embedding We used in both models contains 274 entities that are never speakers and that are, hence, used by ENTLIB but not by BILSTM. Our search also considered different types of activation functions in different places, with the architecture presented above, i.e., tanh before the LSTM and ReLU in the gate, robustly yielding the best results. Other settings tested -- randomly initialized token embeddings, self-attention on the input layer, and a uni-directional LSTM -- did not improve performance. We then performed another random search (> 200 models) over the remaining hyperparame- ters: learning rate (sampled from the logarithmic interval 0.001 -- 0.05), dropout before and after LSTM (sampled from 0.0 -- 0.3 and 0.0 -- 0.1, respec- tively), weight decay (sampled from 10−6 -- 10−2) and penalization, i.e., whether to decrease the relative impact of frequent entities by dividing the loss for an entity by the square root of its frequency. This paper reports the best model of each type, i.e., BILSTM, ENTLIB, and ENTNET, after training on all the training data without cross-validation for 20, 80 and 80 epochs respectively (numbers selected based on tendencies in training histories). These models had the following parameters: 0.0011 0.2 0.02 4.3e-6 yes no BILSTM ENTLIB ENTNET 0.0080 0.2 0.0 learning rate: 0.0014 dropout pre 0.0 dropout post: 0.08 weight decay: 1.8e-6 1.0e-5 penalization: yes B Attribute and relation extraction B.1 Details of the dataset We performed a two-step procedure to extract all the available data for the SemEval characters. First, using simple word overlap, we automatically mapped the 401 SemEval names to the characters in the database. In a second, manual step, we cor- rected these mappings and added links that were not found automatically due to name alternatives, ambiguities or misspellings (e.g., SemEval Dana was mapped to Dana Keystone, and Janitor to The Zoo Employee). In total, we found 93 SemEval entities in Friends Central, and we extracted their attributes (gender and job) and their mutual rela- tionships (relatives). Model RANDOM ENTLIB ENTNET (s)he .50 .58 .56 .50 .55 .61 Gender (93;2) Occupation Relatives (wo)man (56;24) (24;17) .20 .27 .24 .16 .22 .26 Table 5: Results on the attribute prediction task (mean reciprocal rank; from 0 (worst) to 1 (best)). The number of considered test items and candidate values, respectively, are given in the parentheses. For gender, we used (wo)man and (s)he as word cues for the values (fe)male. between words. This leverages on regularities in the embedding space, taking the embeddings of pairs that are connected by the same relation to have analogous spatial relations. For two pairs of characters (a, b) and (c, d) which bear the same relation R, we assume a − b ≈ c − d to hold for their vector representations. For a target pair (a, b) and a relation R, we then compute the following measure: (cid:80) (x,y)∈R cos(a − b, x − y) srel((a, b), R) = R (14) Equation (14) computes the average relational sim- ilarity between the target character pair and the exemplars of that relation (excluding the target it- self), where the relational similarity is estimated as the cosine between the vector differences of the two pairs of entity representations respectively. Due to this setup, we restrict to predicting relation types that apply to at least two pairs of entities. For each target pair (a, b), we produce a rank of candidate relations in descending order of their scores srel. Table 5 contains the results, again above baseline but clearly very poor. B.2 Alternative setup We use the same models, i.e. ENTLIB and ENTNET trained on Experiment 1, and (without further train- ing) extract representations for the entities from them. The former are directly obtained from the entity embedding We of each model. In the attribute prediction task, we are given an attribute (e.g., gender), and all its possible values V (e.g., V = {woman, man }). We formulate the task as, given a character (e.g., Rachel), produc- ing a ranking of the possible values in descending order of their similarity to the character, where sim- ilarity is computed by measuring the cosine of the angle between their respective vector representa- tions in the entity space. We obtain representations of attributes values, in the same space as the enti- ties, by inputting each attribute value as a separate utterance to the models, and extracting the corre- sponding entity query (qi). Since the models also expect a speaker for each utterance, we set it to either all entities, main entities, a random entity, or no entity (i.e., speaker embedding with zero in all units), and report the best results. We evaluate the rankings produced for both tasks in terms of mean reciprocal rank (Craswell, 2009), scoring from 0 to 1 (from worst to best) the posi- tion of the target labels in the ranking. The two first columns Table 5 presents the results. Our mod- els generally perform poorly on the tasks, though outperforming a random baseline. Even in the case of an attribute like gender, which is crucial for the resolution of third person pronouns, the models' results are still very close to that of the random baseline. Instead, the task of relation prediction is to, given a pair of characters (e.g., Ross and Monica), predict the relation R which links them (e.g., sis- ter, brother-in-law, nephew; we found 24 relations that applied to at least two pairs). We approach this following the vector offset method introduced by Mikolov et al. (2013b) for semantic relations
1808.02608
1
1808
2018-08-08T03:05:11
End-to-end Speech Recognition with Word-based RNN Language Models
[ "cs.CL", "cs.AI" ]
This paper investigates the impact of word-based RNN language models (RNN-LMs) on the performance of end-to-end automatic speech recognition (ASR). In our prior work, we have proposed a multi-level LM, in which character-based and word-based RNN-LMs are combined in hybrid CTC/attention-based ASR. Although this multi-level approach achieves significant error reduction in the Wall Street Journal (WSJ) task, two different LMs need to be trained and used for decoding, which increase the computational cost and memory usage. In this paper, we further propose a novel word-based RNN-LM, which allows us to decode with only the word-based LM, where it provides look-ahead word probabilities to predict next characters instead of the character-based LM, leading competitive accuracy with less computation compared to the multi-level LM. We demonstrate the efficacy of the word-based RNN-LMs using a larger corpus, LibriSpeech, in addition to WSJ we used in the prior work. Furthermore, we show that the proposed model achieves 5.1 %WER for WSJ Eval'92 test set when the vocabulary size is increased, which is the best WER reported for end-to-end ASR systems on this benchmark.
cs.CL
cs
END-TO-END SPEECH RECOGNITION WITH WORD-BASED RNN LANGUAGE MODELS Takaaki Hori1, Jaejin Cho2, Shinji Watanabe2 1Mitsubishi Electric Research Laboratories (MERL) 2Center for Language and Speech Processing, Johns Hopkins University [email protected], {jcho52, shinjiw}@jhu.edu 8 1 0 2 g u A 8 ] L C . s c [ 1 v 8 0 6 2 0 . 8 0 8 1 : v i X r a ABSTRACT This paper investigates the impact of word-based RNN language models (RNN-LMs) on the performance of end-to-end automatic speech recognition (ASR). In our prior work, we have proposed a multi-level LM, in which character-based and word-based RNN- LMs are combined in hybrid CTC/attention-based ASR. Although this multi-level approach achieves significant error reduction in the Wall Street Journal (WSJ) task, two different LMs need to be trained and used for decoding, which increase the computational cost and memory usage. In this paper, we further propose a novel word- based RNN-LM, which allows us to decode with only the word- based LM, where it provides look-ahead word probabilities to pre- dict next characters instead of the character-based LM, leading com- petitive accuracy with less computation compared to the multi-level LM. We demonstrate the efficacy of the word-based RNN-LMs us- ing a larger corpus, LibriSpeech, in addition to WSJ we used in the prior work. Furthermore, we show that the proposed model achieves 5.1 %WER for WSJ Eval'92 test set when the vocabulary size is increased, which is the best WER reported for end-to-end ASR sys- tems on this benchmark. Index Terms -- End-to-end speech recognition, language mod- eling, decoding, connectionist temporal classification, attention de- coder 1. INTRODUCTION Automatic speech recognition (ASR) is currently a mature set of widely-deployed technologies that enable successful user interface applications such as voice search [1]. However, current systems lean heavily on the scaffolding of complicated legacy architec- tures that grew up around traditional techniques, including hidden Markov models (HMMs), Gaussian mixture models (GMMs), hy- brid HMM/deep neural network (DNN) systems, and sequence discriminative training methods [2]. These systems also require hand-made pronunciation dictionaries based on linguistic assump- tions, extra training steps to derive context-dependent phonetic models, and text preprocessing such as tokenization for languages without explicit word boundaries. Consequently, it is quite diffi- cult for non-experts to develop ASR systems for new applications, especially for new languages. End-to-end ASR has the goal of simplifying the above module- based architecture into a single-network architecture within a deep learning framework, in order to address these issues. End-to-end ASR methods typically rely only on paired acoustic and language data without linguistic knowledge, and train the model with a single algorithm. Therefore, the approach makes it feasible to build ASR systems without expert knowledge. There are several types of end- to-end architecture for ASR such as connectionist temporal classi- fication (CTC) [3], recurrent neural network (RNN) transducer [4], attention-based encoder decoder [5], and their hybrid models [6, 7]. Recently, the use of external language models has shown sig- nificant improvement of accuracy in neural machine translation [8] and end-to-end ASR [9, 10]. This approach is called shallow fu- sion, where the decoder network is combined with an external lan- guage model in log probability domain for decoding. In our previous work [9], we have shown the impact of recurrent neural network lan- guage models (RNN-LMs) in Japanese and Mandarin Chinese tasks, reaching a comparable or higher accuracy to those of state-of-the-art DNN/HMM systems. Since the Japanese and Chinese systems were designed to output character sequences, the RNN-LM was also de- signed as a character-based LM, and effectively combined with the decoder network to jointly predict the next character. A character-based architecture achieves high-accuracy ASR for languages with a large set of characters such as Japanese and Chi- nese. It also enables open vocabulary ASR, in contrast to word-based architectures, which suffer from the out-of-vocabulary (OOV) prob- lem. However, the character-based LMs generally under-perform relative to word LMs for languages with a phonogram alphabet using fewer distinct characters, such as English, because of the difficulty of modeling linguistic constraints across long sequences of characters. Actually, English sentences are much longer than Japanese and Chinese sentences in the length of character sequence. To overcome this problem, we have further extended end-to-end ASR decoding with LMs at both the character and word levels [11]. During the beam search decoding, Hypotheses are first scored with the character-based LM until a word boundary is encountered. Known words are then re-scored using the word-based LM, while the character-based LM provides for out-of-vocabulary scores. This approach exploits the benefits of both character and word level ar- chitectures, and enables high-accuracy open-vocabulary end-to-end ASR. More specifically, the character-based LM yields the following benefits in the decoding process with the word-based LM: 1. Character-based LM can help correct hypotheses survive until they are rescored at word boundaries during the beam search. Before the hypothesis reaches the boundary, the identity of the last word is unknown and its word probability cannot be applied. Hence, good character-level prediction is important to avoid pruning errors for hypotheses within a word. 2. Character-based LM can predict character sequences even for OOV words not included in the vocabulary of the word-based LM. Since the word-based LM basically cannot predict un- seen character sequences, good character-level prediction is important for open-vocabulary ASR. However, the multi-level LM approach has a problem that it re- quires two different RNN-LMs. To build the two LMs, we need to sequence X = x1, . . . , xT , the encoder network accepts X and out- puts hidden vector sequence H = h1, . . . , hT (cid:48), where T (cid:48) = T /4 by using two max-pooling steps in the deep CNN. The decoder network iteratively predicts a single label cl based on the hidden vectors H and the label context c1, . . . , cl−1, and generates L-length label se- quence C = {cl ∈ Ul = 1,··· , L}, where U is a set of labels. In this work, we assume U is a set of distinct characters or alphabet of the target language. The hybrid attention/CTC network utilizes both benefits of CTC and attention during training and decoding by sharing the same CNN/ BLSTM encoder with CTC and attention decoder networks and training them jointly. Unlike the solitary attention model, the forward-backward algorithm of CTC can enforce monotonic align- ment between speech and label sequences during training. That is, rather than solely depending on the data-driven attention mech- anism to estimate the desired alignments in long sequences, the forward-backward algorithm in CTC helps to speed up the process of estimating the desired alignment. The objective to be maximized is a logarithmic linear combination of the CTC and attention-based posterior probabilities pctc(CX) and patt(CX): LMTL = λ log pctc(CX) + (1 − λ) log patt(CX), (1) with a tunable parameter λ : 0 ≤ λ ≤ 1. 2.2. Decoding with external language models The inference step of CTC/attention-based speech recognition is per- formed by output-label synchronous decoding with a beam search. Although the decoding algorithm is basically the same as the method for standard attention-based encoder decoders, it also considers the CTC and LM probabilities to find a better hypothesis. The decoder finds the most probable character sequence C given speech input X, according to C = arg max C∈U∗ {λ log pctc(CX) + (1 − λ) log patt(CX) +γ log plm(C)} , (2) where LM probability plm(C) is added with scaling factor γ to the CTC/attention probability in the log probability domain. In the beam search process, the decoder computes a score of each partial hypothesis, which is defined as the log probability of the hypothesized character sequence. The joint score α(g) of each partial hypothesis h is computed by α(h) = λαctc(h) + (1 − λ)αatt(h) + γαlm(h), (3) where αctc(h), αatt(h), and αlm(h) are CTC, attention, and LM scores, respectively. With the attention model, score αatt(h) can be obtained recur- sively as αatt(h) = αatt(g) + log patt(cg, X), (4) where g is an existing partial hypothesis, and c is a character label appended to g to generate h, i.e., h = g · c. The score for h is ob- tained as the addition of the original score αatt(g) and the conditional log probability given by the attention decoder. LM score αlm(h) is also obtained similarly to the attention model as αlm(h) = αlm(g) + log plm(cg). (5) On the other hand, CTC score αctc(h) is obtained differently from the other scores, where we compute the CTC prefix probability Fig. 1. Hybrid attention/CTC network with LM extension: the shared encoder contains a VGG net followed by BLSTM layers and trained by both CTC and attention model objectives simultaneously. The joint decoder predicts an output label sequence by the CTC, at- tention decoder and RNN-LM. take additional time and effort, almost twice of them, for training the models. Moreover, the two LMs also increase the computational cost and memory usage for decoding. Inherently, RNN-LMs need a lot of computation for training and decoding compared with con- ventional N-gram LMs. In addition, text corpora for training LMs are usually much larger than paired acoustic and text data for train- ing end-to-end ASR models. Considering this situation, solving the above problem is crucial for better end-to-end ASR. In this paper, we propose a novel strategy for language modeling and decoding in end-to-end ASR to solve the problem. The proposed method allows us to decode with only a word-based RNN-LM in addition to the encoder decoder, leading a competitive accuracy and less computation in the decoding process compared to the multi-level LM approach. This method employs look-ahead word probabilities to predict next characters instead of the character-based LM. Al- though our approach is similar to old fashioned lexical-tree search al- gorithms including language model look-ahead [12, 13], it provides an efficient way of dynamically computing the look-ahead probabil- ities for end-to-end ASR with a word-based RNN-LM, which does not exist in the prior work. We demonstrate the efficacy of the pro- posed LMs on standard Wall Street Journal (WSJ) and LibriSpeech tasks. 2. END-TO-END ASR ARCHITECTURE This section explains the hybrid CTC/attention network [6, 7] we used for evaluating the proposed language modeling and decoding approach. But the proposed LMs can also be applied to standard attention-based encoder decoders for ASR. 2.1. Network architecture Figure 1 shows the latest architecture of the CTC/attention network [9]. The encoder has deep convolutional neural network (CNN) layers with the VGG net architecture [14], which are followed by stacked bidirectional long short-term memory (BLSTM) layers. The decoder network has a CTC network, an attention decoder network, and an RNN-LM, which jointly predict the next label. Given input Deep CNN (VGG net) BLSTM Attention Decoder RNN-LM CTC cl cl-1 xt x1 xT …… …… …… …… Shared Encoder Joint Decoder (cid:88) [15] defined as the cumulative probability of all label sequences that have h as their prefix: p(h, . . .X) = P (h · νX), ν∈(U∪{<eos>})+ and use it as the CTC score: αctc(h) (cid:44) log p(h, . . .X), (6) (7) where ν represents all possible label sequences except the empty string, and <eos> indicates the end of sentence. During the beam search, the number of partial hypotheses for each length is limited to a predefined number, called a beam width, to exclude hypotheses with relatively low scores, which dramatically improves the search efficiency. 3. INCORPORATING WORD-BASED RNN-LMS In this section, we explain the basic approach to incorporate word- based LMs into a character-based end-to-end ASR, and present two word-based RNN-LMs, one is a multi-level LM we have already proposed and the other is a look-ahead word LM we propose in this paper. 3.1. Basic approach In most end-to-end ASR systems, a finite lexicon and an N-gram language model are compiled into a Weighted Finite-State Trans- ducer (WFST), and used for decoding [16, 17]. The WFST frame- work efficiently handles frame-synchronous or label-synchronous decoding with the optimized search network and reduces the word error rate [18, 19]. However, this approach is not suitable for RNN- LMs because an RNN-LM cannot be represented as a static state network. In this paper, we extend the character-based decoding to enable open-vocabulary end-to-end ASR with a word-based RNN-LM. We consider that the character-based systems can predict space charac- ters between words as well as letters within the word. Note that the space character has an actual character code, which is different from the CTC's blank symbol. With the space characters, it is possible to deterministically map any character sequence to a word sequence, e.g., character sequence a <space> c a t <space> e a t s is mapped to a unique word sequence 3.2. Multi-level RNN-LM The multi-level RNN-LM contains character-level and word-level RNN-LMs, but it can be implemented as a function that performs character-level prediction. Let V be the vocabulary of the word-level RNN-LM and be including an abstract symbol of OOV word such as <UNK>. We compute the conditional character probabilities with  pwlm(wgψg ) pclm(wgψg ) pwlm(<UNK>ψg) β pclm(cg) plm(cg) = if c ∈ S, wg ∈ V if c ∈ S, wg (cid:54)∈ V otherwise (8) where S denotes a set of labels that indicate the end of word, i.e., S = {<space>, <eos>}, wg is the last word of the character se- quence g, and ψg is the word-level history, which is the word se- quence corresponding to g excluding wg. For the above example, g, wg, and ψg are set as g = a, <space>, c, a, t, <space>, e, a, t, s wg = eats ψg = a, cat. β is a scaling factor used to adjust the probabilities for OOV words. The first condition on the right-hand side of Eq. (8) is applied when the g has reached the end of a word. In this case, the word-level probability pwlm(wgψg) is computed using the word-level RNN- LM. The denominator pclm(wgψg) is the probability of wg obtained by the character-level RNN-LM and used to cancel the character- level LM probabilities accumulated for wg. The probability can be computed as pclm(wgψg) = pclm(wg,iψgwg,1 ··· wg,i−1), (9) i=1 where wg is the length of word wg in characters and wg,i indicates the i-th character of wg. The second term, pwlm(<UNK>ψg) acts as a weight on the character-level LM and ensures that the combined lan- guage model is normalized over character sequences both at word boundaries and in-between. If wg is an OOV word as in the sec- ond condition, we assume that a word-level probability for the OOV word can be computed with the word and character-level RNN-LMs as poov(wgψg) = pwlm(<UNK>ψg)pclm(wg<UNK>, ψg). (10) Since the character-level probability satisfies pclm(wg<UNK>, ψg) ∝ pclm(wgψg) (11) wg(cid:89) a cat eats and where <space> formally represents the space character. Accord- ingly, only when the decoder hypothesizes a space character, it com- putes the probability of the last word using the word-level RNN-LM and simply accumulates it to the hypothesis score. No special treat- ment is necessary for different types of homonyms: words with the same spelling but different pronunciation are handled in a context- dependent way by the word language model, whereas words with the same pronunciation but different spellings are automatically handled as different word hypotheses in the beam search. Similarly, ambigu- ous word segmentations are automatically handled as different de- coding hypotheses. pclm(wg<UNK>, ψg) = β(ψg) pclm(wgψg), (12) we approximate β(ψg) ≈ β and use β as a tunable parameter. In the second condition of Eq. (8), character-based probability pclm(wgψg) is eliminated since it is already accumulated for the hypothesis. The third case gives the character-level LM probabilities to the hypotheses within a word. Although the character-level LM proba- bilities are canceled at the end of every known word hypothesis and so are only used to score OOV words, they serve another impor- tant role in keeping the correct word hypotheses active in the beam search until the end of the word where the word-level LM probability is applied. i(cid:88) set of succeeding nodes from ng, and η is a scaling factor for OOV word probabilities, which is a tunable parameter. The first case of Eq. (15) gives the word probability at a word- end node, where pwlm(wgψg) needs to be normalized by pla(ngψg) to cancel the already accumulated look-ahead probabilities. The sec- ond case computes the look-ahead probability when making a tran- sition from node ng to ng·c. The third case gives the OOV word probability, where character c is not accepted, which means the hy- pothesis is going to an OOV word. The last one handles the case that ng is null, which means that the hypothesis is already out of the tree, and it returns 1 since the OOV probability was already applied in the third case. In the above procedure, we assume that whenever the hypothesis is extended by <space> label, the new hypothesis points the root node of the tree. Although this approach is similar to conventional ASR systems based on a prefix tree search including a LM look-ahead mechanism, the look-ahead probabilities needs to be computed on the fly using the word-based RNN-LM unlike conventional approaches with uni- gram or bigram LM or weight pushing over a static WFST. To compute the sum of probabilities in Eq. (14), we assume that the Id numbers are assigned in alphabetical order in the vocabulary. In this case, the Id numbers should be consecutive in each set as a property of prefix tree. Accordingly, we can compute the sum using the cumulative sums over the word probability distribution by pla(nψ) = sψ[max id(n)] − sψ[min id(n) − 1], (16) where sψ[·] denotes an array of the cumulative sums given context ψ, which is obtained as sψ[i] = pwlm(w(k)ψ) for i = 0, . . . ,V, (17) k=0 and max id(n) and min id(n) are the maximum and minimum Id numbers in the set of anticipated words at node n. w(k) denotes the k-th word in the vocabulary. Once the cumulative sums are com- puted right after the softmax operation, we can quickly compute the look-ahead probabilities. 4. RELATED WORK There are some prior work, that incorporates word units into end- to-end ASR. One major approach is acoustic-to-word CTC [20, 21, 22], where the input acoustic feature sequence is directly mapped to the word sequence using CTC. However, this approach essentially requires a large amount of paired acoustic and text data to learn acoustic mapping to a large number of words. For example, [20] used 125,000 hours of transcribed audio data to train the word CTC model. Our approach, in contrast, is specially designed for end-to-end ASR using a character or subword-based encoder decoder and an external RNN language model trained with a large text corpus. Thus, this architecture is more suitable for low-resource languages, where the amount of parallel data is limited but large text data are available. Subword units [23, 24] are also available as an intermediate rep- resentation of character and word, where the unit set is automatically obtained by byte-pair encoding [25] or some chunking techniques. However, this approach needs to select an appropriate number of subword units using training data. Increasing the number of units will lead more acoustically expressive units but make it more diffi- cult to train the encoder decoder using a limited amount of data. In addition, it assumes to use the subword units for both the encoder Fig. 2. Prefix tree representation of a vocabulary. (a) vocabulary including word strings and id numbers. (b) prefix tree of the vocab- ulary, where the shaded circle indicates the root node, each white circle is a node representing a character and each path from the root node represents a character sequence of each word, where each double-circle node corresponds to a word end. Finally, the log probability of sentence-end label <eos> is added to the log probability of each complete hypothesis g(cid:48) as (cid:48) ) = α(g) + γ log pwlm(<eos>ψgwg) α(g (13) in the beam search process. 3.3. Look-ahead word-based RNN-LM The look-ahead word-based RNN-LM enables us to decode with only a word-based RNN-LM in addition to the encoder decoder. This model predicts next characters using a look-ahead mechanism over the word probabilities given by the word-based LM, while the multi- level LM uses a character-level LM until the identity of the word is determined. To compute look-ahead probabilities efficiently, we use a prefix tree representation as shown in Fig. 2. This example shows a vo- cabulary and its prefix tree representation. During decoding, each hypothesis holds a link to a node, which indicates where the hypoth- esis is arriving in the tree. Suppose a set of anticipated words at each node has already been obtained in advance. A look-ahead probabil- ity at node n can be computed as the sum of the word probabilities of all the anticipated words as pla(nψ) = pwlm(wψ), (cid:88) (14) w∈wset(n) where wset(n) denotes the set of anticipated words at node n, and pwlm(wψ) is the original word probability given by the underlying word-based RNN-LM for word-level context ψ. The character-based LM probability with the look-ahead mech- anism is computed as  pwlm(wgψg)/pla(ngψg) pla(ng·cψg)/pla(ngψg) pwlm(<UNK>ψg)η 1 plm(cg) = if ng ∈ F, c ∈ S if ng (cid:54)= null, c ∈ ξ(ng) if ng (cid:54)= null, c (cid:54)∈ ξ(ng) otherwise (15) where F denotes a set of word end nodes, ng is the node that g has arrived, ng·c is a succeeding node of ng determined by c, ξ(ng) is a <UNK> A AN AND ANNA AT BIT BY ZIP ZOO : : : (a) Vocabulary with word Ids A B Z N T I Y T D N A O O I P Root node (b) Prefix tree 0 1 2 3 4 5 6 7 999 1000 decoder and the language model, but the appropriate units can be different for the encoder decoder and the language model. Our ap- proach basically employs characters and words, but it is also possible to combine a character-based encoder decoder with a subword-based LM or a subword-based encoder decoder with a word-based LM. 5. EXPERIMENTS We evaluate the proposed language models with the Wall Street Jour- nal (WSJ) and LibriSpeech corpora. WSJ is a well-known English clean speech database [26, 27] including approximately 80 hours data while LibriSpeech is a larger data set of read speech from au- diobooks, which contains 1000 hours of audios and transcriptions [28]. 5.1. Evaluation with WSJ We used the si284 data set for training, the dev93 data set for val- idation, and the eval92 data set for evaluation. The data sets are summarized in Table 1. Table 1. WSJ data sets used for evaluation # utterances Length (h) Training (WSJ1 si284) Validation (dev93) Evaluation (eval92) 37,416 503 333 80 1.1 0.7 As input features, we used 80 mel-scale filterbank coefficients with pitch features and their delta and delta delta features for the CNN/BLSTM encoder [29]. Our encoder network is boosted by using deep CNN, which is discussed in Section 2.1. We used a 6- layer CNN architecture based on the initial layers of the VGG-like network [14] followed by eight BLSTM layers in the encoder net- work. In the CNN architecture, the initial three input channels are composed of the spectral features, delta, and delta delta features. In- put speech feature images are downsampled to (1/4 × 1/4) images along with the time-frequency axes through the two max-pooling layers. The BLSTM layers had 320 cells in each layer and direction, and the linear projection layer with 320 units is followed by each BLSTM layer. We used the location-based attention mechanism [5], where the 10 centered convolution filters of width 100 were used to extract the convolutional features. The decoder was a one-layer unidirectional LSTM with 300 cells. We used only 32 distinct labels: 26 English letters, apostrophe, period, dash, space, noise, and sos/eos tokens. The AdaDelta algorithm [30] with gradient clipping [31] was used for the optimization. We also applied a unigram label smooth- ing technique [32] to avoid over-confidence predictions. In the hy- brid attention/CTC architecture, we used the λ = 0.1 for training and the λ = 0.2 for decoding. The beam width was set to 30 in decoding under all conditions. The joint CTC-attention ASR was implemented by using the Chainer deep learning toolkit [33]. Character and word-based RNN-LMs were trained with the WSJ text corpus, which consisted of 37M words from 1.6M sentences. The character-based LM had a single LSTM layer with 800 cells and a 32-dimensional softmax layer while the word-based LM had a single LSTM layer with 1000 cells. We trained word-based RNN- LMs for 20K, 40K and 65K vocabularies, where the softmax layer had 20K, 40K or 65K-dimensional output in each LM. We used the stochastic gradient descent (SGD) to optimize the RNN-LMs. Table 2. Word error rate (WER) with different language models on WSJ. Language models (vocab. size) No LM Chararacter LM Word LM (20K) Multi-level LM (20K) Look-ahead LM (20K) Multi-level LM (40K) Look-ahead LM (40K) Multi-level LM (65K) Look-ahead LM (65K) dev93 17.3 12.3 17.1 9.6 9.5 9.3 8.6 9.0 8.4 eval92 13.4 7.7 12.6 5.6 6.1 5.3 5.3 5.4 5.1 Fig. 3. Decoding time ratio in the beam search using different lan- guage models. Every elapsed time was divided by that of the No LM case. The first experiment evaluates the contributions of language models. Table 2 shows word error rate (WER) with different lan- guage models. The WERs for no language model (No LM), char- acter LM, word LM (20K) and multi-level LM (20K) were already reported in [11], where the multi-level LM (20K) performed the best in our prior work. When we simply applied the word-based LM without any character-level LMs or look-ahead mechanism, the WER reduction was very small due to the pruning errors discussed in Introduction. After that, we conducted experiments with the look-ahead LM (20K), where the WER for eval92 test set increased from 5.6 % to 6.1 %. We analyzed the recognition results, and found that the in- creased errors mainly came from OOV words. This could be be- cause the look-ahead LM did not use a strong character-based LM for predicting OOV words. To mitigate this problem, we increased the vocabulary size to 40K and 65K. Then, we obtained a large im- provement reaching 5.1 % WER for the look-ahead LM. The rea- son why the 65K-look-ahead LM achieved lower WERs than those of multi-level LMs is probably that the look-ahead mechanism pro- vided better character-level LM scores consistent with the word LM probabilities, which were helpful in the beam search process. Next, we investigated the decoding time when using different language models. Figure 3 shows the decoding time ratio, where each decoding time was normalized by the pure end-to-end decod- ing time without language models, i.e., the case of No LM, where we only used a single CPU for each decoding process 1. The charac- ter LM and 20K-word multi-level LM increased the decoding time 1Since the beam search-based decoding was implemented in Python, the decoding speed has not been optimized sufficiently. 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 No LM Character LM Mul6--‐level 20K Look--‐ahead 20K Mul6--‐level 40K Look--‐ahead 40K Mul6--‐level 65K Look--‐ahead 65K Decoding *me ra*o Word LM Chararacter LM Encoder decoder Table 3. Comparison with other end-to-end ASR systems reported on WSJ. Table 5. Word error rate (WER) with different language models on LibriSpeech Language models (vocab. size) No LM Character LM Multi-level LM (20K) Look-ahead LM (20K) Multi-level LM (40K) Look-ahead LM (40K) Multi-level LM (65K) Look-ahead LM (65K) End-to-end ASR systems seq2seq [17] CTC [3] CTC [16] seq2seq [32] Multi-level LM (20K) [11] Look-ahead LM (65K) [this work] dev93 eval92 - - - 9.7 9.6 8.4 9.3 8.2 7.3 6.7 5.6 5.1 Table 4. LibriSpeech data sets used for evaluation # utterances Length (h) dev clean 7.7 6.6 5.7 6.3 5.4 5.6 5.4 5.4 dev other 21.1 18.3 16.0 16.6 15.6 15.8 15.6 15.6 test clean 7.7 6.6 5.9 6.4 5.5 5.7 5.5 5.5 test other 21.9 19.1 16.8 17.4 16.5 16.7 16.6 16.5 Train set dev clean dev other test clean test other 281,231 2,703 2,864 2,620 2,939 960 5.3 5.1 5.4 5.3 by 40% and 65%, respectively, while the 20K-word look-ahead LM increased it by 38%. Even when we used the 65K-word LMs, the decoding time for the look-ahead LM was still 55%, which was less than that of the 20K multi-level LM. Thus, the proposed look-ahead LM has a higher accuracy to multi-level LMs with less decoding time. Finally, we compare our result with other end-to-end systems reported on the WSJ task. Table 3 summarizes the WER numbers obtained from other articles and this work. Since the systems in the table have different network architectures from each other, it is difficult to compare these numbers directly. However, we confirmed that our system has achieved the best WER in the state-of-the-art systems on the WSJ benchmark. 5.2. Evaluation with LibriSpeech We conducted additional experiments using LibriSpeech to examine the performance of RNN-LMs including character LM, multi-level LM and look-ahead word LM for a larger corpus. The data sets are summarized in Table 4. All the experiments for LibriSpeech were performed using ESPnet, the End-to-End Speech Processing Toolkit [34], and the recipe for a baseline LibriSpeech setup with PyTorch backend [35]. According to the baseline recipe, we trained an 8-layer BLSTM encoder including 320 cells in each layer and direction, and the linear projection layer with 320 units followed by each BLSTM layer. The second and third bottom LSTM layers of the encoder read every second state feature in the network below, reducing the utterance length by a factor of four, i.e., T /4. We also used location- based attention with a similar setting to the WSJ model. The decoder was a one-layer unidirectional LSTM with 300 cells. We also trained different language models as prepared for WSJ task, where we used only transcription of audio data including 9.4M words. The both character and word RNN-LMs had 2 LSTM layers and 650 cells per layer. The beam width was set to 20 for decoding. Table 5 shows word error rate (WER) with different language models. We obtained consistent error reduction with WSJ's results in Table 2, where the both multi-level and look-ahead LMs provided significant error reduction when the vocabulary size was increased to 65K. In this case, the look-ahead LM had competitive WERs to the multi-level LM. However, the look-ahead LM still has the speed benefit similar to the results in Fig. 3 and the other benefit that we can completely exclude the training process of the character LM. 6. CONCLUSION In this paper, we proposed a word-based RNN language model (RNN-LM) including a look-ahead mechanism for end-to-end au- tomatic speech recognition (ASR). In our prior work, we com- bined character-based and word-based language models in hybrid CTC/attention-based encoder decoder architecture. Although the LM with both the character and word levels achieves significant error reduction, two different LMs need to be trained and used for decoding, which increase the computational cost and mem- ory usage. The proposed method allows us to decode with only a word-based RNN-LM, which leads competitive accuracy and less computation in the beam search process compared to the multi-level LM approach. Furthermore, it can completely exclude the training process for the character-level LM. We have shown the efficacy of the proposed method on standard Wall Street Journal (WSJ) and LibriSpeech tasks in terms of computational cost and recognition ac- curacy. Finally, we demonstrated that the proposed method achieved 5.1 %WER for WSJ Eval'92 test set when the vocabulary size was increased, which is the best WER reported for end-to-end ASR systems on this benchmark. 7. REFERENCES [1] Tara N. Sainath, Oriol Vinyals, Andrew Senior, and Hasim Sak, "Convolutional, Long Short-Term Memory, Fully Connected Deep Neural Networks," in IEEE International Conference on Acoustics, Speech and Signal Processing, 2015. [2] Daniel Povey, Arnab Ghoshal, Gilles Boulianne, Lukas Bur- get, Ondrej Glembek, Nagendra Goel, Mirko Hannemann, Petr Motlicek, Yanmin Qian, Petr Schwarz, Jan Silovsky, Georg Stemmer, and Karel Vesely, "The Kaldi speech recognition toolkit," in IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), Dec. 2011. [3] Alex Graves and Navdeep Jaitly, "Towards end-to-end speech recognition with recurrent neural networks," in International Conference on Machine Learning (ICML), 2014, pp. 1764 -- 1772. [4] Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton, "Speech recognition with deep recurrent neural networks," in Acoustics, speech and signal processing (icassp), 2013 ieee in- ternational conference on. IEEE, 2013, pp. 6645 -- 6649. [5] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio, "Attention-based mod- els for speech recognition," in Advances in Neural Information Processing Systems (NIPS), 2015, pp. 577 -- 585. [6] Suyoun Kim, Takaaki Hori, and Shinji Watanabe, "Joint CTC- attention based end-to-end speech recognition using multi- task learning," in IEEE International Conference on Acous- tics, Speech and Signal Processing (ICASSP), 2017, pp. 4835 -- 4839. [7] Takaaki Hori, Shinji Watanabe, and John R. Hershey, "Joint CTC/attention decoding for end-to-end speech recognition," in Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (ACL): Human Language Tech- nologies: long papers, 2017. [8] Caglar Gulcehre, Orhan Firat, Kelvin Xu, Kyunghyun Cho, Loic Barrault, Huei-Chi Lin, Fethi Bougares, Holger Schwenk, and Yoshua Bengio, "On using monolingual corpora in neural machine translation," arXiv preprint arXiv:1503.03535, 2015. [9] Takaaki Hori, Shinji Watanabe, Yu Zhang, and William Chan, "Advances in joint CTC-attention based end-to-end speech recognition with a deep CNN encoder and RNN-LM," in IN- TERSPEECH, 2017. [10] Anjuli Kannan, Yonghui Wu, Patrick Nguyen, Tara N Sainath, Zhifeng Chen, and Rohit Prabhavalkar, "An analysis of in- corporating an external language model into a sequence-to- sequence model," arXiv preprint arXiv:1712.01996, 2017. [11] Takaaki Hori, Shinji Watanabe, and John R Hershey, "Multi- level language modeling and decoding for open vocabulary end-to-end speech recognition," in Automatic Speech Recogni- tion and Understanding Workshop (ASRU), 2017 IEEE. IEEE, 2017, pp. 287 -- 293. [12] Stefan Ortmanns, Hermann Ney, and Andreas Eiden, "Language-model look-ahead for large vocabulary speech recognition," in Spoken Language, 1996. ICSLP 96. Proceed- ings., Fourth International Conference on. IEEE, 1996, vol. 4, pp. 2095 -- 2098. [13] Fil Alleva, Xuedong Huang, and Mei-Yuh Hwang, "Improve- ments on the pronunciation prefix tree search organization," in Acoustics, Speech, and Signal Processing, 1996. ICASSP- 96. Conference Proceedings., 1996 IEEE International Con- ference on. IEEE, 1996, vol. 1, pp. 133 -- 136. [14] Karen Simonyan and Andrew Zisserman, "Very deep convo- lutional networks for large-scale image recognition," arXiv preprint arXiv:1409.1556, 2014. [15] Alex Graves, "Supervised sequence labelling with recur- rent neural networks," PhD thesis, Technische Universitat Munchen, 2008. [16] Yajie Miao, Mohammad Gowayyed, and Florian Metze, "EESEN: End-to-end speech recognition using deep RNN models and WFST-based decoding," in IEEE Workshop on Au- tomatic Speech Recognition and Understanding (ASRU), 2015, pp. 167 -- 174. [17] Dzmitry Bahdanau, Jan Chorowski, Dmitriy Serdyuk, Phile- "End-to-end attention- mon Brakel, and Yoshua Bengio, based large vocabulary speech recognition," in IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP), 2016, pp. 4945 -- 4949. [18] Mehryar Mohri, Fernando Pereira, and Michael Riley, "Weighted finite-state transducers in speech recognition," Computer Speech & Language, vol. 16, no. 1, pp. 69 -- 88, 2002. [19] Takaaki Hori and Atsushi Nakamura, "Speech recognition al- gorithms using weighted finite-state transducers," Synthesis Lectures on Speech and Audio Processing, vol. 9, no. 1, pp. 1 -- 162, 2013. [20] Hagen Soltau, Hank Liao, and Hasim Sak, "Neural speech recognizer: Acoustic-to-word lstm model for large vocabulary speech recognition," arXiv preprint arXiv:1610.09975, 2016. [21] Kartik Audhkhasi, Bhuvana Ramabhadran, George Saon, Michael Picheny, and David Nahamoo, "Direct acoustics-to- word models for english conversational speech recognition," arXiv preprint arXiv:1703.07754, 2017. [22] Jinyu Li, Guoli Ye, Rui Zhao, Jasha Droppo, and Yifan Gong, "Acoustic-to-word model without oov," in Automatic Speech Recognition and Understanding Workshop (ASRU), 2017 IEEE. IEEE, 2017, pp. 111 -- 117. [23] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mo- hammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al., "Google's neural ma- chine translation system: Bridging the gap between human and machine translation," arXiv preprint arXiv:1609.08144, 2016. "Ex- ploring architectures, data and units for streaming end-to- in Automatic end speech recognition with rnn-transducer," Speech Recognition and Understanding Workshop (ASRU), 2017 IEEE. IEEE, 2017, pp. 193 -- 199. [24] Kanishka Rao, Has¸im Sak, and Rohit Prabhavalkar, [25] Philip Gage, "A new algorithm for data compression," The C Users Journal, vol. 12, no. 2, pp. 23 -- 38, 1994. [26] Linguistic Data Consortium, "CSR-II (wsj1) complete," Lin- guistic Data Consortium, Philadelphia, vol. LDC94S13A, 1994. [27] John Garofalo, David Graff, Doug Paul, and David Pal- lett, "CSR-I (wsj0) complete," Linguistic Data Consortium, Philadelphia, vol. LDC93S6A, 2007. [28] Vassil Panayotov, Guoguo Chen, Daniel Povey, and Sanjeev Khudanpur, "Librispeech: an asr corpus based on public do- main audio books," in Acoustics, Speech and Signal Process- ing (ICASSP), 2015 IEEE International Conference on. IEEE, 2015, pp. 5206 -- 5210. [29] Yu Zhang, William Chan, and Navdeep Jaitly, "Very deep convolutional networks for end-to-end speech recognition," in IEEE International Conference on Acoustics, Speech and Sig- nal Processing, 2017. [30] Matthew D Zeiler, "Adadelta: an adaptive learning rate method," arXiv preprint arXiv:1212.5701, 2012. [31] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio, "On the difficulty of training recurrent neural networks," arXiv preprint arXiv:1211.5063, 2012. [32] Jan Chorowski and Navdeep Jaitly, "Towards better decoding and language model integration in sequence to sequence mod- els," arXiv preprint arXiv:1612.02695, 2016. [33] Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton, "Chainer: a next-generation open source framework for deep learning," in Proceedings of Workshop on Machine Learning Systems (LearningSys) in NIPS, 2015. [34] Shinji Watanabe, Takaaki Hori, Shigeki Karita, Tomoki Hayashi, Jiro Nishitoba, Yuya Unno, Nelson Enrique Yalta So- plin, Jahn Heymann, Matthew Wiesner, Nanxin Chen, et al., "Espnet: End-to-end speech processing toolkit," arXiv preprint arXiv:1804.00015, 2018. [35] Nikhil Ketkar, "Introduction to pytorch," in Deep Learning with Python, pp. 195 -- 208. Springer, 2017.
1708.03246
1
1708
2017-08-10T15:03:12
SESA: Supervised Explicit Semantic Analysis
[ "cs.CL", "cs.AI" ]
In recent years supervised representation learning has provided state of the art or close to the state of the art results in semantic analysis tasks including ranking and information retrieval. The core idea is to learn how to embed items into a latent space such that they optimize a supervised objective in that latent space. The dimensions of the latent space have no clear semantics, and this reduces the interpretability of the system. For example, in personalization models, it is hard to explain why a particular item is ranked high for a given user profile. We propose a novel model of representation learning called Supervised Explicit Semantic Analysis (SESA) that is trained in a supervised fashion to embed items to a set of dimensions with explicit semantics. The model learns to compare two objects by representing them in this explicit space, where each dimension corresponds to a concept from a knowledge base. This work extends Explicit Semantic Analysis (ESA) with a supervised model for ranking problems. We apply this model to the task of Job-Profile relevance in LinkedIn in which a set of skills defines our explicit dimensions of the space. Every profile and job are encoded to this set of skills their similarity is calculated in this space. We use RNNs to embed text input into this space. In addition to interpretability, our model makes use of the web-scale collaborative skills data that is provided by users for each LinkedIn profile. Our model provides state of the art result while it remains interpretable.
cs.CL
cs
SESA: Supervised Explicit Semantic Analysis Dasha Bogdanova and Majid Yazdani dbogdanova,[email protected] LinkedIn Corporation Dublin, Ireland Abstract In recent years supervised representation learning has provided state of the art or close to the state of the art results in semantic analysis tasks including ranking and information retrieval. The core idea is to learn how to embed items into a latent space such that they optimize a supervised objective in that latent space. The dimensions of the latent space have no clear semantics, and this reduces the interpretability of the system. For example, in personalization models, it is hard to explain why a particular item is ranked high for a given user profile. We propose a novel model of representation learning called Supervised Explicit Semantic Analysis (SESA) that is trained in a supervised fashion to embed items to a set of dimensions with explicit semantics. The model learns to compare two objects by representing them in this explicit space, where each dimension corresponds to a concept from a knowledge base. This work extends Explicit Semantic Analysis (ESA) [8] with a supervised model for ranking problems. We apply this model to the task of Job-Profile relevance in LinkedIn in which a set of skills defines our explicit dimensions of the space. Every profile and job are encoded to this set of skills their similarity is calculated in this space. We use RNNs to embed text input into this space. In addition to interpretability, our model makes use of the web-scale collaborative skills data that is provided by users for each LinkedIn profile. Our model provides state of the art result while it remains interpretable. 1 Introduction and related work Feature selection is one of the most cumbersome tasks in creating a machine learning system. Representation learning tries to automate this task by creating numerical vectors that best reflect the semantics of the objects for a given task. These vectors can then be fed to machine learning algorithms. Most methods for obtaining vector representations of words and documents rely on the distributional hypothesis which states that words in similar contexts have similar meanings [9]. Early methods were mostly count-based, i.e. relied on term frequencies in different contexts as the representation of meaning. One of the earliest and most known examples is the TF-IDF vector space model [16] that normalizes the term frequencies by inverted document frequencies to reduce the weights of the terms that frequently appear in all documents. The main shortcoming of the TF-IDF model is the assumption of independence among dimensions (words); words have different types and degrees of relationships among each other and the independence assumption is too simplistic for this case. Latent space methods were proposed to address this issue. For example, another count-based technique for inferring vector representations is Latent Semantic Analysis (LSA) [6], that also starts with a high-dimensional term-frequency matrix and maps it to a latent low-dimensional space by applying Singular Value Decomposition (SVD). Other methods include a probabilistic version of latent semantic analysis [11] and Latent Dirichlet Allocation [4]. More recently, the predictive methods for modeling semantics have gained popularity. These methods treat the task of mapping a word to a meaningful vector as a predictive machine learning task instead of relying on word counts. For instance, the Continuous Bag of Words and the Skip-gram models [15] of the widely 1 Representation Learning Algorithms Supervised/Unsupervised Unsupervised Supervised Interpretable TF-IDF [16] ESA [8] SESA Uninterpretable LSA [6], PLSA [11] LDA [4], word2vec [15] DSSM [12, 18, 17] PSI [2] Table 1: Representation learning algorithms used word2vec tool. These predictive methods have been shown to beat the count-based ones in most Natural Language Processing (NLP) tasks [3]. The word2vec models were extended to learn document representations [13]. In contrast to words in TF-IDF model, the dimensions of these latent space models have no clear meaning, resulting sometimes in hard to interpret results and difficult to introspect machine learned systems. Interpretability of the machine learning methods has become an issue, as many applications concern not only about the prediction being correct but also about the reasons that decision has been made [14]. Explicit Semantic Analysis (ESA) [8] tries to address this issue. It represents words as vectors in which each dimension corresponds to a knowledge base entity that is usually a Wikipedia article. It builds an inverted index of word frequencies in Wikipedia pages; each word is represented as a vector of the size of Wikipedia articles, such that the weight of each dimension is the word frequency in the corresponding Wikipedia article. To get a representation of a document, one can average the representations of all the words in that document. All the above representation learning methods are unsupervised, and while providing us with a generic representation of the objects, they usually need to be optimized for a specific task. In recent years many supervised representation learning models were proposed for relevance, ranking and information retrieval tasks. Polynomial Semantic Indexing (PSI) can be viewed as a supervised version of LSA that is trained for ranking [2]. Similarly, in [20] images and words are embedded to a same latent space for image tagging task. Deep Semantic Similarity Model (DSSM) has been used in information retrieval and web search ranking, and also ad selection/relevance, contextual entity search, and interestingness tasks [12, 18, 17]. These supervised representation learning models provide state of the art for ranking and relevance tasks, but remain uninterpretable. We propose an interpretable alternative for supervised representation learning for ranking and relevance tasks by extending ESA algorithm. Table 1 categorizes the representation learning algorithms regarding supervision signal they use and their interpretability. The rest of this paper describes SESA more in detail and presents ongoing experiments on the job-profile relevance task. 2 SESA: Supervised Explicit Semantic Analysis SESA represents objects in a space where each dimension has a human interpretable semantics. The model consists of the following components: (1) encoder, that maps an object to a latent space; (2) knowledge base, that provides the explicit categories; (3) projector, that projects the latent representations to the explicit space; (4) similarity scorer, that estimates the similarity between objects in the explicit space. To train parameters of our model we also need labeled data and a loss function. We describe the components more in detail in the remainder of this section. 2.1 Encoder The encoder maps an object to a latent space. This could be any function, but in this work, we are particularly interested in neural encoders. A typical encoder for text is a recurrent neural network (RNN), such as Long Short Term Memory network [10] or Gated Recurrent Network [5] that have been widely used as encoders in various areas including machine translation [5, 1, 7] and sentiment analysis [19]. Also, encoders can be stacked to create a new encoder. 2 2.2 Knowledge Base A knowledge base provides the explicit categories that will serve as dimensions of the explicit semantic space. This can be a simple list of semantic categories rather than a knowledge base in a strict sense. ESA uses Wikipedia as a knowledge base; every document is represented as a vector where each dimension represents the strength of association with a particular Wikipedia entity. In this paper we use the set of skills entered by users in Linkedin as the knowledge base; User profiles and jobs can be described in this space. 2.3 Projector The projector projects the resulting latent representation into the explicit semantic space. We can use a simple linear projector to map the latent vector into the explicit semantic space. Let's assume x shows an object's features, the implicit representation of x is given by the encoder: eeeimpl = fenc(xxx) and the projector maps the implicit representation to the explicit space: The simplest projector is a linear projector: eeeexpl = fproj(eeeimpl) (1) (2) (3) where WWW is a m × n weight matrix, where m is the dimension of the encoder's output and n is the number of explicit categories. eeeexpl = W xW xW x 2.4 Similarity Scorer The similarity scorer estimates the similarity between objects in the explicit semantic space.1 As the burden of learning lies on the encoder and the projector, there is no need in complicated similarity scoring, but one could also think of trainable similarity functions. We suggest using a dot product or a cosine similarity. 3 SESA for Job Relevance Task We evaluate SESA on the task of predicting job relevance. Given a LinkedIn profile and a LinkedIn job description, the task is to predict if the person is interested in applying for this job. As a knowledge base, we use the LinkedIn's skills. This set consists of skills that were entered by LinkedIn users for each profile. The intuition behind using SESA for the task of job-profile relevance is that every job has requirements, most of which could be expressed in terms of skills. For example, "We are looking for talented Data Engineers with a strong programming skills and knowledge of neural networks capable of rapid application development within an Agile environment" would likely require software engineering, machine learning, deep learning and Agile methodologies and would not require budget control or online merchandising. A person possessing most or all of these skills is likely to be a good match for this position, and vice versa, a person that does not possess the skills required for a job, is not likely to be a good match. Our approach is illustrated in Figure 1. We use an RNN encoder to map the job description to its latent representation and then project it to the explicit skills space. As the members' profiles are already tagged with skills, we just take those skills from the profiles. In other words, the encoder and projector in the member's side only extract the skills from the profile. Then we estimate the similarity between the explicit representations of the job and the profile. 1The scorer can also take into account the latent representations and even external features, but this is orthogonal to the contribution of this paper. 3 Figure 1: Illustration of SESA for job relevance. The profiles are represented in the explicit semantic space where each dimension represents a skill. The job descriptions are encoded with an LSTM and then projected to the explicit semantic space. A dot product between the explicit representations is used to predict relevance. 4 Experimental Setup We use a dataset of 36 million job-profile pairs, the pairs are labeled as positive if the person has applied for a job, and as negative if the person has viewed the job but did not apply. There are only 270K positive examples in the dataset. 65% of the dataset is used for training, 5% for validation and 30% for testing. We only consider the skills that appear at least one thousand time in the training set; the final set of skills contains 35K different skills. We use logistic regression and gradient boosting baselines using common meta-information as the features. The features can be divided into three categories: (1) job-only features: location, company size, seniority and required skills; (2) profile-only features: location, current company, current industry, gender, seniority; (3) job-profile similarity features: cosine similarity and Jaccard similarity between tf-idf representation of all job information and all profile information. There are 182 different features in total. We assume that a job description can be mapped to a set of skills required for this job. To do this, we use an LSTM encoder. As we use the LSTM encoder, we can either use the last output vector of the RNN as the latent representation, or we can average all outputs. Our preliminary experiments have shown that averaging the outputs provides better results on the validation set. Therefore, we use this encoding strategy in the experiments we report. We use MSE loss function to train our model. 4.1 Hyperparameters and Training We use an LSTM encoder with 100 units. The word embeddings are pre-trained using the skip-gram model [15] on Wikipedia and LinkedIn news and job descriptions; the dimensionality is set to 200. The network is trained with stochastic gradient descent by minimizing mean squared error on the training set. We use L2 regularization with regularization rate of 10−7. The batch size is set to 1000. We use early stopping on the validation set: the model is evaluated on the validation set every 500 iterations and the training is stopped if there is no improvement on the validation set for 20 consecutive iterations. The model is implemented with tensorflow.2 Logistic regression baseline is implemented using Photon Machine Learning framework.3 It was trained for 100 iterations with regularization rate of 0.1. Gradient boosting baseline is implemented with XGBoost library,4 the hyperparameters are tuned on the validation set. We report the results with the maximal depth of 5, the learning rate of 0.1 and γ of 0.1. 2https://www.tensorflow.org/ 3https://github.com/linkedin/photon-ml 4http://xgboost.readthedocs.io/ 4 Model SESA (Random word embeddings) SESA (Pretrained word embeddings) Logistic Regression Gradient Boosting (500 trees) Gradient Boosting (1000 trees) AUC 0.82 0.86 0.78 0.85 0.86 Table 2: The AUC of the SESA with an LSTM encoder and a linear projector versus the baseline feature-based systems. 5 Results We use the area under the curve (AUC) of the receiver operating characteristic (ROC) curve as the evaluation metric. Table 2 compares the performance of the SESA model with the baseline systems. We test the models that perform the best on the validation set. We compare the performance of SESA when using randomly initialized word embeddings versus the pretrained embeddings. SESA with pretrained word embeddings achieves good results outperforming most baselines and performing at the level of gradient boosting while (1) avoiding feature engineering; (2) being interpretable and (3) providing re-usable by-products that we describe in the following section. 5.1 SESA by-products Training the SESA for job-profile relevance task provides two main by-products: (1) skills embed- dings; and (2) job2skill tagger. Skills Embeddings The matrix WWW (see Equation 3) can be viewed as the matrix of skills embed- dings. In these embeddings, the skills which behave similarly in the job-profile matching task are closer vectors. This gives us different embeddings than other unsupervised word embeddings since the embeddings are optimized for this supervised task. Further qualitative analysis of the differences is an ongoing work. Job2skill Tagger The second by-product is a job2skill tagger that tags a job description with skills. This job2skill tagger needs to be tailored further to be used as a standalone tagger. The output of job2skill is a real vector in the space of skills in which if a skill is irrelevant can have a negative score. The training set is highly unbalanced (more than 99% are negative examples) and therefore the model mostly learns negative correlation of the skills for jobs. The negative skills are useful for the relevance prediction task, but are not the main interest of the job2skill tagger. Also, some skills are not frequent enough in the positive pairs of the dataset, and the model can not learn much about them. However, this trained model can be used as an initialization and be tuned further to create a standalone job2skill tagger. This tagger has the advantage of exploiting a large scale skills and click data in comparison to a tagger trained on a handcrafted skill tagging dataset. Table 3 presents an example of the job2skill output for the job description of a software engineering intern. While the SESA by-product inferred many positive skills correctly, it also inferred several non-relevant frequent skills, i.e. treasury management and financial services. 6 Conclusions and Future Work We presented SESA, a novel model of representation learning. This model is trained in a supervised manner to embed objects into an explicit space with interpretable dimensions. We presented ongoing experiments on job-profile relevance with SESA where we represent both the job and the profile in a semantic space where each dimension corresponds to a particular skill in Linkedin. In this case, the model also has two reusable by-products: skills embeddings and skills tagger for jobs, their effectiveness should be experimented in the downstream tasks. Besides, the model made use of a large-scale collaborative skill dataset entered by LinkedIn users. 5 Job Title: Software Engineer Internship Job Description: The ideal candidate will be excited for the challenge to transform and think critically on many computer science disciplines including product design, usability, building APIs and user-centric online applications, business logic, scaling performance, and 24x7 reliability (...) Positive Skills: python, c, programming, Amazon RDS, IOS development, treasury management, financial services Negative Skills: counterintelligence, e-commerce consulting, yoga, scuba diving Table 3: Example positive and negative skills inferred by the SESA model, i.e. with highly positive and highly negative association scores in the explicit space. In the future we plan to experiment and improve SESA by-products. Also, we plan to evaluate SESA on other ranking and relevance tasks plus considering various other ranking loss functions that are studied in the literature. Finally, it is straightforward to extend the model with implicit representations in addition to the explicit ones to capture semantics beyond the explicit categories, which will make the model more robust to incomplete knowledge bases and noise. References [1] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of 5th International Conference on Learning Representations, ICLR 2015, 2015. [2] Bing Bai, Jason Weston, David Grangier, Ronan Collobert, Kunihiko Sadamasa, Yanjun Qi, Corinna Cortes, and Mehryar Mohri. Polynomial semantic indexing. In Advances in Neural Information Processing Systems 22, pages 64–72. 2009. [3] Marco Baroni, Georgiana Dinu, and Germán Kruszewski. Don't count, predict! a systematic comparison of context-counting vs. context-predicting semantic vectors. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 238–247, Baltimore, Maryland, June 2014. [4] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003. [5] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder– decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, October 2014. [6] Scott Deerwester, Susan T Dumais, George W Furnas, Thomas K Landauer, and Richard Harshman. Indexing by latent semantic analysis. Journal of the American society for information science, 41(6):391, 1990. [7] Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation with a shared attention mechanism. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, California, June 2016. [8] Evgeniy Gabrilovich and Shaul Markovitch. Computing semantic relatedness using wikipedia- based explicit semantic analysis. In IJcAI, volume 7, pages 1606–1611, 2007. [9] Zellig S Harris. Distributional structure. Word, 10(2-3):146–162, 1954. [10] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [11] Thomas Hofmann. Probabilistic latent semantic indexing. In Proceedings of the 22nd annual international ACM SIGIR conference, pages 50–57. ACM, 1999. 6 [12] Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero, and Larry Heck. Learning deep structured semantic models for web search using clickthrough data. In Proceedings of the 22nd ACM international conference on Conference on information & knowledge management, pages 2333–2338, 2013. [13] Quoc V. Le and Tomas Mikolov. Distributed representations of sentences and documents. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, pages 1188–1196, 2014. [14] Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky. Visualizing and understanding neural models in nlp. In Proceedings of NAACL-HLT, pages 681–691, 2016. [15] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint 1301.3781, 2013. [16] Gerard Salton and Michael J. McGill. Introduction to Modern Information Retrieval. New York, NY, USA, 1986. [17] Yelong Shen, Xiaodong He, Jianfeng Gao, Li Deng, and Grégoire Mesnil. A latent semantic model with convolutional-pooling structure for information retrieval. In Proceedings of the 23rd ACM International Conference on Conference on Information and Knowledge Management, pages 101–110. ACM, 2014. [18] Yelong Shen, Xiaodong He, Jianfeng Gao, Li Deng, and Gregoire Mesnil. Learning semantic representations using convolutional neural networks for web search. In Proceedings of the 23rd International Conference on World Wide Web, pages 373–374. ACM, 2014. [19] Duyu Tang, Bing Qin, and Ting Liu. Document modeling with gated recurrent neural network for sentiment classification. In EMNLP, pages 1422–1432, 2015. [20] Jason Weston, Samy Bengio, and Nicolas Usunier. Large scale image annotation: Learning to rank with joint word-image embeddings. Mach. Learn., 81:21–35, 2010. 7
1111.3122
1
1111
2011-11-14T07:41:42
ESLO: from transcription to speakers' personal information annotation
[ "cs.CL" ]
This paper presents the preliminary works to put online a French oral corpus and its transcription. This corpus is the Socio-Linguistic Survey in Orleans, realized in 1968. First, we numerized the corpus, then we handwritten transcribed it with the Transcriber software adding different tags about speakers, time, noise, etc. Each document (audio file and XML file of the transcription) was described by a set of metadata stored in an XML format to allow an easy consultation. Second, we added different levels of annotations, recognition of named entities and annotation of personal information about speakers. This two annotation tasks used the CasSys system of transducer cascades. We used and modified a first cascade to recognize named entities. Then we built a second cascade to annote the designating entities, i.e. information about the speaker. These second cascade parsed the named entity annotated corpus. The objective is to locate information about the speaker and, also, what kind of information can designate him/her. These two cascades was evaluated with precision and recall measures.
cs.CL
cs
ESLO: from transcription to speakers' personal information annotation Iris Eshkol1, Denis Maurel2, Nathalie Friburger2 1Université d'Orléans, LLL 2Université François Rabelais Tours, LI France E-mail: [email protected], {denis.maurel, nathalie.friburger}@univ-tours.fr Abstract This paper presents the preliminary works to put online a French oral corpus and its transcription. This corpus is the Socio-Linguistic Survey in Orleans, realized in 1968. First, we numerized the corpus, then we handwritten transcribed it with the Transcriber software adding different tags about speakers, time, noise, etc. Each document (audio file and XML file of the transcription) was described by a set of metadata stored in an XML format to allow an easy consultation. Second, we added different levels of annotations, recognition of named entities and annotation of personal information about speakers. This two annotation tasks used the CasSys system of transducer cascades. We used and modified a first cascade to recognize named entities. Then we built a second cascade to annote the designating entities, i.e. information about the speaker. These second cascade parsed the named entity annotated corpus. The objective is to locate information about the speaker and, also, what kind of information can designate him/her. These two cascades was evaluated with precision and recall measures. 1. Corpus presentation The most extensive examination of spoken French before 1980 is the Socio-Linguistic Survey in Orleans (Enquête à Orléans , ESLO 1). This Socio-Linguistique investigation was carried out towards the end of the Sixties by British academics with a didactic aim and represents a collection of 200 interviews with several references (sociological characterization of the interviewed persons, identification of the interviewer, date and place of the interview). The interview was recorded in a professional or private context, in a total of 300 hours of speech and the corpus contains approximately 4,500,000 words1. Note that a new survey, ESLO 2, has been undertaken by the LLL-Orléans to constitute a corpus in order comparable in terms of data gathering and archiving. ESLO 1 and ESLO 2 will form a collection of 700 hours of recording, that is more than 10 000 000 of words. In this article we want to show the different levels of corpus annotations. Starting from the transcription which, we believe, is the first level of annotation, we will then describe how to increase the transcription with some semantic annotations in XML format. 2. Preliminary work on ESLO The ESLO project contains many steps: numerization, coding of metadata, transcription synchronic with the sound, annotation, anonymization, tools of request and diffusion. The main theoretical and technical choices operated during the scientific exploitation of the corpus ESLO1 answer to a precise objective: to participate in the reflection on the evolution of models and methods of constitution and exploitation of the oral corpus for linguistic purposes [Abouda, Baude, 2007]. 1 The online put was part of ESLO1 (http://bach.arts.kuleuven.be/elicop/) within the Elicop project [Mertens, 2002]. ESLO1 was consisted of the wave band of recordings, index card of sociological characteristics, descriptions of situation (date, place, remarks on the acoustic, etc.). Audio files were digitized; an indexation and a first cataloguing were accomplished. The objective is to make available all data to the scientific community in a format which allows optimal and intensive exploitation [Baude, 2006]. 2.1 Transcription We consider transcription to be the first stage of annotation because it is an example of the important particular operation of oral corpus encoding. The phase of transcription was complicated in particular by the lack of normalized practices within the scientific community. After an expertise of the actual use of tools and conventions of transcription, the team developed proposals of transcription based on the following principles: simplifying navigation within the signal, transcribing close to norm but including the truncations, and others disfluences, avoiding typographical marks [Blanche-Benveniste, Jeanjean, 1987] and making a transcription of the complete corpus available as soon as possible without the implication of a specific linguistic theory and any analysis. It is simply a tool of corpus preparation. Therefore, the conventions of transcription were reduced to a minimum: • the transcription is orthographic, • the segmentation is made according to an intuitive unit of the type « group of breath » and/or appropriate syntactic unit; the turn-taking was defined by speaker ’s changes; the pauses were indicated automatically by their length (precision of a hundredth of a second); no punctuation except the points of exclamation and question marks; no uppercase letters except the named entities; • • • • • word truncation is indicated by the dash (mont-) The rest is encoded with the automatic tags marked by the software used for transcription, i.e. Transcriber (turns of speech, acoustic conditions, tags of events like noises, lexicon, pronunciation, language, etc.). We chose this software for its simplicity of use, its robustness when treating long files, and its exit in a format XML which seemed us to be a guarantee of interoperability. The transcription made is synchronized with sound. This is an example of transcription XML file: <Turn speaker="spk4" startTime="10.88" endTime="14.843"> <Sync time="10.88"/>vous vous plaisez à Orléans? <Sync time="12.721"/></Turn> (Do you like it at Orléans?) 2.2 Cataloguing We transformed the audio recording to audio files (wav format), the handwritten transcription became transcription files XML of Transcriber. Each document (audio file and XML file of the transcription) is described by a set of metadata stored in an XML format. The data base php/mysql with the information about the sound recording, the speakers and the questionnaire taken from the original card index was created. An interface (xquery) was accomplished within the framework of GRICO2 and CRDO3 project by the specialists in the management of the oral corpus and the linguistic researchers of LLL (Figure 1, Annex 1) The data base ESLO includes eight tables: • Recording files (type of recording: interview or other, date, place, etc.); • Speakers (date and place of birth, profession, age, sex, etc.); • Questionnaire; • Transcriptions (number of recording, names of transcribers, date of transcription); • Table which allows the relation between the recording files and questionnaire (problems of sound, of conventions, etc.) • Members of the team; • Set of problems met by the transcribers, • Remarks marked by the transcribers structure, complementary questions, etc.) The data base allows the consultations of ESLO1 by the list of recordings, transcriptions and speakers (Figure 2, Annex 1). So, it is possible to look the description of each recording (type, during, place, date, acoustics, etc.) with the link to speakers characteristics, the representation of the transcriptions (name of transcribers, type of transcription: brut, read or validated, problems and remarks of transcribers about transcription) with the (syntactic the transcription, submit a new to possibility characteristics of the speakers (date and place of birth, sex, profession, etc.) with the link to recordings. The new interface of database is in the process of creation today. It will allow the consultation more detailed of our corpus: to extract the transcription with recording according to string search, using sociological characteristics of speakers, questions answered etc. 3. Personal information annotation After this preliminary work, we wanted to add personal information annotation about the different speakers, always in XML format. But the progress of the transcription make us use only a part of the corpus, 112 Transcriber XML files (32 577 Kb), i.e. 120 hours of speech. We split it into 105 work files (31 004 Kb) and 7 evaluation files (1 573 Kb), i.e. 5.1% of the corpus. To insert annotation tags, we used hand built local grammars, in the form of transducer cascades [Abney, 1996] and we parsed the corpus with the CasSys system [Friburger, Maurel, 2004], based on Unitex software [Paumier, 2003]. Entity recognition may be need the succession of two or more transducers, in a specific order. The parsing preprocesses the file, segments it using XML Transcriber tags4 [Dister, 2007]. In fact, we used two cascades; the first one for named entity recognition and the second one for discovering speaker information. The second cascade used the first one. 3.1 First cascade: named entity recognition We adapted a precedent work realized some years ago for a newspaper corpus and we adapted it to our corpus. We used eight types5: person (pers), post (fonc), organization (org), location (loc), product (prod), date and hour (time), amount (amount) and event (event). Each type is subdivided in subtypes, for instance human (pers.hum), political post (fonc.pol), facilities (loc.fac), etc. See [Maurel and al., 2009] for the complete list. For instance, we tagged: moi je suis native de <EN type="loc.admi"> Pithiviers</EN> j'aime mieux <EN type="loc.admi">Orléans</EN> (I was born at the city of Pithiviers, I prefer the city of Orléans) Figure 3, Annex 2, presents the transducer recognizing the context of "musician", for instance Le musicien Willy DeVille, or le concert de Johnny Hallyday. The evaluation we computed for the first cascade is presented Table 1. See [Maurel and al., 2009] for more information about these results. 2 Groupe de Recherche sur l'Interopérabilité des Corpus Oraux. Michel Jacobson (Lacito-CRDO-DAV) et Richard Walter (IRHT). 3 Centre de la description de ressources pour http://crdo.vjf.cnrs.fr:8080/exist/crdo/ l ’oral 4 For written corpora, this segmentation usually uses sentence boundary detection [Friburger and al., 2000]. 5 The seven first types were defined for the ESTER campaign about French spoken language transcription. Precision Recall 94.0% 97.8% Entities 88.4% Entity types 92.0% Entity brackets 91.1% 87.5% Table 1: Evaluation of the first cascade 3.2 Second cascade: designating entity recognition The second cascade parsed the named entity tagged corpus. The objective is to locate information about the speaker and, also, what kind of information can designate him/her. We call this information designating entities [Eshkol, 2009]. The survey focused on the speaker and his/her family. The cascade inserted two different tags: one for the person who speaks or whom one speaks and the other one for the information about him/her. The concerned persons were the speaker (pers.speaker), his/her spouse (pers.spouse), his/her children (pers.child) and his/her parents (pers.parent). A lot of questions dealt with personal information, as his/her age (identity.age), his/her birth date (identity.birth) and where he/her came from (identity.origin), when he/her came at Orléans (identity.arrival) and also information about his/her children (identity.children), etc. Another group of questions dealt with his/her work or the work of his/her spouse or children (work.occupation, work.field, work.location, work.business), etc. For instance, we tagged: <DE type="pers.speaker"> moi je suis <DE type="identity.origin"> native de <EN type="loc.admi"> Pithiviers</EN> </DE> </DE> (I was born at the city of Pithiviers) This second example is more complex, with three different kinds of tag: transcription, named entity and designating entity: alors ça fait longtemps que vous habitez <Event desc="pi" type="pronounce" extent="instantaneous"/> euh <NE type="loc.admi"> Orléans </NE> hein? </Turn> <Turn speaker="spk1" startTime="16.224" endTime="18.444"> <Sync time="16.224"/> <Sync time="17.338"/> <DE type="pers.speaker"> <DE type="identity.arrival"> <NE type="time.date.rel"> neuf ans </NE> </DE> </DE> (Then you leave at Orléans for a long time?/nine years) A third example deals with the family of the speaker: <DE type="pers.speaker"> nous sommes revenus parce que <DE type="pers.parent"> mon père était <DE type="work.field"> officier </DE> </DE> </DE> (We came back because my father was officer) Figure 4, Annex 2, presents the transducer recognizing the context of speaker identity, for instance I am born at Orléans, I left at Paris…: The evaluation we computed for the second cascade is presented Table 2, but the results are open to doubt because information is very sparse. There are just 77 designating entities in the seven test files… Precision 94.2% Recall 84.4% Table 2: Evaluation of the second cascade 4. Conclusion This paper presents three years work on a survey corpus from 1968. It deals with transcriptions, cataloguing of data and others annotations concerning named and designating entities that were added to. The transcription used Transcriber software and the entities parsing used CasSys, a transducer cascade tool. The objective is to make available all data to the scientific community in a format which allows its optimal and intensive exploitation. One of the possible applications is navigation, visualization/listening and extraction of some (semantic, sociolinguistic, etc.) information using the corpus itself (transcription/sound files), its annotations and the data base with the metadata describing the corpus. So, this project shows how the computer technology is used to emphasize and to explore linguistic variations. Acknowledgements This work was supported by the French ANR project Variling and the Feder (European Regional Development Fund) project Entités. References Abney S. (1996), Partial Parsing via Finite-State Cascades, Workshop on Robust Parsing, 8th European Summer School in Logic, Language and Information, Prague, Czech Republic, 8-15. Abouda L., Baude O. (2007), Constituer et exploiter un grand corpus oral: choix et enjeux théoriques. Le cas des ESLO, Corpus en Lettres et Sciences sociales. Des documents numériques à l’interprétation, Actes du XXVIIe Colloque d ’Albi « Langages et Signification », publié par C. Duteil-Mougel et B. Foulquié, 161-168. Baude O. et al. (2006), Corpus oraux. Guide des bonnes pratiques 2006, Paris, Cnrs éditions– Orléans, PUO. Blanche-Benveniste C., Jeanjean C. (1987), Le fran çais parlé, transcription et édition, Paris, Didier érudition. Dister A. (2007). De la transcription à l'étiquetage morphosyntaxique. Le cas de la banque de données textuelles orales VALIBEL. Thèse de linguistique. Université catholique de Louvain. Eshkol I. (2007). Entrer dans l ’anonymat. Etude des "entités dénommantes" dans un corpus oral. Actes du colloque NOMINA2007. Ed. Narr, T übingen. ( à para ître). Friburger N., Dister A., Maurel D. (2000), Améliorer le découpage des phrases sous Intex, Revue Informatique Sciences Humaines, et Statistique dans les 36(1-4):181-200. Friburger N., Maurel D. (2004), Finite-state transducer cascades to extract named entities in texts, Theoretical Computer Science, vol. 313, 94-104. Maurel D., Friburger F., Eshkol I. (2009), Who are you, you who speak? Transducer cascades for information retrieval, 4th Language & Technology Conference, Poznań, Poland. Mertens P. (2002) Les corpus de français parlé ELIC OP: consultation et exploitation. In: Tableaux vivants: opstellen over taal-en-onderwijs, aangeboden aan Mark Debrock / Onder red. van Jean Binon e.a. - Leuven: Universitaire pers, 101-116. Paumier S. (2003), De la Reconnaissance de Formes l'Analyse Syntaxique , Thèse de Linguistiques à Doctorat en Informatique, Université de Marne-la-Vallée. Annex 1 Cataloguing Figure 1: Characteristics of speaker Figure 2: Homepage of ESLO1 consultation Annex 2 Personal information annotation Figure 3: Context of "musician" Figure 4: Context of speaker identity
1902.10068
2
1902
2019-03-28T15:07:54
Entity Recognition at First Sight: Improving NER with Eye Movement Information
[ "cs.CL" ]
Previous research shows that eye-tracking data contains information about the lexical and syntactic properties of text, which can be used to improve natural language processing models. In this work, we leverage eye movement features from three corpora with recorded gaze information to augment a state-of-the-art neural model for named entity recognition (NER) with gaze embeddings. These corpora were manually annotated with named entity labels. Moreover, we show how gaze features, generalized on word type level, eliminate the need for recorded eye-tracking data at test time. The gaze-augmented models for NER using token-level and type-level features outperform the baselines. We present the benefits of eye-tracking features by evaluating the NER models on both individual datasets as well as in cross-domain settings.
cs.CL
cs
Entity Recognition at First Sight: Improving NER with Eye Movement Information Nora Hollenstein ETH Zurich [email protected] Ce Zhang ETH Zurich [email protected] 9 1 0 2 r a M 8 2 ] L C . s c [ 2 v 8 6 0 0 1 . 2 0 9 1 : v i X r a Abstract Previous research shows that eye-tracking data contains information about the lexical and syn- tactic properties of text, which can be used to improve natural language processing models. In this work, we leverage eye movement fea- tures from three corpora with recorded gaze information to augment a state-of-the-art neu- ral model for named entity recognition (NER) with gaze embeddings. These corpora were manually annotated with named entity labels. Moreover, we show how gaze features, gen- eralized on word type level, eliminate the need for recorded eye-tracking data at test time. The gaze-augmented models for NER using token- level and type-level features outperform the baselines. We present the benefits of eye- tracking features by evaluating the NER mod- els on both individual datasets as well as in cross-domain settings. Introduction 1 The field of natural language processing includes studies of tasks of different granularity and depths of semantics: from lower level tasks such as tokenization and part-of-speech tagging up to higher level tasks of information extraction such as named entity recognition, relation extraction, and semantic role labeling (Collobert et al., 2011). As NLP systems become increasingly prevalent in society, how to take advantage of information passively collected from human readers, e.g. eye movement signals, is becoming more interesting to researchers. Previous research in this area has shown promising results: Eye-tracking data has been used to improve tasks such as part-of-speech tagging (Barrett et al., 2016), sentiment analysis (Mishra et al., 2017), prediction of multiword ex- pressions (Rohanian et al., 2017), and word em- bedding evaluation (Søgaard, 2016). global properties in the text (e.g. sentiment analy- sis). In this paper, we test a hypothesis on a differ- ent level: Can eye movement signals also help im- prove higher-level semantic tasks such as extract- ing information from text? The answer to this question is not obvious. On one hand, the quality improvement attributed to eye movement signals on lower-level tasks implies that such signals do contain linguistic information. On the other hand, it is not clear whether these sig- nals can also provide significant improvement for tasks dealing with higher-level semantics. More- over, even if eye movement patterns contain sig- nals related to higher-level tasks, as implied by a recent psycholinguistic study (Tokunaga et al., 2017), noisy as these signals are, it is not straight- forward whether they would help, if not hurt, the quality of the models. In this paper, we provide the first study of the impact of gaze features to automatic named entity recognition from text. We test the hypothesis that eye-tracking data is beneficial for entity recogni- tion in a state-of-the-art neural named entity tag- ger augmented with embedding layers of gaze fea- tures. Our contributions in the current work can be summarized as follows: 1. First, we manually annotate three eye- tracking corpora with named entity labels to train a neural NER system with gaze features. This collection of corpora facilitates future research in related topics. The annotations are publicly available. 2. Beyond that, we present a neural architecture for NER, which in addition to textual infor- mation, incorporates embedding layers to en- code eye movement information. However, most of these studies focus on either relatively lower-level tasks (e.g. part-of-speech tagging and multiword expressions) or relatively 3. Finally, we show how gaze features gener- alized to word types eliminate the need for recorded eye-tracking data at test time. This makes the use of eye-tracking data in NLP applications more feasible since recorded eye-tracking data for each token in context is not required anymore at prediction time. Moreover, type-aggregated features appear to be particularly useful for cross-domain sys- tems. Our hypotheses are evaluated not only on the available eye-tracking corpora, but also on an ex- ternal benchmark dataset, for which gaze informa- tion does not exist. 2 Related Work The benefits of eye movement data for machine learning have been assessed in various domains, including NLP and computer vision. Eye-trackers provide millisecond-accurate records on where humans look when they are reading, and they are becoming cheaper and more easily available by the day (San Agustin et al., 2009; Sewell and Ko- mogortsev, 2010). Although eye-tracking data is still being recorded in controlled experiment en- vironments, this will likely change in the near fu- ture. Recent approaches have shown substantial improvements in recording gaze data while read- ing by using cameras of mobile devices (G´omez- Poveda and Gaudioso, 2016; Papoutsaki et al., 2016). Hence, eye-tracking data will probably be more accessible and available in much larger vol- umes in due time, which will facilitate the creation of sizable datasets enormously. Tokunaga et al. (2017) recently analyzed eye- tracking signals during the annotation of named entities to find effective features for NER. Their work proves that humans take into account a broad context to identify named entities, includ- ing predicate-argument structure. This further strengthens our intuition to use eye movement in- formation to improve existing NER systems. And going even a step further, it opens the possibil- ity for real-time entity annotation based on the reader's eye movements. The benefit of eye movement data is backed up by extensive psycholinguistic studies. For exam- ple, when humans read a text they do not focus on every single word. The number of fixations and the fixation duration on a word depends on a num- ber of linguistic factors (Clifton et al., 2007; Dem- berg and Keller, 2008). First, readers are more likely to fixate on open-class words that are not predictable from context (Rayner, 1998). Read- ing patterns are a reliable indicator of syntacti- cal categories (Barrett and Søgaard, 2015a). Sec- ond, word frequency and word familiarity influ- ence how long readers look at a word. The fre- quency effect was first noted by Rayner (1977) and has been reported in various studies since, e.g. Just and Carpenter (1980) and Cop et al. (2017). Moreover, although two words may have the same frequency value, they may differ in familiarity (es- pecially for infrequent words). Effects of word fa- miliarity on fixation time have also been demon- strated in a number of recent studies (Juhasz and Rayner, 2003; Williams and Morris, 2004). Addi- tionally, the positive effect of fixation information in various NLP tasks has recently been shown by Barrett et al. (2018), where an attention mecha- nism is trained on fixation duration. State-of-the-art NER Non-linear neural net- works with distributed word representations as in- put have become increasingly successful for any sequence labeling task in NLP (Huang et al., 2015; Chiu and Nichols, 2016; Ma and Hovy, 2016). The same applies to named entity recog- nition: State-of-the-art systems are combinations of neural networks such as LSTMs or CNNs and conditional random fields (CRFs) (Strauss et al., 2016). Lample et al. (2016) developed such a neural architecture for NER, which we employ in this work and enhance with eye movement fea- tures. Their model successfully combines word- level and character-level embeddings, which we augment with embedding layers for eye-tracking features. 3 Eye-tracking corpora For our experiments, we resort to three eye- the Dundee corpus tracking data resources: (Kennedy et al., 2003), the GECO corpus (Cop et al., 2017) and the ZuCo corpus (Hollenstein et al., 2018). For the purpose of information ex- traction, it is important that the readers process longer fragments of text, i.e. complete sentences instead of single words, which is the case in all three datasets. Table 1 shows an overview of the domain and size of these datasets. In total, they comprise 142,441 tokens with gaze information. Table 1 also shows the differences in mean fixation times between the datasets (i.e. fixation duration (the av- erage duration of a single fixation on a word in Dundee GECO ZuCo domain(s) news articles literature number of sentences mean sentence length number of words unique word types mean word length fixation duration (ms) gaze duration (ms) 2367 24.75 58598 9131 4.29 202 237 5424 12.65 68606 5283 3.76 214 232 movie reviews, Wikipedia articles 700 22.12 15237 4408 4.44 226 265 Total - 8491 19.84 142441 13937 4.16 214 244.7 Table 1: Descriptive statistics of the eye-tracking corpora, including domain, size and mean fixation and gaze duration per token. Dundee GECO ZuCo Total all PERSON 732 ORGANIZATION 475 LOCATION 431 1638 total unique 415 261 177 853 52% all 1870 26 101 1997 unique 108 12 23 143 7% all 657 156 366 1179 unique 446 95 155 696 59% all 3259 657 898 4814 unique 955 364 1646 1646 34% Table 2: Number and distribution of named entity annotations in all three eye-tracking corpora. milliseconds) and gaze duration (the average du- ration of all fixations on a word)). Dundee Corpus The gaze data of the Dundee corpus (Kennedy et al., 2003) was recorded with a Dr. Bouis Oculometer Eyetracker. The English section of this corpus comprises 58,598 tokens in 2,367 sentences. It contains eye movement infor- mation of ten native English speakers as they read the same 20 newspaper articles from The Indepen- dent. The text was presented to the readers on a screen five lines at a time. This data has been widely used in psycholinguistic research to ana- lyze the reading behavior of subjects while read- ing sentences in context under relatively naturalis- tic conditions. GECO Corpus The Ghent Eye-Tracking Cor- pus (Cop et al., 2017) is a more recent dataset, which was created for the analysis of eye move- ments of monolingual and bilingual subjects dur- ing reading. The data was recorded with an Eye- Link 1000 system. The text was presented one paragraph at a time. The subjects read the entire novel The Mysterious Affair at Styles by Agatha Christie (1920) containing 68,606 tokens in 5,424 sentences. We use only the monolingual data recorded from the 14 native English speakers for this work to maintain consistency across corpora. ZuCo Corpus The Zurich Cognitive Language Processing Corpus (Hollenstein et al., 2018) is a combined eye-tracking and EEG dataset. The gaze data was also recorded with an EyeLink 1000 system. The full corpus contains 1,100 English sentences read by 12 adult native speakers. The sentences were presented at the same position on the screen one at a time. For the present work, we only use the eye movement data of the first two reading tasks of this corpus (700 sentences, 15,237 tokens), since these tasks encouraged natural reading. The reading material included sentences from movie reviews from the Stanford Sentiment Treebank (Socher et al., 2013) and the Wikipedia dataset by Culotta et al. (2006). For the purposes of this work, all datasets were manually annotated with named entity labels for PERSON, OR- GANIZATION and LOCATION. The annota- tions are available at https://github.com/ DS3Lab/ner-at-first-sight. three categories: The datasets were annotated by two NLP ex- perts. The IOB tagging scheme was used for the labeling. We followed the ACE Annotation Guidelines (Linguistic Data Consortium, 2005). All conflicts in labelling were resolved by ad- judication between both annotators. An inter- Basic n fixations fixation probability mean fixation duration Early first fixation duration first pass duration Late total fixation duration n re-fixations re-read probability Context total regression-from duration w-2 fixation probability w-1 fixation probability w+1 fixation probability w+2 fixation probability w-2 fixation duration w-1 fixation duration w+1 fixation duration w+2 fixation duration total number of fixations on a word w the probability that a word w will be fixated mean of all fixation durations for a word w duration of the first fixation on a word w sum of all fixation durations during the first pass sum of all fixation durations for a word w number of times a word w is fixated (after the first fixation) the probability that a word w will be read more than once combined duration of the regressions that began at word w fixation probability of the word before the previous word fixation probability of the previous word fixation probability of the next word fixation probability of the word after the next word fixation duration of the word before the previous word fixation duration of the previous word fixation duration of the next word fixation duration of the word after the next word Table 3: Gaze features extracted from the Dundee, GECO and ZuCo corpora. annotator reliability analysis on 10,000 tokens (511 sentences) sampled from all three datasets yielded an agreement of 83.5% on the entity labels (κ = 0.68). Table 2 shows the number of annotated entities in each dataset. The distribution of entities be- tween the corpora is highly unbalanced: Dundee and ZuCo, the datasets containing more hetero- geneous texts and thus, have a higher ratio of unique entity occurrences, versus GECO, a homo- geneous corpus consisting of a single novel, where the named entities are very repetitive. 4 Eye-tracking features The gaze data of all three corpora was recorded for multiple readers by conducting experiments in a controlled environment using specialized equip- ment. It is important to consider that, while we extract the same features for all corpora, there are certainly practical aspects that differ across the datasets. The following factors are expected to in- fluence reading: experiment procedures; text pre- sentation; recording hardware, software and qual- ity; sampling rates; initial calibration and filtering, as well as human factors such as head movements and lack of attention. Therefore, separate normal- ization for each dataset should better preserve the signal within each corpus and for the same reason the type-aggregation was computed on the normal- ized feature values. This is especially relevant for the type-aggregated features and the cross-corpus experiments described below. In order to add gaze information to the neu- ral network, we have selected as many features as available from those present in all three cor- pora. Previous research shows benefits in com- bining multiple eye-tracking features of different stages of the human reading process (Barrett et al., 2016; Tokunaga et al., 2017). The features extracted follow closely on Bar- rett et al. (2016). As described above, psycho- linguistic research has shown how fixation dura- tion and probability differ between word classes and syntactic comprehension processes. Thus, the features focus on representing these nuances as broadly as possible, covering the complete reading time of a word at different stages. Table 3 shows the eye movement features incorporated into the experiments. We split the 17 features into 4 dis- tinct groups (analogous to Barrett et al. (2016)), which define the different stages of the reading process: 1. BASIC eye-tracking features capture charac- teristics on word-level, e.g. the number of all fixations on a word or the probability that a word will be fixated (namely, the number of subjects who fixated the word divided by the total number of subjects). 2. EARLY gaze measures capture lexical access and early syntactic processing and are based on the first time a word is fixated. 3. LATE measures reflect the late syntactic pro- cessing and general disambiguation. These features are significant for words which were fixated more than once. 4. CONTEXT features capture the gaze mea- These sures of the surrounding tokens. the fixation probability features consider and duration up to two tokens to the left and right of the current token. Additionally, regressions starting at the current word are also considered to be meaningful for the syntactic processing of full sentences. The eye movement measurements were aver- aged over all native-speaking readers of each dataset to obtain more robust estimates. The small size of eye-tracking datasets often limits the po- tential for training data-intensive algorithms and causes overfitting in benchmark evaluation (Xu et al., 2015). It also leads to sparse samples of gaze measurements. Hence, given the limited num- ber of observations available, we normalize the data by splitting the feature values into quantiles to avoid sparsity issues. The best results were achieved with 24 bins. This normalization is con- ducted separately for each corpus. Moreover, special care had to be taken regard- ing tokenization, since the recorded eye-tracking data considers only whitespace separation. For ex- ample, the string John's would constitute a sin- gle token for eye-tracking feature extraction, but would be split into John and 's for NER, with the former token holding the label PERSON and the latter no label at all. Our strategy to address this issue was to assign the same values of the gaze features of the originating token to split tokens. 4.1 Type aggregation Barrett and Søgaard (2015b) showed that type- level aggregation of gaze features results in larger improvements for part-of-speech tagging. Follow- ing their line of work, we also conducted exper- iments with type aggregation for NER. This im- plies that the eye-tracking feature values were av- eraged for each word type over all occurrences in the training data. For instance, the sum of the fea- tures of all n occurrences of the token "island" are averaged over the number of occurrences n. As a result, for each corpus as well as for the ag- gregated corpora, a lexicon of lower-cased word types with their averaged eye-tracking feature val- ues was compiled. Thus, as input for the network, either the type-level aggregates for each individ- ual corpus can be used or the values from the com- bined lexicon, which increases the number of word types with known gaze feature values. The goal of type aggregation is twofold. First, it eliminates the requirement of eye-tracking fea- tures when applying the models at test time, since the larger the lexicon, the more tokens in the unseen data receive type-aggregated eye-tracking feature values. For those tokens not in the lexi- con, we assign a placeholder for unknown feature values. Second, type-aggregated features can be used on any dataset and show that improvements can be achieved with aggregated gaze data without requiring large quantities of recorded data. 5 Model The experiments in this work were executed us- ing an enhanced version of the system presented by Lample et al. (2016). This hybrid approach is based on bidirectional LSTMs and conditional random fields and relies mainly on two sources of information: character-level and word-level repre- sentations. For the experiments, the originally proposed values for all parameters were maintained. Specif- ically, the bidirectional LSTMs for character- based embeddings are trained on the corpus at hand with dimensions set to 25. The lookup ta- ble tor the word embeddings was initialized with the pre-trained GloVe vectors of 100 dimensions (Pennington et al., 2014). The model uses a sin- gle layer for the forward and backward LSTMs. All models were trained with a dropout rate at 0.5. Moreover, all digits were replaced with zeros. The original model1 was modified to include the gaze features as additional embedding layers to the network. The character-level representation, i.e. the output of a bidirectional LSTM, is con- catenated with the word-level representation from 1https://github.com/glample/tagger Figure 1: Main architecture of the network. Character and word embeddings concatenated with gaze features are given to a bidirectional LSTM. li represents the word i and its left context, ri represents the word i and its right context. Concatenating these two vectors yields a representation of the word i in its context, ci. a word lookup table. In the augmented model with eye-tracking information, the embedding for each discrete gaze feature is also concatenated to the input. The dimension of the gaze feature embed- dings is equal to the number of quantiles. This ar- chitecture is shown in Figure 1. Word length and word frequency are known to correlate and interact with gaze features (Tomanek et al., 2010), which is why we selected a base model that allows us to combine the eye-tracking features with word- and character-level information. 6 Results Our main finding is that our models enhanced with gaze features consistently outperform the base- line. As our baseline, we trained and evaluated the original models with the neural architecture and parameters proposed by Lample et al. (2016) on the GECO, Dundee, and ZuCo corpora and com- pared it to the models that were enriched with eye- tracking measures. The best improvements on F1- score over the baseline models are significant un- der one-sided t-tests (p<0.05). All models were trained with 10-fold cross val- idation (80% training set, 10% development set, 10% test set) and early stopping was performed after 20 epochs of no improvement on the devel- opment set to reduce training time. First, the performance on the individual datasets is tested, together with the performance of one combined dataset consisting of all three corpora (consisting of 142,441 tokens). In addition, we evaluate the effects of the type-aggregated features using individual type lexicons for each datasets, and combining the three type lexicons of each cor- pus. Finally, we experiment with cross-corpus sce- narios to evaluate the potential of eye-tracking fea- tures in NER for domain adaptation. Both settings were also tested on an external corpus without eye-tracking features, namely the CoNLL-2003 dataset (Sang and De Meulder, 2003). Individual dataset evaluation 6.1 First, we analyzed how augmenting the named en- tity recognition system with eye-tracking features affects the results on the individual datasets. Ta- ble 4 shows the improvements achieved by adding all 17 gaze features to the neural architecture, and training models on all three corpora, and on the combined dataset containing all sentences from the Dundee, GECO and ZuCo corpora. Notice- ably, adding token-level gaze features improves the results on all datasets individually and com- bined, even on the GECO corpus, which yields a high baseline due to the homogeneity of the con- tained named entities (see Table 2). Furthermore, Table 4 also presents the results of the NER models making use of the type- aggregated features instead of token-level gaze features. There are two different experiments for these type-level features: Using the features of the word types occurring in the corpus only, or us- ing the aggregated features of all word types in the three corpora (as describe above). As can be seen, the performance of the different gaze fea- l1MannersCanadaDavidwasborninr1c1l2r2c2l3r3c3l4r4c4l5r5c5l6r6c6B-LOCOOOI-PERB-PERCRF layerbiLSTMencodercharacter + word+ gaze embeddingswordcharactergaze f1gaze f2…gaze f17 Dundee baseline with gaze type individual type combined Geco baseline with gaze type individual type combined ZuCo baseline with gaze type individual type combined All baseline with gaze type combined P R F 79.29 79.55 81.05 80.27 96.68 98.08 97.72 97.76 84.52 86.19 84.21 83.26 86.92 88.72 89.04 78.56 79.27 79.37 79.26 97.24 97.94 97.42 97.16 81.66 84.28 82.61 83.37 86.58 89.39 89.52 78.86 79.35 80.17* 79.67 96.95 98.01* 97.57* 97.46* 82.92 85.12* 83.30 83.31 86.72 89.03* 89.26* Table 4: Precision (P), recall (R) and F1-score (F) for all models trained on individual datasets (best results in bold; * indicates statistically significant improve- ments on F1-score). With gaze are models trained on the original eye-tracking features on token-level, type individual are the models trained on type-aggregated gaze features of this corpus only, while type combined are the models trained with type-aggregated features computed on all datasets. ture levels varies between datasets, but both the original token-level features as well as the indi- vidual and combined type-level features achieve improvements over the baselines of all datasets. To sum up, the largest improvement with eye- tracking features is achieved when combining all corpora into one larger dataset, where an addi- tional 4% is gained in F1-score by using type- aggregated features. Evidently, a larger mixed- domain dataset benefits from the type aggrega- tion, while the original token-level gaze features achieve the best results on the individual datasets. Moreover, the additional gain when training on all datasets is due to the higher signal-to-noise ratio of type-aggregated features from multiple datasets. Evaluation on CoNLL-2003 Going on step fur- ther, we evaluate the type-aggregated gaze fea- tures on an external corpus with no eye move- ment information available. The CoNLL-2003 corpus (Sang and De Meulder, 2003) has been CoNLL-2003 baseline type combined P 93.89 94.38 R 94.16 94.32 F 94.03 94.35* Table 5: Precision (P), recall (R) and F1-score (F) for using type-aggregated gaze features on the CoNLL- 2003 dataset (* marks statistically significant improve- ment). widely used as a benchmark dataset for NER in different shared tasks. The English part of this corpus consists of Reuters news stories and con- tains 302,811 tokens in 22,137 sentences. We use this dataset as an additional corpus without gaze information. Only the type-aggregated features (based on the combined eye-tracking corpora) are added to each word. Merely 76% of the tokens in the CoNLL-2003 corpus also appear in the eye- tracking corpora described above and thus receive type-aggregated feature values. The rest of the to- kens without aggregated gaze information avail- able receive a placeholder for the unknown feature values. Note that to avoid overfitting we do not train on the official train/test split of the CoNLL-2003 dataset, but perform 10-fold cross validation. Ap- plying the same experiment setting, we train the augmented NER model with gaze features on the CoNLL-2003 data and compare it to a baseline model without any eye-tracking features. We achieve a minor, but nonetheless significant im- provement (shown in Table 5), which strongly supports the generalizability effect of the type- aggregated features on unseen data. 6.2 Cross-dataset evaluation In a second evaluation scenario, we test the poten- tial of eye-tracking features for NER across cor- pora. The goal is to leverage eye-tracking features for domain adaptation. To show the robustness of our approach across domains, we train the models with token-level and type-level features on 100% of corpus A and a development set of 20% of cor- pus B and test on the remaining 80% of the corpus B, alternating only the development and the test set for each fold. Table 6 shows the results of this cross-corpus evaluation. The impact of the eye-tracking fea- tures varies between the different combinations of datasets. However, the inclusion of eye-tracking features improves the results for all combinations, except for the models trained on the ZuCo corpus Dundee baseline token type baseline GECO token type baseline token type ZuCo Dundee R P F 58.91 59.61 58.39 65.85 72.62 69.21 34.91 35.62 35.99 54.01 50.76 53.05 43.80 44.53 44.44 59.34 59.70 59.95 GECO R 70.71 71.54 77.09 P 74.20 75.68 76.44 F 72.40 73.55* 76.75* 83.00 82.92 83.68 78.11 75.35 74.57 80.48 78.91 78.85 ZuCo R 75.62 74.51 76.49 42.49 44.22 42.36 F 75.44 77.02 77.35 52.38 53.81 52.01 P 75.36 78.85 78.33 68.88 69.18 67.69 Table 6: Cross-corpus results: Precision (P), recall (R) and F1-score (F) for all models trained on one dataset and tested on another (rows = training dataset; columns = test dataset; best results in bold; * indicates statistically significant improvements). The baseline models are trained without eye-tracking features, token models on the original eye-tracking features, and type are the models trained with type-aggregated features computed on all datasets. and tested on the GECO corpus. Presumably, this is due to the combination of the small training data size of the ZuCo corpus and the homogeneity of the named entities in the GECO corpus. CoNLL-2003 baseline type combined P 72.80 74.56 R 56.97 60.20 F 63.92 66.61* Table 7: Precision (P), recall (R) and F1-score (F) for using type-aggregated gaze features trained on all three eye-tracking datasets and tested on the CoNLL-2003 dataset (* marks statistically significant improvement). Evaluation on CoNLL-2003 Analogous to the individual dataset evaluation, we also test the po- tential of eye-tracking features in a cross-dataset scenario on an external benchmark dataset. Again, we use the CoNLL-2003 corpus for this purpose. We train a model on the Dundee, GECO and ZuCo corpora using type-aggregated eye-tracking fea- tures and test this model on the ConLL-2003 data. Table 7 shows that compared to a baseline without gaze features, the results improve by 3% F1-score. These results underpin our hypothesis of the pos- sibility of generalizing eye-tracking features on word type level, such that no recorded gaze data is required at test time. 7 Discussion The models evaluated in the previous section show that eye-tracking data contain valuable semantic information that can be leveraged effectively by NER systems. While the individual datasets are Figure 2: Results per class for the models trained on all gaze datasets combined. still limited in size, the largest improvement is ob- served in the models making use of all the avail- able data. At a closer look, the model leveraging gaze data yield a considerably higher increase in recall when comparing to the baselines. In addition, a class- wise analysis shows that the entity type benefiting the most from the gaze features over all models is ORGANIZATION, which is the most difficult class to predict. Figure 2 illustrates this with the results per class of the models trained on all three gaze corpora jointly. In the individual dataset evaluation setting, the combined type-level feature aggregation from all datasets does not yield the best results, since each sentence in these corpora already has accurate eye- tracking features on toke-level. Thus, it is under- standable that in this scenario the original gaze features and the gaze features aggregated only on the individual datasets result in better mod- els. However, when evaluating the NER models in a cross-corpus scenario, the type-aggregated fea- tures lead to significant improvements. Type aggregation evidently reduces the fine- grained nuances contained in eye-tracking infor- mation and eliminates the possibility of disam- biguation between homographic tokens. Never- theless, this type of disambiguation is not crucial for named entities, which mainly consist of proper nouns and the same entities tend to appear in the same context. Especially noteworthy is the gain in the models tested on the CoNLL-2003 bench- mark corpus, which shows that aggregated eye- tracking features from other datasets can be ap- plied to any unseen sentence and show improve- ments, even though more than 20% of the tokens have unknown gaze feature values. While the high number of unknown values is certainly a limitation of our approach, it shows at once the possibility of not requiring original gaze features at prediction time. Thus, the trained NER models can be ap- plied robustly on unseen data. 8 Conclusion We presented the first study of augmenting a NER system with eye-tracking information. Our results highlight the benefits of leveraging cognitive cues such as eye movements to improve entity recogni- tion models. The manually annotated named en- tity labels for the three eye-tracking corpora are freely available. We augmented a neural NER ar- chitecture with gaze features. Experiments were performed using a wide range of features relevant to the human reading process and the results show significant improvements over the baseline for all corpora individually. In addition, the type-aggregated gaze features are effective in cross-domain settings, even on an external benchmark corpus. The results of these type-aggregated features are a step towards lever- aging eye-tracking data for information extrac- tion at training time, without requiring real-time recorded eye-tracking data at prediction time. References Maria Barrett, Joachim Bingel, Nora Hollenstein, Marek Rei, and Anders Søgaard. 2018. Sequence classification with human attention. In Proceedings of the 22nd Conference on Computational Natural Language Learning, pages 302 -- 312. Maria Barrett, Joachim Bingel, Frank Keller, and An- ders Søgaard. 2016. Weakly supervised part-of- In Pro- speech tagging using eye-tracking data. ceedings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics, volume 2, pages 579 -- 584. Maria Barrett and Anders Søgaard. 2015a. Reading be- havior predicts syntactic categories. In Proceedings of the 19th Conference on Computational Natural Language Learning, pages 345 -- 349. Maria Barrett and Anders Søgaard. 2015b. Using read- ing behavior to predict grammatical functions. In Proceedings of the Sixth Workshop on Cognitive As- pects of Computational Language Learning, pages 1 -- 5. Jason PC Chiu and Eric Nichols. 2016. Named entity recognition with bidirectional LSTM-CNNs. Trans- actions of the Association for Computational Lin- guistics, 4:357 -- 370. Agatha Christie. 1920. at Styles. www.gutenberg.org. The Mysterious Affair Retrieved from Project Gutenberg, Charles Clifton, Adrian Staub, and Keith Rayner. 2007. Eye movements in reading words and sentences. In Eye Movements, pages 341 -- 371. Elsevier. Ronan Collobert, Jason Weston, L´eon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. 2011. Natural language processing (almost) from Journal of Machine Learning Research, scratch. 12(Aug):2493 -- 2537. Uschi Cop, Nicolas Dirix, Denis Drieghe, and Wouter Duyck. 2017. Presenting GECO: An eyetracking corpus of monolingual and bilingual sentence read- ing. Behavior research methods, 49(2):602 -- 615. Aron Culotta, Andrew McCallum, and Jonathan Betz. 2006. Integrating probabilistic extraction models and data mining to discover relations and patterns in text. In Proceedings of the Human Language Tech- nology Conference of the North American Chap- ter of the Association of Computational Linguistics, pages 296 -- 303. Vera Demberg and Frank Keller. 2008. Data from eye- tracking corpora as evidence for theories of syntactic processing complexity. Cognition, 109(2):193 -- 210. Jose G´omez-Poveda and Elena Gaudioso. 2016. Evalu- ation of temporal stability of eye tracking algorithms using webcams. Expert Systems with Applications, 64:69 -- 83. Nora Hollenstein, Jonathan Rotsztejn, Marius Troen- dle, Andreas Pedroni, Ce Zhang, and Nicolas Langer. 2018. ZuCo, a simultaneous EEG and eye- tracking resource for natural sentence reading. Sci- entific Data. Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidi- rectional LSTM-CRF models for sequence tagging. arXiv preprint arXiv:1508.01991. In Proceedings of the In- multiword expressions. ternational Conference Recent Advances in Natural Language Processing, pages 601 -- 609. Barbara J Juhasz and Keith Rayner. 2003. Investigating the effects of a set of intercorrelated variables on eye fixation durations in reading. Journal of Experimen- tal Psychology: Learning, Memory, and Cognition, 29(6):1312. Javier San Agustin, Henrik Skovsgaard, John Paulin Hansen, and Dan Witzner Hansen. 2009. Low-cost gaze interaction: ready to deliver the promises. In CHI'09 Extended Abstracts on Human Factors in Computing Systems, pages 4453 -- 4458. Marcel A Just and Patricia A Carpenter. 1980. A theory of reading: From eye fixations to comprehension. Psychological review, 87(4):329. Alan Kennedy, Robin Hill, and Joel Pynte. 2003. The In Proceedings of the 12th Euro- Dundee corpus. pean Conference on Eye Movement. Guillaume Lample, Miguel Ballesteros, Sandeep Sub- ramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. Proceedings of the 2016 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, pages 260 -- 270. Linguistic Data Consortium. 2005. ACE (Automatic Content Extraction) English annotation guidelines for entities. Version, 5(6):2005 -- 08. Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-CNNs- CRF. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, 1:1064 -- 1074. Abhijit Mishra, Diptesh Kanojia, Seema Nagar, Kuntal Dey, and Pushpak Bhattacharyya. 2017. Leveraging cognitive features for sentiment analysis. Proceed- ings of The 20th Conference on Computational Nat- ural Language Learning, pages 156 -- 166. Alexandra Papoutsaki, Patsorn Sangkloy, James Laskey, Nediyana Daskalova, Jeff Huang, and James Hays. 2016. WebGazer: Scalable webcam eye tracking using user interactions. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence-IJCAI 2016. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. Glove: Global vectors for In Proceedings of the 2014 word representation. Conference on Empirical Methods in Natural Lan- guage Processing, pages 1532 -- 1543. Keith Rayner. 1977. Visual attention in reading: Eye movements reflect cognitive processes. Memory & Cognition, 5(4):443 -- 448. Keith Rayner. 1998. Eye movements in reading and information processing: 20 years of research. Psy- chological bulletin, 124(3):372. Omid Rohanian, Shiva Taslimipoor, Victoria Yaneva, and Le An Ha. 2017. Using gaze data to predict Erik F Sang and Fien De Meulder. 2003. Introduc- tion to the CoNLL-2003 shared task: Language- independent named entity recognition. In Proceed- ings of the 7th Conference on Natural Language Learning, volume 4, pages 142 -- 147. Weston Sewell and Oleg Komogortsev. 2010. Real- time eye gaze tracking with an unmodified commod- ity webcam employing a neural network. In CHI'10 Extended Abstracts on Human Factors in Comput- ing Systems, pages 3739 -- 3744. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment tree- In Proceedings of the 2013 Conference on bank. Empirical Methods in Natural Language Process- ing, pages 1631 -- 1642. Anders Søgaard. 2016. Evaluating word embeddings with fMRI and eye-tracking. In Proceedings of the 1st Workshop on Evaluating Vector-Space Represen- tations for NLP, pages 116 -- 121. Benjamin Strauss, Bethany Toma, Alan Ritter, Marie- Catherine de Marneffe, and Wei Xu. 2016. Results of the wnut16 named entity recognition shared task. In Proceedings of the 2nd Workshop on Noisy User- generated Text (WNUT), pages 138 -- 144. Takenobu Tokunaga, Hitoshi Nishikawa, and Tomoya Iwakura. 2017. An eye-tracking study of named entity annotation. Proceedings of the International Conference Recent Advances in Natural Language Processing, pages 758 -- 764. Katrin Tomanek, Udo Hahn, Steffen Lohmann, and Jurgen Ziegler. 2010. A cognitive cost model of an- In Proceed- notations based on eye-tracking data. ings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 1158 -- 1167. Rihana Williams and Robin Morris. 2004. Eye move- ments, word familiarity, and vocabulary acquisition. European Journal of Cognitive Psychology, 16(1- 2):312 -- 339. Pingmei Xu, Krista A Ehinger, Yinda Zhang, Adam Finkelstein, Sanjeev R Kulkarni, and Jianxiong Xiao. 2015. Turkergaze: Crowdsourcing saliency with webcam based eye tracking. arXiv preprint arXiv:1504.06755.
1908.05691
1
1908
2019-08-15T18:04:39
Improving Multi-Word Entity Recognition for Biomedical Texts
[ "cs.CL" ]
Biomedical Named Entity Recognition (BioNER) is a crucial step for analyzing Biomedical texts, which aims at extracting biomedical named entities from a given text. Different supervised machine learning algorithms have been applied for BioNER by various researchers. The main requirement of these approaches is an annotated dataset used for learning the parameters of machine learning algorithms. Segment Representation (SR) models comprise of different tag sets used for representing the annotated data, such as IOB2, IOE2 and IOBES. In this paper, we propose an extension of IOBES model to improve the performance of BioNER. The proposed SR model, FROBES, improves the representation of multi-word entities. We used Bidirectional Long Short-Term Memory (BiLSTM) network; an instance of Recurrent Neural Networks (RNN), to design a baseline system for BioNER and evaluated the new SR model on two datasets, i2b2/VA 2010 challenge dataset and JNLPBA 2004 shared task dataset. The proposed SR model outperforms other models for multi-word entities with length greater than two. Further, the outputs of different SR models have been combined using majority voting ensemble method which outperforms the baseline models performance.
cs.CL
cs
Improving Multi-Word Entity Recognition for Biomedical Texts Hamada A. Nayel1,2, H. L. Shashirekha2, Hiroyuki Shindo3, Yuji Matsumoto3 1- Department of Computer Science, Benha University, Benha - 13518, Egypt. 2- Department of Computer Science, Mangalore University, Mangalore - 574199, India. 3- Nara Institute of Science and Technology, Nara - 6300192, Japan. [email protected], [email protected], {shindo, matsu}@is.naist.jp Abstract Biomedical Named Entity Recognition (BioNER) is a crucial step for analyzing Biomedical texts, which aims at extracting biomedical named entities from a given text. Different supervised machine learning algorithms have been applied for BioNER by various researchers. The main requirement of these approaches is an annotated dataset used for learning the parameters of machine learning algorithms. Segment Representation (SR) models comprise of different tag sets used for representing the annotated data, such as IOB2, IOE2 and IOBES. In this paper, we propose an extension of IOBES model to improve the performance of BioNER. The proposed SR model, FROBES, improves the representation of multi-word entities. We used Bidirectional Long Short-Term Memory (BiLSTM) network; an instance of Recurrent Neural Networks (RNN), to design a baseline system for BioNER and evaluated the new SR model on two datasets, i2b2/VA 2010 challenge dataset and JNLPBA 2004 shared task dataset. The proposed SR model outperforms other models for multi-word entities with length greater than two. Further, the outputs of different SR models have been combined using majority voting ensemble method which outperforms the baseline model's performance. Keywords: Biomedical Text Mining, Segment Representations, Biomedical Named Entity Recognition, BiLSTM. 1. Introduction Named Entity Recognition (NER) is defined as identifying the named entities (NEs) in the text and classifying them into predefined semantic categories [1]. Names of places, organizations and persons are examples of NEs in general 2 domain, while RNA, DNA, proteins, treatment and medical test are examples of NEs in biomedical domain (BioNEs). Exponential growth of biomedical literature makes it vital to perform BioNER for various applications including Biomedical Text Mining. In addition to general challenges of NER, the nature of BioNEs listed below makes BioNER a challenging task: 1. Ambiguity: abbreviations are the major source of ambiguity. A single abbreviation can be interpreted as two different entities according to the context. For example, "EGFR" corresponds to epidermal growth factor receptor or estimated glomerular filtration rate. 2. Polysomy: a word refers to different entities. For example, "myc-c" refers to the name of a gene or protein. 3. Synonyms: an entity can be denoted by multiple names or aliases. For example, CASP3, caspase-3, and CPP32 denote the same entity [2]. 4. Out of dictionary: the overwhelming growth rate and the frequent insertion of new names into the dictionary [3]. 5. Multi-word BioNEs: most of BioNEs have multiple words, for example, CD28 surface receptor. 6. Nested BioNEs: a BioNE may occur as part of longer BioNE as a proper string. For example, "BP" (blood pressure) corresponding to laboratory test is a BioNE that occurs in "control BP" which is a treatment. 7. Lack of standard nomenclature for BioNEs of the same class. Approaches for BioNER varies from dictionary-based, rule-based, Machine Learning (ML) to hybrid approaches. The widely used ML approaches use annotated data to train a learning model which is then used to classify the unseen BioNEs. Combining the output of different classifiers using ensemble approach is an efficient technique used in BioNER [4]. Ensemble technique tries to overcome the weakness of some classifiers using the strength of other classifiers. Of late, deep learning algorithms based on Artificial Neural Networks (ANNs) [5- 6] are being used to a larger extent to train the learning model for various applications. 1.1 Long Short-Term Memory Artificial Neural Network (ANN) is a programming scheme used to learn the model from observed data. ANN comprises of a large number of interconnected processing units namely, neurons, within different layers. An ANN model basically consists of three layers: input layer, hidden layers and output layer. The input layer contains input neurons that send information to the hidden layer which in turn sends data to the output layer. Recurrent Neural Network (RNN) is a type of ANN in which hidden layer neurons has self-connections which means output depends not only on the present inputs but also on the previous step's neuron state. 3 Since NER is an instance of the sequence labeling task, it is beneficial to access past and future contexts of sequence tags for NER. RNN architecture is more appropriate to handle sequence data. RNN accepts a sequence of vectors, (x1, x2,…,xn) as input and outputs another sequence (h1,h2, … , hn) that contains some information about sequence at every step in the input. In case of long sequences, RNNs are biased towards their most recent inputs in the sequence due to the gradient exploding problem [7-8]. This problem is solved by Long Short-Term Memory (LSTM) [9]. LSTM is a kind of RNN which handles sequences of arbitrary length and is able to model dependencies between far apart sequence elements as well as consecutive elements. Basically, an LSTM unit consists of several gates which control the proportions of information to forget and to pass on to the next step. The complete details of LSTM architecture are described in [9]. One shortcoming of standard LSTM network is that they process the input only in left context, but in NER it is beneficial to have access to both left and right contexts. To overcome this problem, a Bidirectional LSTM (Bi-LSTM) have been designed [10]. The basic idea is to present each sequence forward and backward to two separate hidden states to capture left context and right context information respectively. Then the two hidden states are concatenated to form the final output. 2. Segment Representation (SR) Models One of the major requirements of learning algorithms is an annotated corpus. Segment representation (SR) models which have been applied for different NLP tasks such as Noun Phrase chunking (NP-chunking) [11-12], word segmentation [13-14], NER [15], are more efficient to annotate the data compared to other methods. It is the process of assigning suitable class label(s) to the words in a given text [16]. SR model comprises set of tags, which determine the position of a token in NE, combined with the class label to which that NE belongs to. The tags used in different SR models are B, I, E, S and O which stands for Begin, Inside, End, Single and Outside respectively. For example, a tag label for a token is B- XXX means that word is the first word of a NE belonging to class XXX. SR model can represent multi-word NEs. Different models are being used to annotate the data. The primary SR model is IO model, it assigns the tag I for the tokens inside the entity and the tag O for the tokens outside the entity [11]. This model is very simple, but it is not able to represent the boundaries of two consecutive entities of the same class. In the IOB1 model introduced by Ramshaw and Marcus [17], in addition to tags I and O the model assigns the tag B only to the first token of consecutive NEs of the same class. A modified model of IOB1 namely IOB2, has been introduced by Ratnaparkhi [18]. IOB2 model assigns the tag B for the first word of each NE. The models IOE1 and IOE2 use the same concepts of IOB1 and IOB2 respectively in addition to using the tag E for last token of NE instead of tag B [19]. Sun et al. [20], introduced IOBE model which concerns with both 4 boundaries of NEs. In addition to traditional tags I and O, IOBE model assigns tags B and E for the first and last word of all multi-word NEs respectively. IOBES model is a modified version of IOBE model that concerns with single word NEs. In addition to IOBE tags, the IOBES model assigns the tag S to the single word NEs. This model essentially differentiates between single and multi- word NEs. To show the difference between these models, an example of tagging the text fragment "The T cell surface molecule CD28 binds to ligands on accessory cells and APCs , " with different SR models is shown in Table 1. In this paper, we propose a new SR model to enhance the representation and extraction of multi-word BioNEs. Further, we combine the outputs of different SR models using majority voting ensemble method and the performance of the proposed SR model is evaluated using ANNs architecture based on Bidirectional Long Short-Term Memory (Bi-LSTM) and Conditional Random Fields (CRF). Tokens The T Cell surface molecule CD28 binds To ligands On accessory cells And APCs , Segment Representation Models IO O IOE1 IOE2 IOB1 IOB2 IOBE IOBES O O O O O O I-protein I-protein I-protein I-protein B-protein B-protein B-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein I-protein E-protein E-protein I-protein I-protein E-protein E-protein I-protein I-protein E-protein B-protein B-protein B-protein S-protein O O O O O O O O O O O O O O O O O O O O O O O O O O O O I-cell_type I-cell_type I-cell_type I-cell_type B-cell_type B-cell_type B-cell_type I-cell_type I-cell_type E-cell_type I-cell_type I-cell_type E-cell_type E-cell_type O O O O O O O I-cell_type I-cell_type I-cell_type B-cell_type B-cell_type B-cell_type S-cell_type O O O O O O O Table 1 Example of Segment Representations The rest of the paper is organized as follows, Section 3 presents the related works and the details of our proposed model is presented in Section 4. Section 5 contains the details of experiments and results, and the paper concludes in Section 6. 5 3. Related Work Different ML algorithms such as Support Vector machines (SVMs) [21], Conditional Random Fields (CRFs) [22] and Maximum Entropy (ME) [23] have been used for BioNER. These approaches depend essentially on extracting feature set used for training the appropriate algorithm. Haode et al. [5] have used Convolutional Neural Network (CNN) based model for BioNEs normalization. Xu et al. [6], designed a model using Bidirectional Long Short-Term Memory (Bi- LSTM) and CRF model for clinical named extraction. They used NCBI disease corpus to evaluate their model and have reported a f1-measure of 80.22. Gamal et al. [24] used CNN model for multi-output multi-task model BioNER where they used 15 different datasets for model evaluation, and their model reported an improvement for most datasets. Lots of research works have been carried out to study the performance of SR models on BioNER [25]. Han-Cheol Cho et al. [26] studied the performance of different SR models using linear chain CRFs to learn a base model for NER. Shashirekha and Nayel [27], studied the performance of BioNER using different SR models. Using CRFs and SVMs for learning the baseline systems for biomedical entity extraction they have compared different SR models on JNLPBA dataset and i2b2/VA 2010 medical challenge dataset. An extension of IOBES model has been introduced by Keretna et al. [28] to improve BioNER by introducing a new tag to resolve the problem of ambiguity. The model was evaluated on i2b2/VA 2010 medical challenge dataset. 4. Proposed model 4.1 FROBES We propose FROBES, an extension of IOBES model, used to represent multi- word entities using the tags (F/R/O/B/E/S) for (front, rear, outside, begin, end, single) respectively. In this model, the tag I in IOBES model is replaced by the tags F and R for entities of length greater than two words. This model describes both halves of the entities, the first half contains tags B and F, and the second half contains tags R and E. The relation between the proposed model and other models is shown in Figure 1. An example of tagging the protein "human proximal sequence element-binding transcription factor" using FROBES is shown below: - human element-binding transcription proximal sequence factor B-protein F-protein F-protein R-protein R-protein E-protein 6 FROBES differentiates between the words at the beginning and ending of the multi-word entity. Some multi-word BioNEs have the property of common endings. In many cases, these common ending helps in determining the entity class. For example, many protein names have the common expression "transcription factor" at the end of the entity such as; - zinc finger transcription factor - human proximal sequence element-binding transcription factor - B-cell specific transcription factor. Similarly, many DNA names has the expression "binding site" at the end of the DNA name such as; - hexameric receptor binding site - erythroid Kruppel-like factor (EKLF) binding site So, expanding tags of multi-word entities to differentiate between both sides of BioNEs may help not only in determining the BioNE, but also to assign it the correct class. The total number of occurrences for tags F and R in multi-word NEs in FROBES assume that the entity consists of n words and n > 2: if n is even # tag F is (n-2)/2 # tag R is (n-2)/2 if n is odd # tag F is (n-1)/2 # tag R is (n-3)/2 Fig.1 Relations between Segment Representation models 7 4.2 Architecture of baseline model The structure of the baseline model is shown in Figure 2. Our model accepts a sequence of words and the associated tags as input and gives a contextual representation for each word as output. Each word is represented as two types of vectors namely character embeddings and word embeddings. Character embeddings are used to capture the orthographic features of the words such as capitalization, hyphenation or special characters. Instead of hand-engineering the orthographic information, we learn character embeddings by training a character lookup table initialized randomly with embeddings for every character. The character embeddings corresponding to every character in a word are given in direct and reverse order to BiLSTM, and the output of these BiLSTMs are concatenated to form the character-level representation of a word. This character level representation is then concatenated with word embeddings from lookup- table. Word embeddings vector is used to capture the semantics of words and their similarities based on their surrounding words. We used pretrained word embeddings using skip-gram model induced on a combination of large corpus of PMC1 and PubMed texts with texts extracted from English Wikipedia dump2. This word embeddings model mixes domain-specific texts with domain-independent ones. At this level, every word is represented as a vector comprising of character level and word level information. Feeding these vectors to a BiLSTM network will output a contextual representation for each word. The final step is decoding, that is converting the contextual representations into output tags. For decoding step CRF is preferable. CRF is an undirected graphical model which focuses on the sentence level instead of individual positions. 5. Experiments We conducted experiments using ANN model which contains a bi-LSTM for character representation and a bi-LSTM for word context representation and CRF for decoding the results to tags. 5.1 Performance Evaluation We used f1-measure as a performance evaluation for BioNER system where TP is the number of true positives, FP number of false positives, and FN number of 1 https://www.ncbi.nlm.nih.gov/pmc/ 2 http://bio.nlplab.org/ false negatives and calculated Recall (R), Precision (P) and f1-measure as follows:- 8 𝑃 = 𝑅 = 𝑇𝑃 𝑇𝑃 + 𝑇𝐹 𝑇𝑃 𝑇𝑃 + 𝐹𝑁 𝑓1 − 𝑚𝑒𝑎𝑠𝑢𝑟𝑒 = 2 ∗ 𝑃 ∗ 𝑅 𝑃 + 𝑅 Fig.2 The structure of baseline system using two BiLSTM neural network 5.2. Datasets In this work, we used two datasets JNLPBA 2004 shared task dataset [29] and i2b2/VA 2010 challenge dataset [30]. Statistic of lengths of named entities of both datasets is given in Table 2. 5.2.1 JNLPBA 2004 shared task dataset The training set is originated from GENIA corpus v3.02 [31]. It consists of 2000 MEDLINE abstracts extracted using the MeSH search terms "human", "blood cell" and "transcription factor". These abstracts were annotated manually into 36 semantic classes. Among these classes, 5 classes are selected in JNLPBA shared task namely DNA, RNA, protein, cell_line and cell_type. The test set which contains 404 abstracts has been formed using the same MeSH search terms of training set. The publication years for training set ranges over 1990~1999, while for test set it ranges over 1978~2001. 9 5.2.2 i2b2/VA 2010 shared task dataset This dataset was created for entity and relation extraction purposes at i2b2/VA2010 challenge, including 826 discharge summaries for real patients from the University of Pittsburgh Medical Centre, Partners Health Care and Beth Israel Deaconess Medical Centre. Pittsburgh notes was used as a test set in i2b2/VA 2010 challenge, while other two sources were used as training set. Both test and training sets are manually annotated into three different entities "treatment", "test" and "problem". # of words contained in BioNEs Datasets JNLPBA i2b2 Test Train Test Train N = 1 N = 2 N = 3 N > 3 3466 40.01 % 2620 30.25 % 1240 14.32 % 1336 15.42 % Total 8662 21646 42.19 % 15442 30.10 % 7530 14.68 % 6683 13,03 % 51301 14116 45.31 % 8469 27.18 % 4573 14.68 % 3996 12.83 % 31154 7497 45.38 % 4441 26.88 % 2365 14.32 % 2216 13.42 % 16519 Table 2. Statistics for NEs lengths of JNLPBA and i2b2 datasets 5.3 Results and Discussion The overall results are shown in Table 3. We implemented the base line system with three SR models IOB2, IOBES and FROBES. Also, we used majority voting technique to combine the outputs of these models using ensemble approach. The table shows Recall (R), Precision (P) and f1-measure for implementing baseline system for both datasets using IOB2, IOBES, FROBES models and ensemble approach. The results show that our model improves R and f1-measure for JNLPBA dataset. For i2b2 dataset, FROBES model improves P. As shown in Table 2 the percentage of entities with length greater than three words in JNLPBA test set is greater than i2b2 test set. FROBES model is designed to represent long entities with more appropriate tags. The results show that f-measure of ensemble approach is near to the state-of-the-art for both datasets. 10 Datasets Evaluation Measure JNLPBA R P IOB2 75.18 67.82 f1-measure 71.31 R P 81.56 83.84 f1-measure 82.68 i2b2 Baseline SR Models IOBES FROBES Ensemble 75.87 67.68 71.54 82.07 84.57 83.30 76.23 67.69 71.71 81.74 84.62 83.15 76.25 68.16 71.99 82.27 85.01 83.62 Table 3. Results of different SR models and ensemble approach with baseline system Table 4 and Table 5 illustrate the f-measure of baseline system with different SR models for JNLPBA and i2b2 datasets respectively, with different lengths of entities. It is clear that, FORBES outperforms the other two models for multi- word entities (N ≥ 3). Also, ensemble using majority voting improves the f- measure for single and multi-word BioNEs. Number of tokens per entity Baseline SR models IOB2 IOBES FROBES N = 1 N = 2 N ≥ 3 73.79 74.11 64.53 73.57 74.10 65.63 73.59 74.38 65.83 Table 4. F-measure for JNLPBA dataset Number of tokens per entity Baseline SR model IOB2 IOBES FROBES N = 1 N = 2 N ≥ 3 87.66 81.64 75.58 88.04 82.21 76.82 87.92 81.63 77.00 Table 5. F-measure for i2b2 dataset Ensemble 73.91 74.34 66.46 Ensemble 88.23 82.31 77.48 11 Our model improved the performance of the baseline system for multi-word entity recognition. For single word entities, other models performed better. Our model is designed to discriminate the first part and second part of multi-word entity. In FORBES, in addition to tagging inner words as inner tokens in multi-word entities information about position of the word in an entity is also added. We replaced the tag I with two tags R and F. For all tokens at the rear of the entity we use R, and F for all tokens at the front of the entity. This information helps in improving the learning process. 6. Conclusion We have proposed a new SR model, FROBES, to improve multi-word BioNEs representation. To evaluate FROBES, we used a Bi-LSTM based model as a baseline system on JNLPBA and i2b2 datasets. Experimental results show that, FROBES has improved performance of BioNER for multi-word BioNEs. References: [1] Grishman R. and Sundheim B.: Message Understanding Conference-6: a the 16th International Conference on brief history. In proceedings of Computational Linguistics, vol. 1, (1996). [2] L. Tanabe and W. J. Wilbur: Tagging gene and protein names in biomedical text. Bioinformatics, vol. 18(8), pp. 1124 -- 1132, (2002). [3] S. Ananiadou and J. Mcnaught: Text Mining for Biology and Biomedicine. Norwood, MA, USA: Artech House, Inc., 2005. [4] Liao Z. and Zhang Z.: A generic classifier-ensemble approach for biomedical named entity recognition, Advances in Knowledge Discovery and Data Mining, 86-97. [5] Haode Li, Qingcai Chen, Buzhou Tang, Xiaolong Wang, Hua Xu, Baohua for biomedical entity Wang and Dong Huang: CNN-based normalization. BMC bioinformatics, 18(11), 385, (2017). ranking [6] Xu K., Zhou Z., Hao T., and Liu W.: A Bidirectional LSTM and Conditional Random Fields Approach to Medical Named Entity Recognition. In International Conference on Advanced Intelligent Systems and Informatics (pp. 355-365). Springer, (2017). [7] Bengio, Y., Simard, P., and Frasconi, P.: Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks, 5(2), 157-166, (1994). [8] Pascanu Razvan, Tomas Mikolov and Yoshua Bengio.: On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pp. 1310-1318, (2013). 12 [9] Hochreiter S. and Jürgen Schmidhuber.: Long short-term memory. Neural computation 9, no. 8 (1997): 1735-1780. [10] Graves Alex and Jurgen Schmidhuber.: Framewise phoneme classification with bidirectional LSTM and other neural network architectures. Neural Networks, 18(5), 602-610, (2005). [11] Béchet F., Alexis N. and Frank G.: Tagging unknown proper names using decision trees. In proceedings of the 38th Annual Meeting on ACL, 77-84, 2000. [12] Sang, Erik F., and Jorn Veenstra: Representing text chunks., In Proceedings of the ninth conference on European chapter of the Association for Computational Linguistics, ACL, pp. 173-179, (1999). [13] Xue N.: Chinese word segmentation as character tagging. Computational Linguistics and Chinese Language Processing vol. 8(1), pp. 29-48, (2003). [14] Zhao, H., Huang, C.-N., Li, M. and Lu, B.-L.: Effective tag set selection in Chinese word segmentation via conditional random field modeling. In Proceedings of the 20th Asian pacific conference on Language, Information and Computation, pp. 87-94, (2006). [15] Ratinov, Lev, and Dan Roth. "Design challenges and misconceptions in named entity recognition. In Proceedings of the Thirteenth Conference on Computational Natural Language Learning, ACL, pp. 147-155, 2009. [16] Cho H. C., Okazaki N., Miwa M. and Tsujii J. I.: Named entity recognition with multiple segment representations. Information Processing and Management, 49(4), pp. 954-965, (2013). [17] Ramshaw Lance and Mitchell P. Marcus: Text chunking using transformation-based learning. In Natural language processing using very large corpora, pp. 157-176. Springer Netherlands, (1999). [18] Adwait Ratnaparkhi: Maximum entropy models for natural language ambiguity resolution. Ph.D. thesis, University of Pennsylvania, PA, USA, (1998). [19] Taku Kudo and Yuji Matsumoto: Chunking with support vector machines. In Proceedings of the second meeting of the North American Chapter of ACL on Language Technologies, pp. 1-8, (2001). [20] Sun Jiashen, Tianmin Wang, Li Li, and Xing Wu.: Person name disambiguation based on topic model." In CIPS-SIGHAN Joint Conference on Chinese Language Processing, p. 391. 2010. [21] Z. Ju, J. Wang, and F. Zhu: Named entity recognition from biomedical text using SVM. In 5th International Conference on Bioinformatics and Biomedical Engineering, (ICBBE) pp. 1 -- 4, (2011). [22] Y. He and M. Kayaalp: Biological entity recognition with conditional random fields. In the Proceedings AMIA Annual Symposium Proceedings, 2008. [23] Y. Lin, T. Tsai, W. Chou, K. Wu, T. Sung, and W. Hsu: A maximum entropy approach to biomedical named entity recognition. Proceedings of the Workshop on Data Mining in Bioinformatics BIOKDD, USA, 56 -- 61, 2004. [24] Crichton G., Pyysalo S., Chiu B. and Korhonen A.: A neural network multi-task learning approach to biomedical named entity recognition. BMC bioinformatics, 18(1), 368-381. 13 [25] Leaman Robert, and Graciela Gonzalez.: BANNER: an executable survey of advances in biomedical named entity recognition. In Pacific symposium on biocomputing, vol. 13, pp. 652-663, (2008). [26] Cho, Han-Cheol, Naoaki Okazaki, Makoto Miwa, and Jun'ichi Tsujii: Named entity recognition with multiple segment representations. Information Processing & Management, vol. 49(4), pp. 954-965, (2013). [27] Shashirekha H. L., and Hamada A. Nayel.: A comparative study of segment representation for biomedical named entity recognition. In International Conference on Advances in Computing, Communications and Informatics (ICACCI), pp. 1046-1052. IEEE, 2016. [28] Keretna Sara, Chee Peng Lim, Doug Creighton and Khaled Bashir Shaban.: Enhancing medical named entity recognition with an extended segment representation technique. Computer methods and programs in biomedicine vol. 119(2), pp. 88-100, (2015). [29] Kim J-D, Ohta T, Tsuruoka Y and Tateisi Y: Introduction to the Bio- Entity Recognition Task at JNLPBA. In Proc. of the Joint Workshop on Natural Language Processing in Biomedicine and its Application, pp. 70-75, (2004). [30] Özlem Uzuner, Brett R. South, Shuying Shen and Scott L. DuVall: 2010 i2b2/va challenge on concepts, assertions and relations in clinical test. Journal of the American Medical Informatics Association, vol. 18(2), pp. 552-556 [31] Kim J. D., Ohta T., Tateisi Y. and Tsujii, J. I.: GENIA corpus -- a semantically annotated corpus for bio-text mining. Bioinformatics, 19(1), 180- 182, (2003).
1808.10627
1
1808
2018-08-31T08:21:45
Do Language Models Understand Anything? On the Ability of LSTMs to Understand Negative Polarity Items
[ "cs.CL" ]
In this paper, we attempt to link the inner workings of a neural language model to linguistic theory, focusing on a complex phenomenon well discussed in formal linguis- tics: (negative) polarity items. We briefly discuss the leading hypotheses about the licensing contexts that allow negative polarity items and evaluate to what extent a neural language model has the ability to correctly process a subset of such constructions. We show that the model finds a relation between the licensing context and the negative polarity item and appears to be aware of the scope of this context, which we extract from a parse tree of the sentence. With this research, we hope to pave the way for other studies linking formal linguistics to deep learning.
cs.CL
cs
Do Language Models Understand Anything? On the Ability of LSTMs to Understand Negative Polarity Items Jaap Jumelet University of Amsterdam Dieuwke Hupkes ILLC, University of Amsterdam [email protected] [email protected] 8 1 0 2 g u A 1 3 ] L C . s c [ 1 v 7 2 6 0 1 . 8 0 8 1 : v i X r a Abstract In this paper, we attempt to link the inner workings of a neural language model to lin- guistic theory, focusing on a complex phe- nomenon well discussed in formal linguis- tics: (negative) polarity items. We briefly dis- cuss the leading hypotheses about the licens- ing contexts that allow negative polarity items and evaluate to what extent a neural language model has the ability to correctly process a subset of such constructions. We show that the model finds a relation between the licensing context and the negative polarity item and ap- pears to be aware of the scope of this context, which we extract from a parse tree of the sen- tence. With this research, we hope to pave the way for other studies linking formal linguistics to deep learning. Introduction 1 In the past decade, we have seen a surge in the de- velopment of neural language models (LMs). As they are more capable of detecting long distance dependencies than traditional n-gram models, they serve as a stronger model for natural language. However, it is unclear what kind of properties of language these models encode. This does not only hinder further progress in the development of new models, but also prevents us from using models as explanatory models and relating them to formal linguistic knowledge of natural language, an as- pect we are particularly interested in in the current paper. Recently, there has been an increasing interest in investigating what kind of linguistic informa- tion is represented by neural models, (see, e.g., Conneau et al., 2018; Linzen et al., 2016; Tran et al., 2018), with a strong focus on their syntac- tic abilities. In particular, (Gulordava et al., 2018) used the ability of neural LMs to detect noun-verb congruence pairs as a proxy for their awareness of syntactic structure, yielding promising results. In this paper, we follow up on this research by study- ing a phenomenon that has received much atten- tion by linguists and for which the model requires -- besides knowledge of syntactic structure -- also a semantic understanding of the sentence: negative polarity items (NPIs). In short, NPIs are a class of words that bear the special feature that they need to be licensed by a specific licensing context (LC) (a more elaborate linguistic account of NPIs can be found in the next section). A common example of an NPI and LC in English are any and not, respectively: The sen- tence He didn't buy any books is correct, whereas He did buy any books is not. To properly process an NPI construction, a language model must be able to detect a relationship between a licensing context and an NPI. Following Linzen et al. (2016) and Gulordava et al. (2018), we devise several tasks to assess whether neural LMs (focusing in particular on LSTMs) can handle NPI constructions, and obtain initial positive results. Additionally, we use diag- nostic classifiers (Hupkes et al., 2018) to increase our insight in how NPIs are processed by neural LMs, where we look in particular at their under- standing of the scope of an LCs, an aspect which is also relevant for many other natural language related phenomena. We obtain positive results focusing on a subset of NPIs that is easily extractable from a parsed cor- pus but also argue that a more extensive investiga- tion is needed to get a complete view on how NPIs -- whose distribution is highly diverse -- are pro- cessed by neural LMs. With this research and the methods presented in this paper, we hope to pave the way for other studies linking neural language models to linguistic theory. In the next section, we will first briefly discuss NPIs from a linguistic perspective. Then, in Sec- tion 3, we provide the setup of our experiments and describe how we extracted NPI sentences from a parsed corpus. In Section 4, we describe the setup and results of an experiment in which we compare the grammaticality of NPI sentences with and without a licensing context, using the prob- abilities assigned by the LM. Our second experi- ment is outlined in Section 5, in which we describe a method for scope detection on the basis of the intermediate sentence embeddings. We conclude our findings in Section 6. 2 Negative Polarity Items NPIs are a complex yet very common linguis- tic phenomenon, reported to be found in at least 40 different languages (Haspelmath, 1997). The complexity of NPIs lies mostly in the highly id- iosyncratic nature of the different types of items and licensing contexts. Commonly, NPIs occur in contexts that are related to negation and modali- ties, but they can also appear in imperatives, ques- tions and other types of contexts and sentences. This broad range of context types makes it chal- lenging to find a common feature of these con- texts, and no overarching theory that describes when NPIs can or cannot occur yet exists (Barker, 2018). In this section, we provide a brief overview of several hypotheses about the different contexts in which NPIs can occur, as well as examples that illustrate that none of these theories are com- plete in their own regard. An extensive descrip- tion of these theories can be found in Giannaki- dou (2008), Hoeksema (2012), and Barker (2018), from which most of the example sentences were taken. These sentences are also collected in Table 1. Entailment A downward entailing context is a context that licenses entailment to a subset of the initial clause. For example, Every is downward entailing, as Every [ student ] left entails that Ev- ery [ tall student ] left. Ladusaw (1980) hypoth- esize that NPIs are licensed by downward en- tailing contexts. Rewriting the previous exam- ple to Every [ student with any sense ] left yields a valid expression, contrary to the same sentence with the upward entailing context some: Some [student with any sense ] left. An example of a non-downward entailing context that is a valid NPI licensor is most. Non-veridicality A context is non-veridical when the truth value of a proposition (veridical- ity) that occurs inside its scope cannot be inferred. An example is the word doubt: the sentence Ann doubts that Bill ate some fish does not entail Bill ate some fish. Giannakidou (1994) hypothesizes that NPIs are licensed only in non-veridical con- texts, which correctly predicts that doubt is a valid licensing context: Ann doubts that Bill ate any fish. A counterexample to this hypothesis is the context that is raised by the veridical operator only: Only Bob ate fish entails Bob ate fish, but also licenses Only Bob ate any fish (Barker, 2018). 2.1 Related constructions Two grammatical constructions that are closely re- lated to NPIs are Free Choice Items (FCIs) and Positive Polarity Items (PPIs). Free Choice Items FCIs inhibit a property called freedom of choice (Vendler, 1967), and are licensed in contexts of generic or habitual sen- tences and modal verbs. An example of such a construction is the generic sentence Any cat hunts mice, in which any is an FCI. Note that any in this case is not licensed by negation, modality, or any of the other licensing contexts for NPIs. English is one of several languages in which a word can be both an FCI and NPI, such as the most common example any. Although this research does not fo- cus on FCIs, it is important to note that the some- what similar distributions of NPIs and FCIs can severely complicate the diagnosis whether we are dealing with an NPI or an FCI. to bear Positive Polarity Items PPIs are a class of words that are thought the property of scoping above negation (Giannakidou, 2008). Similar to NPIs their contexts are highly idiosyn- cratic, and the exact nature of their distribution is hard to define. PPIs need to be situated in a veridi- cal (often affirmative) context, and can therefore be considered a counterpart to the class of NPIs. A common example of a PPI is some, and the varia- tions thereon. It is shown by Giannakidou (2008) that there exist multiple interpretations of some, influenced by its intonation. The emphatic variant is considered to be a PPI that scopes above nega- tion, while the non-emphatic some is interpreted as a regular indefinite article (such as a). 1. Every [ student with any sense ] left 2. Ann doubts that [ Bill ever ate any fish ] Non-veridical 3. I don't [ have any potatoes ] 4. [ Did you see anybody ] ? Downward entailing Questions Context type Downward entailing Table 1: Various example sentences containing NPI constructions. The licensing context scope is denoted by square brackets, the NPI itself in boldface, and the licensing operator is underlined. In our experiments we focus mostly on sentences that are similar to sentence 3. 3 Experimental Setup Our experimental setup consists of 2 phases: first we extract the relevant sentences and NPI con- structions from a corpus, and then, after passing the sentences through an LM, we apply several di- agnostic tasks to them. 3.1 NPI extraction For extraction we used the parsed Google Books corpus (Michel et al., 2011). We focus on the most common NPI pairs, in which the NPI any (or any variation thereon) is li- censed by a negative operator (not, n't, never, or nobody), as they can reliably be extracted from a parsed corpus. As variations of any we con- sider anybody, anyone, anymore, anything, any- time, and anywhere (7 in total including any). We first identify candidate NPI-LC relations looking only at the surface form of the sentence, by selecting sentences that contain the appropriate lexical items. We use this as a pre-filtering step for our second method, in which we extract spe- cific subtrees given the parse tree of the sentence. We consider 6 different subtrees, that are shown in Table 2. An example of such a subtree that licenses an NPI is the following: VP VBD RB VP did not ··· any ··· which could, for instance, be a subtree of the parse tree of Bill did not buy any books. In this subtree, the scope of the licensor not encompasses the VP of the sentence. We use this scope to pinpoint the exact range in which an NPI can reside. Once all NPI constructions have been extracted, we are able to gain more insight in the distance Figure 1: Distribution of distances between NPI and licensing context. Note the log scale on the y-axis. between the licensing operator and an NPI, which we plot in Figure 1. Note the use of a log scale on the y-axis: in the majority of the constructions (47.2%) the LC and NPI are situated only 2 posi- tions from each other. 3.2 Model For all our experiments, we use a pretrained 2- layer LSTM language model with 650 hidden units made available by Gulordava et al. (2018).1 For all tests we used an average hidden final state as initialization, which is computed by passing all sentences in our corpus to the LM, and averaging the hidden states that are returned at the end of each sentence. We use two different methods to assess the LSTMs ability to handle NPI constructions, which we will discuss in the next two sections: one that is based on the probabilities that are returned by the LM, and one based on its internal activations. 4 Sentence Grammaticality In our first series of experiments, we focus on the probabilities that are assigned by the model to dif- 1github.com/facebookresearch/ colorlessgreenRNNs/tree/master/data (% / corpus) (2.69%) (1.10%) (1.00%) Construction All corpus sentences Containing any variation of any Licensed by negative operator Detected by subtree extractor 1. (VP (VP RB [VP])) He did n't [ have any trouble going along ] . 2. (VP (MD RB [VP])) I could not [ let anything happen to either of them ] . 3. (VP (VP RB [NP/PP/ADJP])) "There was n't [ any doubt in his mind who was preeminent ] ." 4. (VP (NP RB [VP])) Those words never [ lead to anything good ] . 5. (S (RB [S/SBAR])) The trick is not [ to process any of the information I encounter ] . 6. (RB [NP/PP ADVP]) There was not [ a trace of water anywhere ] . # 11.213.916 301.836 123.683 112.299 70.017 27.698 8708 3564 1347 930 Table 2: Various sentence constructions and their counts that were extracted from the corpus. Similar verb POS tags are grouped under VP, except for modal verbs (MD). LC scope is denoted by square brackets. ferent sequences. More specifically, we compare the exponent of the normalized negative log prob- ability (also referred to as perplexity) of different sentences. The lower the perplexity score of a sen- tence is, the better a model was able to predict its tokens. 4.1 Rewriting sentences While studying perplexity scores of individual sentences is not very informative, comparing per- plexity scores of similar sentences can provide in- formation about which sentence is preferred by the model. We exploit this by comparing the negative polarity sentences in our corpus with an ungram- matical counterpart, that is created by removing or rewriting the licensing context.2 To account for the potential effect of rewriting the sentence, we also consider the sentences that originate from replacing the NPI in the original and rewritten sentence with its positive counter- part. In other words, we replace the variations of any by those of some: anything becomes some- thing, anywhere becomes somewhere, etc. We re- fer to these 4 conditions with the terms NPIneg, NPIpos, PPIneg and PPIpos: 2Not and never are removed, nobody is rewritten to every- body. NPIneg: Bill did not buy any books NPIpos: PPIneg: PPIpos: * Bill did buy any books # Bill did not buy some books Bill did buy some books PPIneg would be correct when interpreting some as indefinite article (non-emphatic some). In our setup, NPIneg always refers to the original sen- tence, as we always use a sentence containing an NPI in a negative context as starting point. Of the 7 any variations, anymore is the only one without a PPI counterpart, and these sentences are therefore not considered for this comparison. 4.2 Comparing sentences For all sentences, we compute the perplexity of the original sentence, as well as the perplexity of the 3 rewritten versions of it. To discard any influence that the removal of the licensing operator might have on its continuation after the occurrence of the NPI, we compute the perplexity of the sentence up to and including the position of the NPI. I.e., in the example of Bill did not buy any books the word books would not be taken into account when computing the perplexity. In addition to perplexity, we also consider the conditional probabilities of the PPIs and NPIs, given the preceding sentence.3 For example, for 3We also considered the SLOR score (Pauls and Klein, NPIneg we would then compute P(any Bill did not buy). 4.3 Expectations We posit the following hypotheses about the out- come of the experiments. • P P (NPIneg) < P P (NPIpos): We expect an NPI construction to have a lower perplex- ity than the rewritten sentence in which the licensing operator has been removed. • P P (PPIpos) < P P (PPIneg): Similarly, we expect a PPI to be preferred in the positive counterpart of the sentence, in which no li- censing operator occurs. • P P (NPIneg) < P P (PPIneg): We expect an NPI to be preferred to a PPI inside a nega- tive context. • P P (PPIpos) < P P (NPIpos): We expect the opposite once the licensor for this context has been removed. 4.4 Results In Figure 2, we plot the distribution of the perplex- ity scores for each sentence type. The perplexi- ties of the original and rewritten sentence without the NPI are indicated by SENneg and SENpos, respectively. This figure shows that the original sentences have the lowest perplexity, whereas the NPIs in a positive context are deemed most im- probable by the model. More insightful we consider Figure 3, in which we plot the distribution of the relative differences of the perplexity scores and conditional proba- bilities for each of the above mentioned compar- isons, and we report the percentage of sentences that complied with our hypotheses. The relative difference between two values a and b, given by (a − b)/((a + b)/2), neatly maps each value pair in a window between -2 (a (cid:28) b) and 2 (a (cid:29) b), thereby providing a better insight in the difference between two arrays of scores. We highlight some of the previously mentioned comparisons below. 2012), that was shown in (Lau et al., 2017) to have a strong correlation with human grammaticality judgments. The SLOR score can be seen as a perplexity score that is normalized by the average unigram probability of the sentence. It turned out, however, that this score had such a strong correlation with the perplexity scores (Spearman's ρ of -0.66, Kendall's τ of -0.54), that we omitted a further analysis of the outcome. Figure 2: Distribution of perplexity scores for all the sentences. P P (NPIneg) < P P (NPIpos) From Figure 3 it is clear that the model has a very strong prefer- ence for NPIs to reside inside the negative scope, an observation that is supported by both the per- plexity and probability scores. While observable in both plots, this preference is most clearly vis- ible when considering conditional probabilities: the high peak shows that the difference between the probabilities is the most defined of all compar- isons that we made. P P (NPIneg) < P P (PPIneg) The model has a strong preference for NPIs over PPIs inside neg- ative scope, although this effect is slightly less prevalent in the perplexity scores. This might be partly due to the fact that there exist interpretations for some inside negative scope that are correct (the non-emphatic some, as described in Section 2). When looking solely at the conditional probabili- ties the preference becomes clearer, showing simi- lar behavior to the difference between NPIneg and NPIpos. P P (NPIneg) < P P (PPIpos) The original sen- tences with NPIs are strongly preferred over the rewritten sentences with PPIs, which indicates that the rewriting in general leads to less probable sen- tences. This finding is confirmed by comparing the perplexities of the original and rewritten sen- tence without the NPI or PPI (dotted line in the left plot in Figure 3): the original sentence containing the licensing context has a lower perplexity than the rewritten sentence in 92.7% of the cases. The profile of the differences between the 2 sentences is somewhat similar to the other comparisons in which the negative context is preferred. Given that PERPLEXITY P (wc) < NPIpos PPIneg PPIpos 99.2% 88.7% 95.8% 17.3% 91.0% 3.6% - - - NPIneg NPIpos PPIneg > NPIpos PPIneg PPIpos 99.3% 94.8% 93.4% 34.0% 19.1% 30.1% - - - NPIneg NPIpos PPIneg Figure 3: Results of perplexity and conditional probability tests. For perplexity a lower score is better, for proba- bility a higher score is better. The plots denote the distribution of the relative differences between the scores of the 6 sentence pairs that are considered. the considered sentences were taken from natural data, it is not entirely unsurprising that removing or rewriting a scope operator has a negative im- pact on the probability of the rest of the sentence. This observation, however, does urge care when running experiments like this. P P (PPIpos) < P P (NPIpos) When comparing NPIs and PPIs in the rewritten sentences, it turns out that the model does show a clear preference that is not entirely due to a less probable rewriting step. Both the perplexity (17.3%) and probability (19.1%) show that the NPI did in fact strongly de- pend on the presence of the licensing operator, and not on other words that it was surrounded with. The model is thus able to pick up a signal that makes it prefer a PPI to an NPI in a positive con- text, even if that positive context was obtained by rewriting it from a negative context. P P (PPIneg) < P P (NPIpos) PPIs in a nega- tive context are strongly preferred to NPIs in a faulty positive context: a lower perplexity was as- signed to NPIpos in only 3.6% of the cases. This shows that the model is less strict on the allowed context for PPIs, which might be related to the non-emphatic variant of some, as mentioned be- fore. P P (PPIneg) < P P (PPIpos) A surprising re- sult is the higher perplexity that is assigned to PPIs inside the original negative context compared to PPIs in the rewritten sentence, which is oppo- site to what we hypothesized. It is especially re- markable considering the fact that the conditional probability indicates an opposite result (at only 30.1% preference for the original sentence). Once more the outcome of the perplexity comparison might partly be due to the rewriting resulting in a less probable sentence. When solely looking at the conditional probability score, however, we can conclude that the model has a preference for PPIs to reside in positive contexts. Long distances As shown in Figure 1, most dis- tances between the LC and the NPI are rather short. It might therefore be useful to look at the performance of the model on sentences that con- tain longer distance dependencies. In Figure 4 the outcomes of the conditional probability task are split out on the distance between the LC and the NPI. From this plot it follows that the shorter depen- dencies were mostly responsible for the outcome of our hypotheses. The significant differences be- tween the original sentence and the rewritten sen- Figure 4: Outcomes for the conditional probability task, split out on the distance between licensing context and NPI. The averages that are reported in Figure 3 are denoted by the dotted lines. tences NPIpos and PPIneg becomes less defined when the distance is increased. This might be partly due to the lower occurrence of these constructions: 47.2% of the sentences in our corpus are situated only 2 positions from each other. Moreover, it would be interesting to see how this behavior matches with that of human judg- ments. Conclusion We conclude that the LM is able to detect a signal that indicates a strong relation- ship between an NPI and its licensing context. By comparing the scores between equivalent sentence constructions we were able to account for possible biases of the model, and showed that the output of the model complied with our own hypotheses in almost all cases. 5 Scope detection In the previous section, we assessed the ability of a neural LM to handle NPI constructions, based on the probabilities returned by the LM. In the current section, we focus on the hidden states that the LM uses to arrive at a probability distribution over the vocabulary. In particular, we focus on the scope of the licensing operator, which determines where an NPI can occur. Setup Using the parse tree extraction method described in Section 3, we annotate all sentences in our corpus with the scope of the licensing operator. Following Hupkes et al. (2018), we then train diagnostic classifiers to predict for each word in the sentence whether it is inside the licensing scope. This is done on the basis of the hidden representation of the LM that is obtained after it just processed this word. We differentiate between 5 different labels: pre-licensing scope words (1), the licensing operator (2), words inside the scope (3), the NPI itself (4), and post-licensing scope words (5). The sentence The man that died didn't have any relatives, but he died peacefully., for example, is annotated as follows: The1 man1 that1 died1 did1 n't2 have3 any4 relatives3 ,5 but5 he5 died5 peacefully5 .5 The main positions of interest are the transi- tion from within the licensing scope to the post- scope range, and the actual classification of the NPI and LC. Of lesser interest are the pre- and post-licensing scope, as these are both diverse em- beddings that do not depend directly on the licens- ing context itself. We train our model on the intermediate hidden states of the final layer of the LSTM, using a lo- gistic regression classifier. The decoder of the LM computes the probability distribution over the vo- cabulary by a linear projection layer from the final hidden state. By using a linear model for classifi- cation (such as logistic regression) we can investi- gate the expressiveness of the hidden state: if the linear model is able to fulfill a classification task, it could be done by the linear decoding layer too. As a baseline test, we also train a logistic regres- sion model on representations that were acquired by an additive model using GloVe word embed- dings (Pennington et al., 2014). Using these em- beddings as a baseline we are able to determine the importance of the language model: if it turns out that the LM does not outperform a simple ad- ditive model, this indicates that the LM did not add much syntactic information to the word em- beddings themselves (or that no syntactic informa- tion is required to solve this task). We used 300- dimensional word embeddings that were trained on the English Wikipedia corpus (as is our own LM). For both tasks (LM and GloVe) we use a subset of 32k NPI sentences which resulted in a total of 250k data points. We use a split of 90% of the data for training, and the other 10% for testing classifi- cation accuracy. Results The classifier trained on the hidden states of the LM achieved an accuracy of 89.7% on the test set. The model that was trained on the same dataset using the GloVe baseline scored 72.5%, show- ing that the information that is encoded by the LM does in fact contribute significantly to this task. To provide a more qualitative insight into the power of this classifier, we provide 3 remark- able sentences that were classified accurately by the model. Note the correct transition from licens- ing scope to post-scope, and the correct classifica- tion of the NPI and LC in all sentences here. 1. I1 'd1 never2 seen3 anything4 like3 it3 and5 it5 ...5 was5 ...5 beautiful5 .5 2. "1 I1 do1 n't2 think3 I3 'm3 going3 to3 come3 to3 you3 for3 reassurance3 anymore4 ,5 "5 Sibyl5 grumbled5 .5 3. But1 when1 it1 comes1 to1 you1 ,1 I1 'm1 not2 taking3 any4 more3 risks3 than3 we3 have3 to3 .5 We ran a small evaluation on a set of 3000 sen- tences (47020 tokens), of which 56.8% were clas- sified completely correctly. Using the GloVe clas- sifier only 22.1% of the sentences are classified flawlessly. We describe the classification results in the confusion matrices that are displayed in Figure 5. Looking at the results on the LSTM embed- dings, it appears that the post-licensing scope to- kens (5) were misclassified most frequently: only 75.2% of those data points were classified cor- rectly. The most common misclassification for this class is class 3: an item inside the licens- ing scope. This shows that for some sentences it is hard to distinguish the actual border of the li- censing scope, although 90.3% of the first post- scope embeddings (i.e. the first embedding after the scope has ended) were classified correctly. The lower performance of the model on this class is mostly due to longer sentences in which a large part of the post-licensing scope was classified in- correctly. This causes the model to pick up a noisy signal that trips up the predictions for these tokens. It is promising, however, that the NPIs (4) and li- censing operator items (2) themselves are classi- fied with a very high accuracy, as well as the to- kens inside the licensing scope (3). When compar- ing this to the performance on the GloVe embed- dings, it turns out that that classifier has a strong bias towards the licensing scope class (3). This highlights the power of the LSTM embeddings, re- vealing that is not a trivial task at all to correctly classify the boundaries of the context scope. We therefore conclude that the information that is rel- evant to NPI constructions can be accurately ex- tracted from the sentence representations, and fur- thermore that our neural LM has a significant posi- tive influence on encoding that structural informa- tion. 6 Conclusion We ran several diagnostic tasks to investigate the ability of a neural language model to handle NPIs. From the results on the perplexity task we con- clude that the model is capable to detect the re- lationship between an NPI and the licensing con- texts that we considered. We showed that the lan- guage model is able to pick up a distinct signal that indicates a strong relationship between a neg- ative polarity item and its licensing context. By comparing the perplexities of the NPI construc- tions to those of the equivalent PPIs, it follows that removing the licensing operator has a remarkably different effect on the NPIs than on the PPIs. This effect, however, does seem to vanish when the dis- tance between the NPI and licensing context is in- creased. From our scope detection task it followed that the licensing signal that the LM detects can in fact be extracted from the hidden representa- tions, providing further evidence of the ability of the model in handling NPIs. There are many other LSTM Embeddings Correct label GloVe embeddings Correct label Pred. 1 2 3 4 5 Total 1 14891 203 850 13 520 16477 2 83 2870 42 1 11 3007 3 408 42 14555 32 821 15858 4 2 0 15 3005 0 3022 5 760 59 1286 44 6507 8656 Pred. 1 2 3 4 5 Total 1 11166 178 4708 17 408 16477 2 87 1847 1072 0 1 3007 3 1077 82 14166 84 449 15858 4 0 0 353 2669 0 3022 5 249 0 4003 36 4368 8656 Figure 5: Confusion matrices for the scope detection task trained on the embeddings of an LSTM and the averages of GloVe embeddings. natural language phenomena related to language scope, and we hope that our methods presented here can provide an inspiration for future research, trying to link linguistics theory to neural models. The setup of our second experiment, for exam- ple, would translate easily to the detection of the nuclear scope of quantifiers. In particular, we be- lieve it would be interesting to look at a wider ty- pological range of NPI constructions, and inves- tigate how our diagnostic tasks translate to other types of such constructions. Furthermore, the find- ings of our experiments could be compared to those of human judgments syntactic gap filling task. These judgments could also provide more in- sight into the grammaticality of the rewritten sen- tences. The hypotheses that are described in Section 2 and several others that are mentioned in the litera- ture on NPIs are strongly based on a specific kind of entailment relation that should hold for the con- texts in which NPIs reside. An interesting follow- up experiment that would provide a stronger link with the literature in formal linguistics on the sub- ject matter, would be based on devising several entailment tasks that are based on the various hy- potheses that exists for NPI licensing contexts. It would be interesting to see whether the model is able to detect whether a context is downward en- tailing, for example, or if it has more difficulty identifying non-veridical contexts. This would then also create a stronger insight in the seman- tic information that is stored in the encodings of the model. Such experiments would, however, re- quire the creation of a rich artificial dataset, which would give much more control in determining the inner workings of the LSTM, and is perhaps a nec- essary step to gain a thorough insight in the LM encodings from a linguistic perspective. Acknowledgements We thank the reviewers, Samira Abnar, and Willem Zuidema for their useful and constructive feedback. DH is funded by the Netherlands Orga- nization for Scientific Research (NWO), through a Gravitation Grant 024.001.006 to the Language in Interaction Consortium. References Chris Barker. 2018. Negative polarity as scope mark- ing. Linguistics and Philosophy, pages 1 -- 28. Alexis Conneau, German Kruszewski, Guillaume Lample, Loıc Barrault, and Marco Baroni. 2018. What you can cram into a single vector: Probing sentence embeddings for linguistic properties. arXiv preprint arXiv:1805.01070. Anastasia Giannakidou. 1994. The semantic licensing of npis and the modern greek subjunctive. Language and cognition, 4:55 -- 68. Anastasia Giannakidou. 2008. Negative and posi- tive polarity items: Variation, licensing, and com- positionality. In Claudia Maienborn, Klaus von Heusinger, and Paul Porner, editors, Semantics: An international handbook of natural language mean- ing. Berlin: Mouton de Gruyter, pages 1660 -- 1712. Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. 2018. Color- less green recurrent networks dream hierarchically. pages 1195 -- 1205. M. Haspelmath. 1997. Indefinite Pronouns. Oxford Studies in Typology and. Clarendon Press. Jack Hoeksema. 2012. On the natural history of nega- tive polarity items. Linguistic Analysis, 38(1):3. Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. 2018. Visualisation and 'diagnostic classi- fiers' reveal how recurrent and recursive neural net- works process hierarchical structure. Journal of Ar- tificial Intelligence Research, 61:907 -- 926. W.A. Ladusaw. 1980. Polarity sensitivity as inherent scope relations. Outstanding dissertations in lin- guistics. Garland Pub. Jey Han Lau, Alexander Clark, and Shalom Lappin. 2017. Grammaticality, acceptability, and probabil- ity: a probabilistic view of linguistic knowledge. Cognitive Science, 41(5):1202 -- 1241. Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. 2016. Assessing the ability of lstms to learn syntax- sensitive dependencies. Transactions of the Associ- ation for Computational Linguistics, 4:521 -- 535. Jean-Baptiste Michel, Yuan Kui Shen, Aviva Presser Aiden, Adrian Veres, Matthew K. Gray, , Joseph P. Pickett, Dale Hoiberg, Dan Clancy, Peter Norvig, Jon Orwant, Steven Pinker, Martin A. Nowak, and Erez Lieberman Aiden. 2011. Quantitative analysis of culture using millions of digitized books. Sci- ence, 331(6014):176 -- 182. Adam Pauls and Dan Klein. 2012. Large-scale syntac- tic language modeling with treelets. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers-Volume 1, pages 959 -- 968. Association for Computational Lin- guistics. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 confer- ence on empirical methods in natural language pro- cessing (EMNLP), pages 1532 -- 1543. Ke Tran, Arianna Bisazza, and Christof Monz. The importance of being recurrent for arXiv preprint 2018. modeling hierarchical structure. arXiv:1803.03585. Z. Vendler. 1967. Linguistics in philosophy. G - Refer- ence, Information and Interdisciplinary Subjects Se- ries. Cornell University Press.
1804.04093
1
1804
2018-04-11T16:56:04
SHAPED: Shared-Private Encoder-Decoder for Text Style Adaptation
[ "cs.CL" ]
Supervised training of abstractive language generation models results in learning conditional probabilities over language sequences based on the supervised training signal. When the training signal contains a variety of writing styles, such models may end up learning an 'average' style that is directly influenced by the training data make-up and cannot be controlled by the needs of an application. We describe a family of model architectures capable of capturing both generic language characteristics via shared model parameters, as well as particular style characteristics via private model parameters. Such models are able to generate language according to a specific learned style, while still taking advantage of their power to model generic language phenomena. Furthermore, we describe an extension that uses a mixture of output distributions from all learned styles to perform on-the fly style adaptation based on the textual input alone. Experimentally, we find that the proposed models consistently outperform models that encapsulate single-style or average-style language generation capabilities.
cs.CL
cs
SHAPED: Shared-Private Encoder-Decoder for Text Style Adaptation Ye Zhang∗ UT Austin [email protected] Nan Ding Radu Soricut {dingnan,rsoricut}@google.com Google AI 8 1 0 2 r p A 1 1 ] L C . s c [ 1 v 3 9 0 4 0 . 4 0 8 1 : v i X r a Abstract Supervised training of abstractive language generation models results in learning condi- tional probabilities over language sequences based on the supervised training signal. When the training signal contains a variety of writ- ing styles, such models may end up learn- ing an 'average' style that is directly influ- enced by the training data make-up and can- not be controlled by the needs of an applica- tion. We describe a family of model archi- tectures capable of capturing both generic lan- guage characteristics via shared model param- eters, as well as particular style characteristics via private model parameters. Such models are able to generate language according to a specific learned style, while still taking advan- tage of their power to model generic language phenomena. Furthermore, we describe an ex- tension that uses a mixture of output distribu- tions from all learned styles to perform on-the- fly style adaptation based on the textual input alone. Experimentally, we find that the pro- posed models consistently outperform models that encapsulate single-style or average-style language generation capabilities. 1 Introduction Encoder-decoder models have recently pushed forward the state-of-the-art performance on a va- riety of language generation tasks, including ma- chine translation (Bahdanau et al., 2015; Wu et al., 2016; Vaswani et al., 2017), text summariza- tion (Rush et al., 2015; Nallapati et al., 2016; See et al., 2017), dialog systems (Li et al., 2016; As- ghar et al., 2017), and image captioning (Xu et al., 2015; Ranzato et al., 2015; Liu et al., 2017). This framework consists of an encoder that reads the input data and encodes it as a sequence of vectors, which is in turn used by a decoder to generate an- ∗ Work done as an intern at Google AI. other sequence of vectors used to produce output symbols step by step. The prevalent approach to training such a model is to update all the model parameters using all the examples in the training data (over multiple epochs). This is a reasonable approach, under the assumption that we are modeling a single underly- ing distribution in the data. However, in many ap- plications and for many natural language datasets, there exist multiple underlying distributions, char- acterizing a variety of language styles. For in- stance, the widely-used Gigaword dataset (Graff and Cieri, 2003) consists of a collection of arti- cles written by various publishers (The New York Times, Agence France Presse, Xinhua News, etc.), each with its own style characteristics. Training a model's parameters on all the training examples results in an averaging effect across style charac- teristics, which may lower the quality of the out- puts; additionally, this averaging effect may be completely undesirable for applications that re- quire a level of control over the output style. At the opposite end of the spectrum, one can choose to train one independent model per each underly- ing distribution (assuming we have the appropri- ate signals for identifying them at training time). This approach misses the opportunity to exploit common properties shared by these distributions (e.g., generic characteristics of a language, such as noun-adjective position), and leads to models that are under-trained due to limited data availability per distribution. In order to address these issues, we propose a novel neural architecture called SHAPED (shared- private encoder-decoder). This architecture has both shared encoder/decoder parameters that are updated based on all the training examples, as well as private encoder/decoder parameters that are up- dated using only examples from their correspond- ing underlying training distributions. In addition to learning different parametrization between the shared model and the private models, we jointly learn a classifier to estimate the probability of each example belonging to each of the underlying train- ing distributions. In such a setting, the shared parameters ('shared model') are expected to learn characteristics shared by the entire set of training examples (i.e., language generic), whereas each private parameter set ('private model') learns par- ticular characteristics (i.e., style specific) of their corresponding training distribution. At the same time, the classifier is expected to learn a probabil- ity distribution over the labels used to identify the underlying distributions present in the input data. At test time, there are two possible scenarios. In the first one, the input signal explicitly contains in- formation about the underlying distribution (e.g., the publisher's identity). In this case, we feed the data into the shared model and also the cor- responding private model, and perform sequence generation based on a concatenation of their vec- tor outputs; we refer to this model as the SHAPED model. In a second scenario, the information about the underlying distribution is either not available, or it refers to a distribution that was not seen dur- ing training. In this case, we feed the data into the shared model and all the private models; the output distribution of the symbols of the decoding sequence is estimated using a mixture of distribu- tions from all the decoders, weighted according to the classifier's estimates for that particular exam- ple; we refer to this model as the Mix-SHAPED model. We test our models on the headline-generation task based on the aforementioned Gigaword dataset. When the publisher's identity is presented as part of the input, we show that the SHAPED model significantly surpasses the performance of the shared encoder-decoder baseline, as well as the performance of private models (where one in- dividual, per-publisher model is trained for each in-domain style). When the publisher's identity is not presented as part of the input (i.e., not pre- sented at run-time but revealed at evaluation-time for measurement purposes), we show that the Mix- SHAPED model exhibits a high level of classifi- cation accuracy based on textual inputs alone (ac- curacy percentage in the 80s overall, varying by individual publisher), while its generation accu- racy still surpasses the performance of the base- line models. Finally, when the publisher's identity is unknown to the model (i.e., a publisher that was not part of the training dataset), we show that the Mix-SHAPED model performance far surpasses the shared model performance, due to the ability of the Mix-SHAPED model to perform on-the-fly adaptation of output style. This feat comes from our model's ability to perform two distinct tasks: match the incoming, previously-unseen input style to existing styles learned at training time, and use the correlations learned at training time between input and output style characteristics to generate style-appropriate token sequences. 2 Related Work Encoder-Decoder Models for Structured Output Prediction Encoder-decoder architectures have been success- fully applied to a variety of structure prediction tasks recently. Tasks for which such architec- tures have achieved state-of-the-art results include machine translation (Bahdanau et al., 2015; Wu et al., 2016; Vaswani et al., 2017), automatic text summarization (Rush et al., 2015; Chopra et al., 2016; Nallapati et al., 2016; Paulus et al., 2017; Nema et al., 2017), sentence simplification (Filip- pova et al., 2015; Zhang and Lapata, 2017), dia- log systems (Li et al., 2016, 2017; Asghar et al., 2017), image captioning (Vinyals et al., 2015; Xu et al., 2015; Ranzato et al., 2015; Liu et al., 2017), etc. By far the most used implementation of such architectures is based on the original sequence- to-sequence model (Sutskever et al., 2014), aug- mented with its attention-based extension (Bah- danau et al., 2015). Although our SHAPED and Mix-SHAPED model formulations do not depend on a particular architecture implementation, we do make use of the (Bahdanau et al., 2015) model to instantiate our models. Domain Adaptation for Neural Network Models One general approach to domain adaptation for natural language tasks is to perform data/feature augmentation that represents inputs as both gen- eral and domain-dependent data, as originally pro- posed in (Daum´e III, 2009), and ported to neural models in (Kim et al., 2016). For computer vision tasks, a line of work related to our approach has been proposed by Bousmalis et al. (2016) using what they call domain separation networks. As a tool for studying unsupervised domain adaptation for image recognition tasks, their proposal uses CNNs for encoding an image into a feature rep- resentation, and also for reconstructing the input sample. It also makes use of a private encoder for each domain, and a shared encoder for both the source and the target domain. The approach we take in this paper shares this idea of model parametrization according to the domain/style, but goes further with the Mix-SHAPED model, per- forming on-the-fly adaptation of the model out- puts. Other CNN-based domain adaptation meth- ods for object recognition tasks are presented in (Long et al., 2016; Chopra et al., 2013; Tzeng et al., 2015; Sener et al., 2016). For NLP tasks, Peng and Dredze (2017) take a multi-task approach to domain adaptation and se- quence tagging. They use a shared encoder to rep- resent instances from all of the domains, and use a domain projection layer to project the shared layer into a domain-specific space. They only consider the supervised domain-adaptation case, in which labeled training data exists for the target domain. Glorot et al. (2011) use auto-encoders for learn- ing a high-level feature extraction across domains for sentiment analysis, while Zhou et al. (2016) employ auto-encoders to directly transfer the ex- amples across different domains also for the same sentiment analysis task. Hua and Wang (2017) perform an experimental analysis on domain adap- tation for neural abstractive summarization. An important requirement of all the methods in the related work described above is that they re- quire access to the (unlabeled) target domain data, in order to learn a domain-invariant representa- tion across source and target domains. In contrast, our Mix-SHAPED model does not need access to a target domain or style at training time, and in- stead performs the adaptation on-the-fly, accord- ing to the specifics of the input data and the corre- lations learned at training time between available input and output style characteristics. As such, it is a more general approach, which allows adapta- tion for a much larger set of target styles, under the weaker assumption that there exists one or more styles present in the training data that can act as representative underlying distributions. 3 Model Architecture Generally speaking, a standard encoder-decoder model has two components: an encoder that takes as input a sequence of symbols x = (x1, x2, ..., xTx) and encodes them into a set of vectors H = (h1, h2, ..., hTx), H = fenc(x), (1) where fenc is the computation unit in the encoder; and, a decoder that generates output symbols at each time stamp t, conditioned on H as well as the decoder inputs y1:t−1, st = fdec(y1:t−1, H), (2) Instantiations of where fdec is the computation unit in the de- coder. this framework in- clude the widely-used attention-based sequence- to-sequence model (Bahdanau et al., 2015), in which fenc and fdec are implemented by an RNN architecture using LSTM (Hochreiter and Schmid- huber, 1997) or GRU (Chung et al., 2014) units. A more recent instantiation of this architecture is the Transformer model (Vaswani et al., 2017), built using self-attention layers. 3.1 SHAPED: Shared-private encoder-decoder The abstract encoder-decoder model described above is usually trained over all examples in the training data. We call such a model a shared encoder-decoder model, because the model pa- rameters are shared across all training and test instances. Formally, the shared encoder-decoder consists of the computation units f s dec. Given an instance x, it generates a sequence of vectors Ss = (ss enc and f s 1, ...ss Hs = f s enc(x), ss dec(y1:t−1, Hs). (3) T ) by: t = f s The drawback of the shared encoder-decoder is that it fails to account for particular properties of each style that may be present in the data. In order to capture such particular style characteris- tics, a straightforward solution is to train a pri- vate model for each style. Assuming a style set D = {D1, D2..., DD}, such a solution implies that each style has its own private encoder com- putation unit and decoder computation unit. At both training and testing time, each private en- coder and decoder only process instances that be- long to their own style. Given an instance along with its style (x, z) where z ∈ {1, . . . ,D}, the private encoder-decoder generates a sequence of vectors Sz = (sz 1, ...sz Hz = f z enc(x), sz dec(y1:t−1, Hz). (4) T ) by: t = f z article x(i) and its style z(i) ∈ {1, . . . ,D} is: p(y(i)x(i), z(i)) = x(i), y(i) p(ot = y(i) t (cid:89) 1:t−1, z(i)). t (7) At inference time, given an article x with style z, we feed x into f s dec (Eq. 3-4) and obtain symbol distributions at each step t using Eq. 6. We sample from the distribution and obtain a symbol ot which will be used as the estimated yt and fed to the next steps. dec, f z enc, f z enc, f s 3.2 The Mix-SHAPED Model One limitation of the above model is that it can only handle test data containing an explicit style label from D = {D1, D2..., DD}. However, there is frequently the case that, at test time, the style label is not present as part of the input, or that the input style is not part of the modeled set D. We treat both of these cases similarly, as a case of modeling an unknown style. We first describe our treatment of such a case at run-time. We use a latent random variable z ∈ {1, . . . ,D} to de- note the underlying style of a given input. When generating a token at step t, the output token dis- tribution takes the form of a mixture of SHAPED (Mix-SHAPED) model outputs: p(otx, y1:t−1) = p(otx, y1:t−1, z = d)p(z = dx), (8) D(cid:88) d=1 where p(otx, y1:t−1, z = d) is the output symbol distribution of SHAPED decoder d, evaluated as in Eq. 6. Fig. 2 contains an illustration of such a model. In this formulation, p(zx) denotes the style conditional probability distribution from a trainable style classifier. The joint data likelihood of target sequence y and target domain label z for input sequence x is: p(y, zx) = p(yz, x) · p(zx) (9) Training the Mix-SHAPED model involves mini- mizing a loss function that combines the negative log-likelihood of the style labels and the negative log-likelihood of the symbol sequences (see the model in Fig 3): LossMix-SHAPED = − N(cid:88) log p(z(i)x(i)) i=1 log p(y(i)x(i), z(i)). (10) − N(cid:88) i=1 Figure 1: Illustration of the SHAPED model using two styles D1 and D2. D1 articles pass through the private encoder f 1 enc and decoder f 1 dec. D2 articles pass through the private encoder f 2 enc and decoder dec. Both of them also go through the shared en- f 2 coder f s dec and decoder f s dec. Although the private encoder/decoder models do preserve style characteristics, they fail to take into account the common language features shared across styles. Furthermore, since each style is rep- resented by a subset of the entire training set, such private models may end up as under-trained, due to limited number of available data examples. In order to efficiently capture both common and unique features of data with different styles, we propose the SHAPED model. In the SHAPED model, each data-point goes through both the shared encoder-decoder and its corresponding pri- vate encoder-decoder. At each step of the decoder, the output from private and shared ones are con- catenated to form a new vector: srz t = [sz t , ss t ], (5) that contains both private features for style z and shared features induced from other styles, as il- lustrated in Fig 1. The output symbol distribution over tokens ot ∈ V (where V is the output vocab- ulary) at step t is given by: p(otx, y1:t−1, z) = Softmax(g(srz t )), (6) is that maps g V . a multi-layer to feed-forward where vector of network examples size (x(1), y(1), z(1)), . . . , (x(N ), y(N ), z(N )), the conditional probability of the output y(i) given Given N training srz t a D1 D2 Figure 2: Decoding data with unknown style using a Mix-SHAPED model. The data is run through all encoders and decoders. The output of private encoders is fed into a classifier that estimates style distribution. The output symbol distribution is a mixture over all decoder outputs. At run-time, if the style d of the input is available and d ∈ D, we decode the sequence using Eq. 6. This also corresponds to the case p(z = dx) = 1 and 0 for all other styles, and reduces Eq. 8 to If the style of the input is unknown (or Eq. 6. (cid:54)∈ D), we decode the se- known, but with d(cid:48) quence using Eq. 8, in which case the mixture over SHAPED models given by p(zx) is approximat- ing the desired output style. The input from (Bahdanau et 4 Model Instantiation As an implementation of the encoder-decoder model, we use the attention-based sequence- to-sequence model al., 2015), with an RNN architecture using GRU units (Chung et al., 2014). token sequences are first projected into an embedding space via an embedding matrix E, resulting in a sequence of vectors as input representations. The private and shared RNN cells generate a sequence of hidden state vectors Hz = {hz j}, z ∈ {1, ...,D} and Hs = {hs j}, for j ∈ {1, ..., Tx}. At each step in the encoder, hz j and j are concatenated to form a new output vector hs hrz j]. The final state of each encoder j = [hz is used as the initial state of the corresponding de- coder. At time step t in the decoder, the private and shared RNN cell first generate hidden state vec- tors {sz t is con- t to form new vectors {srz t } catenated with each sz (z ∈ {1, ...,D}). t}, z ∈ {1, ...,D} and ss t , then ss j , hs We apply the attention mechanism on srz t , using Figure 3: Training a Mix-SHAPED model. (a) Each example is fed to all private encoders enc, whose outputs are concatenated and fed f 1 enc, f 2 to a style classifier. (b) The D1 examples only dec to decode texts. Private use f 1 encoder-decoders of other styles are not used. dec, f s enc, f 1 enc, f s attention weights calculated as: tj = vatanh(Wahrz qrz j + Uasrz t ), (11) which are normalized to a probability distribution: αrz tj = exp(qrz tj ) i=1 exp(qrz ti ) (12) (cid:80)Tx Tx(cid:88) Context vectors are computed using normalized attention weights: crz t = αrz tj hrz j (13) j=1 Given the context vector and the hidden state vec- tors, the symbol distribution at step t is: p(otx, y1:t, z) = softmax(g([crz t , srz t ])) (14) The attention weights in Wa, Ua, and va, as well as the embedding matrix E and vocabulary V are shared by all encoders and decoders. We use Eq. 14 to calculate the symbol loss in Eq. 10. D? Style Classifier g g Style ClassifierCATSOFTMAX D1 D2D1 Style Classifier 5 Quantitative Experiments We perform a battery of quantitative experiments, designed to answer several main questions: 1) Do the proposed model improve generation perfor- mance over alternative approaches? 2) Can a style classifier built using an auxiliary loss provide a re- liable estimate on text style? 3) In the case of un- known style, does the Mix-SHAPED model im- prove generation performance over alternative ap- proaches? 4) To what extent do our models cap- ture style characteristics as opposed to, say, con- tent characteristics? We perform our experiments using text sum- marization as the main task. More precisely, we train and evaluate headline generation models us- ing the publicly-available Gigaword dataset (Graff and Cieri, 2003; Napoles et al., 2012). 5.1 Headline-generation Setup The Gigaword dataset contains news articles from seven publishers: Agence France-Presse (AFP), Associated Press Worldstream (APW), Central News Agency of Taiwan (CNA), Los Ange- les Times/Washington Post Newswire Service (LTW), New York Times (NYT), Xinhua News Agency (XIN), and Washington Post/Bloomberg Newswire Service (WPB). We pre-process this dataset in the same way as in (Rush et al., 2015), which results in articles with average length 31.4 words, and headlines with average length 8.5 words. We consider the publisher identity as a proxy for style, and choose to model as in-domain styles the set D = {AFP, APW, NYT, XIN}, while hold- ing out CNA and LTW for out-of-domain style testing. This results in a training set contain- ing the following number of (article, headline) in- stances: 993,584 AFP, 1,493,758 APW, 578,259 NYT, and 946,322 XIN. For the test set, we sam- ple a total number of 10,000 in-domain examples from the original Gigawords test dataset, which include 2,886 AFP, 2,832 APW, 1,610 NYT, and 2,012 XIN. For out-of-domain testing, we ran- domly sample 10,000 LTW and 10,000 CNA test data examples. We remove the WPB articles due to their small number of instances. 5.1.1 Experimental Setup We compare the following models: • A suite of Private encoder-decoder models (P), each one trained on a particular style from D = {AFP, APW, NYT, XIN};1 • A SHAPED model (SP) trained on all styles in D; at test time, the style of test data is provided to the model; the article is only run through its style-specific private network and shared network (style classifier is not needed); • A Mix-SHAPED model (M-SP) trained on all styles in D; at test time, the style of arti- cle is not provided to the model; the output is computed using the mixture model, with the estimated style probabilities from the style classifier used as weights. When testing on the out-of-domain styles CNA/LTW, we only compare the Shared (S) model with the Mix-SHAPED (M-SP) model, as the others cannot properly handle this scenario. As hyper-parameters for the model instantia- tion, we used 500-dimension word embeddings, and a three-layer, 500-dimension GRU-cell RNN architecture; the encoder was instantiated as a bi- directional RNN. The lengths of the input and out- put sequences were truncated to 40 and 20 tokens, respectively. All the models were optimized using Adagrad (Duchi et al., 2011), with an initial learn- ing rate of 0.01. The training procedure was done over mini-batches of size 128, and the updates were done asynchronously across 40 workers for 5M steps. The encoder/decoder word embedding and the output projection matrices were tied to minimize the number of parameters. To avoid the slowness from the softmax operator over large vo- cabulary sizes, and also mitigate the impact of out- of-vocabulary tokens, we applied a subtokeniza- tion method (Wu et al., 2016), which invertibly transforms a native token into a sequence of subto- kens from a limited vocabulary (here set to 32K). Comparison with Previous Work In the next section, we report our main results using the in- domain and out-of-domain (w.r.t. the selected publisher styles) test sets described above, since these test sets have a balanced publisher style fre- quency that allows us to measure the impact of our style-adaptation models. However, we also report • A Shared encoder-decoder model (S) trained on all styles in D; 1We also tried to warm-start a private model using the best checkpoint of the shared model, but found that it cannot im- prove over the shared model. AFP/APW/XIN/NYT Test Rouge-L 36.42±0.46 36.51±0.26 37.52±0.25 37.30±0.26 Rouge-1 39.14±0.47 39.32±0.26 40.34±0.26 40.10±0.25 Rouge-2 19.74±0.48 19.63±0.24 20.38±0.25 20.21±0.26 P S SP M-SP Table 1: ROUGE F1 scores on the combined AFP/APW/XIN/NYT in-domain test set. here the performance of our Shared (S) baseline model (with the above hyper-parameters) on the original 2K test set used in (Rush et al., 2015). On that test set, our S model obtains 30.13 F1 ROUGE-L score, compared to 28.34 ROUGE-L obtained by the ABS+ model (Rush et al., 2015), and 30.64 ROUGE-L obtained by the words-lvt2k- 1sent model (Nallapati et al., 2016). This compar- ison indicates that our S model is a competitive baseline, making the comparisons against the SP and M-SP models meaningful when using our in- domain and out-of-domain test sets. 5.1.2 Main Results The Rouge scores for the in-domain testing data are reported in Table 1 (over the combined AFP/APW/XIN/NYT testset) and Fig. 4a (over individual-style test sets). The numbers indicate that the SP and M-SP models consistently outper- form the S and P model, supporting the conclusion that the S model loses important characteristics due to averaging effects, while the P models miss the opportunity to efficiently exploit the training data. Additionally, the performance of SP is con- sistently better than M-SP in this setting, which in- dicates that the style label is helpful. As shown in Fig. 4b, the style classifier achieves around 80% accuracy overall in predicting the style under the M-SP model, with some styles (e.g., XIN) being easier to predict than others. The performance of the classifier is directly reflected in the quantita- tive difference between the SP and M-SP models on individual-style test sets (see Fig. 4a, where the XIN style has the smallest difference between the two models). The evaluation results for the out-of-domain scenario are reported in Table 2. The numbers in- dicate that the M-SP model significantly outper- forms the S model, supporting the conclusion that the M-SP model is capable of performing on-the- fly adaptation of output style. This conclusion is further strengthened by the style probability dis- tributions shown in Fig 5: they indicate that, for (a) Rouge-L scores on headline generation, shown sepa- rately on four in-domain styles. (b) Average estimated probability distribution by the M- SP model over the four styles, for each in-domain target style in the test set. Figure 4: Experimental results on the headline gen- eration task, for in-domain styles. the out-of-domain CNA style, the output mixture is heavily weighted towards the XIN style (0.6 of the probability mass), while for the LTW style, the output mixture weights heavily the NYT style (0.72 of the probability mass). This result is likely to reflect true style characteristics shared by these publishers, since both CNA and XIN are produced by Chinese news agencies (from Taiwan and main- land China, respectively), while both LTW and NYT are U.S. news agencies owned by the same media corporation. 5.1.3 Experiment Variants Model capacity In order to remove the possibil- ity that the improved performance of the SP model is due simply to an increased model size com- pared to the S model, we perform an experiment in which we triple the size of the GRU cell dimen- sions for the S model. However, we find no sig- nificant performance difference compared to the PSSPM-SP16.416.616.817.017.217.4ROUGE-L (%)NYTPSSPM-SP39.439.639.840.040.240.440.6AFPPSSPM-SP33.033.233.433.633.834.034.234.4APWPSSPM-SP51.552.052.553.053.5XINNYTAFPAPWXIN0.00.10.20.30.40.50.60.70.8NYTNYTAFPAPWXIN0.00.10.20.30.40.50.60.70.8AFPNYTAFPAPWXIN0.00.10.20.30.40.50.60.70.8APWNYTAFPAPWXIN0.00.10.20.30.40.50.60.70.80.9XIN Rouge-1 40.73±0.21 M-SP 42.00±0.20 S CNA Test Rouge-2 17.75±0.18 19.48±0.21 Rouge-L 37.70±0.20 39.24±0.22 Rouge-1 27.08±0.19 27.79±0.19 LTW Test Rouge-2 Rouge-L 25.01±0.17 8.97±0.15 9.31±0.18 25.60±0.17 Table 2: ROUGE F1 scores on out-of-domain style test sets CNA and LTW. multiple models rather than style adaptation. To answer this question, we apply a uniform mix- ture over the private model output along with the shared model output, rather than using the learnt probability distribution from the style classi- fier. The ROUGE-1/2/L scores are 39.9/19.7/37.0. They are higher than the S model but significantly lower than the SP model and the M-SP model (p- value 0.016). This result confirms that the infor- mation that the style classifier encodes is benefi- ciary, and leads to improved performance. Style vs. Content Previous experiments indi- cate that the SP and M-SP models have superior generation accuracy, but it is unclear to what ex- tent the difference comes from improved modeling of style versus modeling of content. To clarify this issue, we performed an experiment in which we replace the named entities appearing in both arti- cle and headline with corresponding entity tags, in effect suppressing almost completely any content signal. For instance, given an input such as "China called Thursday on the parties involved in talks on North Korea's nuclear program to show flexibil- ity as a deadline for implementing the first steps of a breakthrough deal approached.", paired with goldtruth output "China urges flexibility as NKo- rea deadline approaches", we replaced the named entities with their types, and obtained: "LOC 0 called Thursday on the ORG 0 involved in NON 2 on LOC 1 's NON 3 to show NON 0 as a NON 1 for implementing the first NON 4 of a NON 5 ap- proached .", paired with "LOC 0 urges NON 0 as LOC 1 NON 1 approaches." Under this experimental conditions, both the SP and M-SP models still achieve significantly better performance compared to the S baseline. On the combined AFP/APW/XIN/NYT in-domain test set, the SP model achieves 61.70 ROUGE-L and M-SP achieves 61.52 ROUGE-L, compared to 60.20 ROUGE-L obtained by the S model. On the CNA/LTW out-of-domain test set, M-SP achieves 60.75 ROUGE-L, compared to 59.47 ROUGE-L by the S model. In Table 3, we show an example which indi- Figure 5: Estimated style probabilities over the four in-domain styles AFP/APW/XIN/NYT, for out-of-domain styles CNA and LTW. original dimensions (the ROUGE-L score of the triple-size S model is 36.61, compared to 36.51 obtained of the original S model). Style embedding A competitive approach to modeling different styles is to directly encode the style information into the embedding space. In (Johnson et al., 2016), the style label is con- verted into a one-hot vector and is concatenated with the word embedding at each time step in the S model. The outputs of this model are at 36.68 ROUGE-L, slightly higher than the baseline S model, but significantly lower than the SP model performance (37.52 ROUGE-L). Another style embedding approach is to aug- ment the S model with continuous trainable style embeddings for each predefined style label, sim- ilar to (Ammar et al., 2016). The resulting out- puts achieve 37.2 ROUGE-L, which is better than the S model with one-hot style embedding, but still worse than the SP method (statistically signif- icant at p-value=0.025 using paired t-test). How- ever, neither of these approaches apply to the cases when the style is out-of-domain or unknown dur- ing testing. In contrast, such cases are handled nat- urally by the proposed M-SP model. Ensemble model Another question is whether the SP model simply benefits from ensembling NYTAFPAPWXIN0.00.10.20.30.40.50.60.7CNANYTAFPAPWXIN0.00.10.20.30.40.50.60.70.8LTW article title output by S the org 2 is to forge non 1 with the org 3 located in loc 2 , loc 1 , the per 0 of the loc 0 org 4 said tuesday . loc 0 org 0 to forge non 0 with loc 1 org 1 org 0 to org 1 in non 0 output by M-SP loc 0 org 0 to forge non 0 with loc 1 org 1 article title output by S loc 0 - born per 0 per 0 will pay non 1 here next month to per 1 , the org 2 ( org 1 ) per 1 who per 1 perished in an non 2 in february , the org 3 said thursday . per 0 to pay non 0 to late org 1 org 0 per 0 to visit org 0 in non 0 output by M-SP per 0 to pay non 0 to org 1 org 0 Table 3: Examples of input article (and groundtruth title) and output generated by S and M-SP. Named entities in the training instances (both article and title) are replaced the entity type. cates the ability of style adaptation benifiting sum- marization. For instance, we find that both CNA and XIN make more frequent use of the style pat- tern "xxx will/to [verb] yyy . . ., zzz said ???day" (about 15% of CNA articles contain this pattern, while only 2% of LTW articles have it). From Table 3, we can see that the S model sometimes misses or misuses the verb in its output, while the M-SP model does a much better job at capturing both the verb/action as well as other relations (via prepositions, etc.) Fig. 6 shows the estimated style probabili- ties over the four styles AFP/APW/XIN/NYT for CNA and LTW, under this experiment condition. We observe that, in this version as well, CNA is closely matching the style of XIN, while LTW is matching that of NYT. The distribution is similar to the one in Fig. 5, albeit a bit flatter as a result of content removal. As such, it supports the con- clusion that the classifier indeed learns style (in addition to content) characteristics. 6 Conclusion In this paper, we describe two new style- adaptation model architectures for text sequence generation tasks, SHAPED and Mix-SHAPED. Both versions are shown to significantly outper- form models that are either trained in a manner that ignores style characteristics (and hence ex- hibit a style-averaging effect in their outputs), or models that are trained single-style. The latter is a particularly interesting result, as a model that is trained (with enough data) on a single-style and evaluated on the same style would be expected to exhibit the highest performance. Our results show that, even for single-style models Figure 6: Estimated style probabilities over the four in-domain styles AFP/APW/XIN/NYT, for out-of-domain styles CNA and LTW, after named entities in the article and summary are replaced with entity tags. trained on over 1M examples, their performance is inferior to the performance of SHAPED models on that particular style. Our conclusion is that the proposed architec- tures are both efficient and effective in modeling both generic language phenomena, as well as par- ticular style characteristics, and are capable of pro- ducing higher-quality abstractive outputs that take into account style characteristics. NYTAFPAPWXIN0.00.10.20.30.40.5CNANYTAFPAPWXIN0.00.10.20.30.40.5LTW References Waleed Ammar, George Mulcaire, Miguel Ballesteros, Chris Dyer, and Noah A. Smith. 2016. Many lan- guages, one parser. TACL 4:431–444. Nabiha Asghar, Pascal Poupart, Xin Jiang, and Hang Li. 2017. Deep active learning for dialogue genera- tion. In Proceedings of the 6th Joint Conference on Lexical and Computational Semantics (*SEM 2017). pages 78–83. D. Bahdanau, K. Cho, and Y. Bengio. 2015. Neural machine translation by jointly learning to align and translate. In Proceedings of ICLR. Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. 2016. Domain separation networks. In Advances in Neural Information Processing Systems. pages 343– 351. Sumit Chopra, Michael Auli, Alexander M Rush, and SEAS Harvard. 2016. Abstractive sentence summa- rization with attentive recurrent neural networks. In HLT-NAACL. pages 93–98. Sumit Chopra, Suhrid Balakrishnan, and Raghuraman Gopalan. 2013. Dlid: Deep learning for domain adaptation by interpolating between domains. In ICML workshop on challenges in representation learning. volume 2. Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence model- ing. arXiv preprint arXiv:1412.3555 . Hal Daum´e III. 2009. Frustratingly easy domain adap- tation. arXiv preprint arXiv:0907.1815 . Xinyu Hua and Lu Wang. 2017. A pilot study of do- main adaptation effect for neural abstractive summa- rization. arXiv preprint arXiv:1707.07062 . Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Tho- rat, Fernanda B. Vi´egas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2016. Google's multilingual neural machine translation CoRR system: Enabling zero-shot abs/1611.04558. http://arxiv.org/abs/ 1611.04558. translation. Young-Bum Kim, Karl Stratos, and Ruhi Sarikaya. 2016. Frustratingly easy neural domain adaptation. In Proceedings of the 26th International Conference on Computational Linguistics (COLING). Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. 2016. Deep rein- forcement learning for dialogue generation. arXiv preprint arXiv:1606.01541 . Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, learning arXiv preprint and Dan Jurafsky. 2017. for neural dialogue generation. arXiv:1701.06547 . Adversarial Siqi Liu, Zhenhai Zhu, Ning Ye, Sergio Guadarrama, and Kevin Murphy. 2017. Optimization of im- age description metrics using policy gradient meth- ods. In International Conference on Computer Vi- sion (ICCV). Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. 2016. Unsupervised domain In Ad- adaptation with residual transfer networks. vances in Neural Information Processing Systems. pages 136–144. John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive subgradient methods for online learning Journal of Machine and stochastic optimization. Learning Research 12(Jul):2121–2159. Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. 2016. Abstractive text summa- rization using sequence-to-sequence RNNs and be- yond. In Proceedings of CoNLL. Katja Filippova, Enrique Alfonseca, Carlos Col- menares, Lukasz Kaiser, and Oriol Vinyals. 2015. Sentence compression by deletion with lstms. In Proceedings of the 2015 Conference on Empir- ical Methods in Natural Language Processing (EMNLP'15). Courtney Napoles, Matthew Gormley, and Benjamin In Pro- Van Durme. 2012. Annotated gigaword. ceedings of the Joint Workshop on Automatic Knowl- edge Base Construction and Web-scale Knowledge Extraction. Association for Computational Linguis- tics, pages 95–100. Xavier Glorot, Antoine Bordes, and Yoshua Bengio. 2011. Domain adaptation for large-scale sentiment In Pro- classification: A deep learning approach. ceedings of the 28th international conference on ma- chine learning (ICML-11). pages 513–520. David Graff and C Cieri. 2003. English gigaword cor- pus. Linguistic Data Consortium . Preksha Nema, Mitesh Khapra, Anirban Laha, and Balaraman Ravindran. 2017. Diversity driven atten- tion model for query-based abstractive summariza- tion. arXiv preprint arXiv:1704.08300 . Romain Paulus, Caiming Xiong, and Richard Socher. 2017. A deep reinforced model for abstractive sum- marization. arXiv preprint arXiv:1705.04304 . Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural computation Long short-term memory. 9(8):1735–1780. Nanyun Peng and Mark Dredze. 2017. Multi-task do- main adaptation for sequence tagging. ACL 2017 page 91. Xingxing Zhang and Mirella Lapata. 2017. Sen- tence simplification with deep reinforcement learn- ing. arXiv preprint arXiv:1703.10931 . Guangyou Zhou, Zhiwen Xie, Jimmy Xiangji Huang, and Tingting He. 2016. Bi-transferring deep neural networks for domain adaptation. In ACL (1). Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. 2015. Sequence level training with recurrent neural networks. CoRR abs/1511.06732. Alexander M. Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sen- In Proceedings of EMNLP. tence summarization. pages 379–389. Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer- generator networks. In Proceedings of ACL. Ozan Sener, Hyun Oh Song, Ashutosh Saxena, and Sil- vio Savarese. 2016. Learning transferrable represen- tations for unsupervised domain adaptation. In Ad- vances in Neural Information Processing Systems. pages 2110–2118. Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural net- works. In Advances in neural information process- ing systems. pages 3104–3112. Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. 2015. Simultaneous deep transfer across domains and tasks. In Proceedings of the IEEE In- ternational Conference on Computer Vision. pages 4068–4076. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Pro- cessing Systems. Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. 2015. Show and tell: A neural im- age caption generator. In Proceedings of the IEEE conference on computer vision and pattern recogni- tion. pages 3156–3164. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, ukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Ja- son Riesa, Alex Rudnick, Oriol Vinyals, Greg Cor- rado, Macduff Hughes, and Jeffrey Dean. 2016. Google's neural machine translation system: Bridg- ing the gap between human and machine transla- tion. CoRR abs/1609.08144. http://arxiv. org/abs/1609.08144. Kelvin Xu, Jimmy Ba, Ryan Kiros, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. 2015. Show, attend and tell: Neural image In Proc. caption generation with visual attention. of the 32nd International Conference on Machine Learning (ICML).
1908.07397
2
1908
2019-08-27T08:36:53
Deep Contextualized Word Embeddings in Transition-Based and Graph-Based Dependency Parsing -- A Tale of Two Parsers Revisited
[ "cs.CL" ]
Transition-based and graph-based dependency parsers have previously been shown to have complementary strengths and weaknesses: transition-based parsers exploit rich structural features but suffer from error propagation, while graph-based parsers benefit from global optimization but have restricted feature scope. In this paper, we show that, even though some details of the picture have changed after the switch to neural networks and continuous representations, the basic trade-off between rich features and global optimization remains essentially the same. Moreover, we show that deep contextualized word embeddings, which allow parsers to pack information about global sentence structure into local feature representations, benefit transition-based parsers more than graph-based parsers, making the two approaches virtually equivalent in terms of both accuracy and error profile. We argue that the reason is that these representations help prevent search errors and thereby allow transition-based parsers to better exploit their inherent strength of making accurate local decisions. We support this explanation by an error analysis of parsing experiments on 13 languages.
cs.CL
cs
Deep Contextualized Word Embeddings in Transition-Based and Graph-Based Dependency Parsing -- A Tale of Two Parsers Revisited∗ Artur Kulmizev Miryam de Lhoneux Johannes Gontrum Elena Fano Joakim Nivre Department of Linguistics and Philology, Uppsala University {artur.kulmizev,miryam.de lhoneux,joakim.nivre}@lingfil.uu.se {johannes.gontrum.4608,elena.fano.3249}@student.uu.se 9 1 0 2 g u A 7 2 ] L C . s c [ 2 v 7 9 3 7 0 . 8 0 9 1 : v i X r a Abstract Transition-based and graph-based dependency parsers have previously been shown to have complementary strengths and weaknesses: transition-based parsers exploit rich structural features but suffer from error propagation, while graph-based parsers benefit from global optimization but have restricted feature scope. In this paper, we show that, even though some details of the picture have changed after the switch to neural networks and continuous rep- resentations, the basic trade-off between rich features and global optimization remains es- sentially the same. Moreover, we show that deep contextualized word embeddings, which allow parsers to pack information about global sentence structure into local feature represen- tations, benefit transition-based parsers more than graph-based parsers, making the two ap- proaches virtually equivalent in terms of both accuracy and error profile. We argue that the reason is that these representations help pre- vent search errors and thereby allow transition- based parsers to better exploit their inherent strength of making accurate local decisions. We support this explanation by an error analy- sis of parsing experiments on 13 languages. 1 Introduction For more than a decade, research on data-driven dependency parsing has been dominated by two approaches: transition-based parsing and graph- based parsing (McDonald and Nivre, 2007, 2011). Transition-based parsing reduces the parsing task to scoring single parse actions and is often com- bined with local optimization and greedy search algorithms. Graph-based parsing decomposes parse trees into subgraphs and relies on global op- timization and exhaustive (or at least non-greedy) ∗We gratefully acknowledge the inspiration for our sub- title in the seminal paper by Zhang and Clark (2008). search to find the best tree. These radically differ- ent approaches often lead to comparable parsing accuracy, but with distinct error profiles indicative of their respective strengths and weaknesses, as shown by McDonald and Nivre (2007, 2011). In recent years, dependency parsing, like most of NLP, has shifted from linear models and dis- crete features to neural networks and continu- ous representations. This has led to substantial accuracy improvements for both transition-based and graph-based parsers and raises the question whether their complementary strengths and weak- nesses are still relevant. In this paper, we repli- cate the analysis of McDonald and Nivre (2007, 2011) for neural parsers. In addition, we investi- gate the impact of deep contextualized word repre- sentations (Peters et al., 2018; Devlin et al., 2019) for both types of parsers. Based on what we know about the strengths and weaknesses of the two approaches, we hypothe- size that deep contextualized word representations will benefit transition-based parsing more than graph-based parsing. The reason is that these rep- resentations make information about global sen- tence structure available locally, thereby helping to prevent search errors in greedy transition-based parsing. The hypothesis is corroborated in ex- periments on 13 languages, and the error analysis supports our suggested explanation. We also find that deep contextualized word representations im- prove parsing accuracy for longer sentences, both for transition-based and graph-based parsers. 2 Two Models of Dependency Parsing After playing a marginal role in NLP for many years, dependency-based approaches to syntactic parsing have become mainstream during the last fifteen years. This is especially true if we consider languages other than English, ever since the influ- ential CoNLL shared tasks on dependency pars- ing in 2006 (Buchholz and Marsi, 2006) and 2007 (Nivre et al., 2007) with data from 19 languages. The transition-based approach to dependency parsing was pioneered by Yamada and Matsumoto (2003) and Nivre (2003), with inspiration from history-based parsing (Black et al., 1992) and data-driven shift-reduce parsing (Veenstra and Daelemans, 2000). The idea is to reduce the com- plex parsing task to the simpler task of predicting the next parsing action and to implement parsing as greedy search for the optimal sequence of ac- tions, guided by a simple classifier trained on local parser configurations. This produces parsers that are very efficient, often with linear time complex- ity, and which can benefit from rich non-local fea- tures defined over parser configurations but which may suffer from compounding search errors. The graph-based approach to dependency pars- ing was developed by McDonald et al. (2005a,b), building on earlier work by Eisner (1996). The idea is to score dependency trees by a linear com- bination of scores of local subgraphs, often single arcs, and to implement parsing as exact search for the highest scoring tree under a globally optimized model. These parsers do not suffer from search er- rors but parsing algorithms are more complex and restrict the scope of features to local subgraphs. The terms transition-based and graph-based were coined by McDonald and Nivre (2007, 2011), who performed a contrastive error anal- ysis of the two top-performing systems in the CoNLL 2006 shared task on multilingual depen- dency parsing: MaltParser (Nivre et al., 2006) and MSTParser (McDonald et al., 2006), which rep- resented the state of the art in transition-based and graph-based parsing, respectively, at the time. Their analysis shows that, despite having almost exactly the same parsing accuracy when averaged over 13 languages, the two parsers have very dis- tinctive error profiles. MaltParser is more accu- rate on short sentences, on short dependencies, on dependencies near the leaves of the tree, on nouns and prounouns, and on subject and object relations. MSTParser is more accurate on long sentences, on long dependencies, on dependencies near the root of the tree, on verbs, and on coordi- nation relations and sentence roots. McDonald and Nivre (2007, 2011) argue that these patterns can be explained by the complemen- tary strengths and weaknesses of the systems. The Figure 1: Labeled precision by dependency length for MST (global -- exhaustive -- graph), Malt (local -- greedy -- transition) and ZPar (global -- beam -- transition). From Zhang and Nivre (2012). transition-based MaltParser prioritizes rich struc- tural features, which enable accurate disambigua- tion in local contexts, but is limited by a locally optimized model and greedy algorithm, resulting in search errors for structures that require longer transition sequences. The graph-based MSTParser benefits from a globally optimized model and ex- act inference, which gives a better analysis of global sentence structure, but is more restricted in the features it can use, which limits its capacity to score local structures accurately. Many of the developments in dependency pars- ing during the last decade can be understood in this light as attempts to mitigate the weaknesses of tra- ditional transition-based and graph-based parsers without sacrificing their strengths. This may mean evolving the model structure through new transition systems (Nivre, 2008, 2009; Kuhlmann et al., 2011) or higher-order models for graph- based parsing (McDonald and Pereira, 2006; Car- reras, 2007; Koo and Collins, 2010); it may mean exploring alternative learning strategies, in partic- ular for transition-based parsing, where improve- ments have been achieved thanks to global struc- ture learning (Zhang and Clark, 2008; Zhang and Nivre, 2011; Andor et al., 2016) and dynamic or- acles (Goldberg and Nivre, 2012, 2013); it may mean using alternative search strategies, such as transition-based parsing with beam search (Jo- hansson and Nugues, 2007; Titov and Hender- son, 2007; Zhang and Clark, 2008) or exact search (Huang and Sagae, 2010; Kuhlmann et al., 2011) or graph-based parsing with heuristic search to cope with the complexity of higher-order models, especially for non-projective parsing (McDonald and Pereira, 2006; Koo et al., 2010; Zhang and McDonald, 2012); or it may mean hybrid or en- 02468101214Dependency length0.50.60.70.80.9Dependency precisionMSTParserMaltParserZPar2468101214Dependency length0.50.60.70.80.9Dependency recallMSTParserMaltParserZParFigure3:Dependencyarcprecision/recallrelativetopredicted/golddependencylength.1234567Distance to root0.760.780.80.820.840.860.880.90.920.94Dependency precisionMSTParserMaltParserZPar1234567Distance to root0.780.80.820.840.860.880.9Dependency recallMSTParserMaltParserZParFigure4:Dependencyarcprecision/recallrelativetopredicted/golddistancetoroot.ZParperformsbetterthanMaltParserandMSTParser,particularlyonshortsentences(30),duetotherichestfeaturerepresentation.Forlongersentences(20to50),theperformanceofZPardropsasquicklyasthatofMaltParser.Onepossiblereasonisthattheeffectofafixed-sizebeamonthereductionoferrorpropagationbecomeslessobviouswhenthenumberofpossibleparsetreesgrowsexponentiallywithsentencesize.TheperformanceofMSTParserdecreaseslessquicklyasthesizeofthesentenceincreases,demonstratingtheadvantageofexactinference.Sentenceswith50+wordsarerelativelyrareinthetestset.Thethreeparsersshowlargervarianceinperformancewhenevaluatedagainstspecificproper-tiesofthedependencytree.Figure3showstheprecisionandrecallforeachparserrelativetothearclengthsinthepredictedandgold-standarddependencytrees.Herethelengthofanarcisdefinedastheabsolutedifferencebetweentheindicesoftheheadandmodifier.Precisionrepresentsthepercentageofpredictedarcswithaparticularlengththatarecorrect,andrecallrepresentsthepercentageofgoldarcsofaparticularlengththatarecorrectlypredicted.MaltParsergiveshigherprecisionthanMSTParserforshortdependencyarcs(4),butitspre-cisiondropsrapidlyforarcswithincreasedlengths.Thesearcstakemoreshift-reduceactionstobuild,andarehencemorepronetoerrorpropagation.TheprecisionofZPardropsmuchslowercomparedtoMaltParser,demonstratingtheeffectofbeam-searchforthereductionoferrorpropagation.Anotherimportantfactoristheuseofrichnon-localfeaturesbyZPar,whichisalikelyreasonforitsprecisiontodropslowereventhanthatofMSTParserwhenthearcsizeincreasesfrom1to8.Interestingly,theprecisionofZParisalmostindistinguishablefromthatofMaltParserforsize1arcs(arcsbetweenneighbouringwords),showingthatthewiderrangeoffeaturesinZParisthemosthelpfulinarcsthattakemorethanone,butnottoomanyshift-reduceactionstobuild.Therecallcurvesofthethreeparsersaresimilar,withZParhaving1397 semble systems (Sagae and Lavie, 2006; Nivre and McDonald, 2008; Zhang and Clark, 2008; Bohnet and Kuhn, 2012). A nice illustration of the im- pact of new techniques can be found in Zhang and Nivre (2012), where an error analysis along the lines of McDonald and Nivre (2007, 2011) shows that a transition-based parser using global learn- ing and beam search (instead of local learning and greedy search) performs on par with graph-based parsers for long dependencies, while retaining the advantage of the original transition-based parsers on short dependencies (see Figure 1). Neural networks for dependency parsing, first explored by Titov and Henderson (2007) and At- tardi et al. (2009), have come to dominate the field during the last five years. While this has dramatically changed learning architectures and feature representations, most parsing models are still either transition-based (Chen and Manning, 2014; Dyer et al., 2015; Weiss et al., 2015; An- dor et al., 2016; Kiperwasser and Goldberg, 2016) or graph-based (Kiperwasser and Goldberg, 2016; Dozat and Manning, 2017). However, more ac- curate feature learning using continuous represen- tations and nonlinear models has allowed parsing architectures to be simplified. Thus, most recent transition-based parsers have moved back to lo- cal learning and greedy inference, seemingly with- out losing accurracy (Chen and Manning, 2014; Dyer et al., 2015; Kiperwasser and Goldberg, 2016). Similarly, graph-based parsers again rely on first-order models and obtain no improvements from using higher-order models (Kiperwasser and Goldberg, 2016; Dozat and Manning, 2017). The increasing use of neural networks has also led to a convergence in feature representations and learning algorithms for transition-based and graph-based parsers. In particular, most recent systems rely on an encoder, typically in the form of a BiLSTM, that provides contextualized repre- sentations of the input words as input to the scor- ing of transitions -- in transition-based parsers -- or of dependency arcs -- in graph-based parsers. By making information about the global sentence context available in local word representations, this encoder can be assumed to mitigate error propagation for transition-based parsers and to widen the feature scope beyond individual word pairs for graph-based parsers. For both types of parsers, this also obviates the need for complex structural feature templates, as recently shown by Falenska and Kuhn (2019). We should therefore expect neural transition-based and graph-based parsers to be not only more accurate than their non-neural counterparts but also more similar to each other in their error profiles. 3 Deep Contextualized Word Representations Neural parsers rely on vector representations of words as their primary input, often in the form of pretrained word embeddings such as word2vec (Mikolov et al., 2013), GloVe (Pennington et al., 2014), or fastText (Bojanowski et al., 2016), which are sometimes extended with character- based representations produced by recurrent neu- ral networks (Ballesteros et al., 2015). These tech- niques assign a single static representation to each word type and therefore cannot capture context- dependent variation in meaning and syntactic be- havior. By contrast, deep contextualized word repre- sentations encode words with respect to the sen- tential context in which they appear. Like word embeddings, such models are typically trained with a language-modeling objective, but yield sentence-level tensors as representations, instead of single vectors. These representations are typ- ically produced by transferring a model's entire feature encoder -- be it a BiLSTM (Hochreiter and Schmidhuber, 1997) or Transformer (Vaswani et al., 2017) -- to a target task, where the dimen- sionality of the tensor S is typically S ∈ RN×L×D for a sentence of length N, an encoder with L lay- ers, and word-level vectors of dimensionality D. The advantage of such models, compared to the parser-internal encoders discussed in the previous section, is that they not only produce contextual- ized representations but do so over several layers of abstraction, as captured by the model's different layers, and are pre-trained on corpora much larger than typical treebanks. Deep contextualized embedding models have proven to be adept at a wide array of NLP tasks, achieving state-of-the-art performance in standard Natural Language Understanding (NLU) bench- marks, such as GLUE (Wang et al., 2019). Though many such models have been proposed, we adopt the two arguably most popular ones for our ex- periments: ELMo and BERT. Both models have previously been used for dependency parsing (Che et al., 2018; Jawahar et al., 2018; Lim et al., 2018; Kondratyuk, 2019; Schuster et al., 2019), but there has been no systematic analysis of their impact on transition-based and graph-based parsers. 3.1 ELMo ELMo is a deep contextualized embedding model proposed by Peters et al. (2018), which pro- duces sentence-level representations yielded by a multi-layer BiLSTM language model. ELMo is trained with a standard language-modeling ob- jective, in which a BiLSTM reads a sequence of N learned context-independent embeddings w1, . . . , wN (obtained via a character-level CNN) and produces a context-dependent representation hj,k = BiLSTM(w1:N , k), where j (1≤ j ≤ L) is the BiLSTM layer and k is the index of the word in the sequence. The output of the last layer hL,k is then employed in conjunction with a softmax layer to predict the next token at k + 1. The simplest way of transferring ELMo to a downstream task is to encode the input sentence S = w1, . . . , wN by extracting the representa- tions from the BiLSTM at layer L for each token wk ∈ S: hL,1, . . . , hL,N ,. However, Peters et al. (2018) posit that the best way to take advantage of ELMo's representational power is to compute a linear combination of BiLSTM layers: L(cid:88) ELMok = γ sjhj,k (1) j=0 where sj is a softmax-normalized task-specific pa- rameter and γ is a task-specific scalar. Peters et al. (2018) demonstrate that this scales the layers of linguistic abstraction encoded by the BiLSTM for the task at hand. 3.2 BERT BERT (Devlin et al., 2019) is similar to ELMo in that it employs a language-modeling objective over unannotated text in order to produce deep contextualized embeddings. However, BERT dif- fers from ELMo in that, in place of a BiLSTM, it employs a bidirectional Transformer (Vaswani et al., 2017), which, among other factors, carries the benefit of learning potential dependencies be- tween words directly. This lies in contrast to re- current models, which may struggle to learn corre- spondences between constituent signals when the time-lag between them is long (Hochreiter et al., 2001). For a token wk in sentence S, BERT's input representation is composed by summing a word embedding xk, a position embedding ik, and a WordPiece embedding sk (Wu et al., 2016): wk = xk + ik + sk. Each wk ∈ S is passed to an L-layered Bi- Transformer, which is trained with a masked lan- guage modeling objective (i.e., randomly masking a percentage of input tokens and only predicting said tokens). For use in downstream tasks, Devlin et al. (2019) propose to extract the Transformer's encoding of each token wk ∈ S at layer L, which effectively produces BERTk. 4 Hypotheses Based on our discussion in Section 2, we assume that transition-based and graph-based parsers still have distinctive error profiles due to the basic trade-off between rich structural features, which allow transition-based parsers to make accurate local decisions, and global learning and exact search, which give graph-based parsers an advan- tage with respect to global sentence structure. At the same time, we expect the differences to be less pronounced than they were ten years ago because of the convergence in neural architectures and fea- ture representations. But how will the addition of deep contextualized word representations affect the behavior of the two parsers? Given recent recent work showing that deep contextualized word representations incorporate rich information about syntactic structure (Gold- berg, 2019; Liu et al., 2019; Tenney et al., 2019; Hewitt and Manning, 2019), we hypothesize that transition-based parsers have most to gain from these representations because it will improve their capacity to make decisions informed by global sentence structure and therefore reduce the num- ber of search errors. Our main hypothesis can be stated as follows: Deep contextualized word representations are more effective at reducing errors in transition- based parsing than in graph-based parsing. If this holds true, then the analysis of McDonald and Nivre (2007, 2011) suggests that the differen- tial error reduction should be especially visible on phenomena such as: 1. longer dependencies, 2. dependencies closer to the root, 3. certain parts of speech, 4. certain dependency relations, 5. longer sentences. The error analysis will consider all these factors as well as non-projective dependencies. 5 Experimental Setup 5.1 Parsing Architecture To be able to compare transition-based and graph- based parsers under equivalent conditions, we use and extend UUParser1 (de Lhoneux et al., 2017a; Smith et al., 2018a), an evolution of bist- parser (Kiperwasser and Goldberg, 2016), which supports transition-based and graph-based parsing with a common infrastructure but different scoring models and parsing algorithms. For an input sentence S = w1, . . . , wN , the parser creates a sequence of vectors w1:N , where the vector wk = xk ◦ BILSTM(c1:M ) represent- ing input word wk is the concatenation of a pre- trained word embedding xk and a character-based embedding BILSTM(c1:M ) obtained by running a BiLSTM over the character sequence c1:M of wk. Finally, each input element is represented by a BiLSTM vector, hk = BILSTM(w1:N , k). In transition-based parsing, the BiLSTM vec- tors are input to a multi-layer perceptron (MLP) for scoring transitions, using the arc-hybrid transi- tion system from Kuhlmann et al. (2011) extended with a SWAP transition to allow the construction of non-projective dependency trees (Nivre, 2009; de Lhoneux et al., 2017b). The scoring is based on the top three words on the stack and the first word of the buffer, and the input to the MLP in- cludes the BiLSTM vectors for these words as well as their leftmost and rightmost dependents (up to 12 words in total). In graph-based parsing, the BiLSTM vectors are input to an MLP for scoring all possible de- pendency relations under an arc-factored model, meaning that only the vectors corresponding to the head and dependent are part of the input (2 words in total). The parser then extracts a maximum spanning tree over the score matrix using the Chu- Liu-Edmonds (CLE) algorithm2 (Edmonds, 1967) which allows us to construct non-projective trees. It is important to note that, while we acknowl- edge the existence of graph-based parsers that out- perform the implementation of Kiperwasser and Goldberg (2016), such models do not meet our criteria for systematic comparison. The parser 1https://github.com/UppsalaNLP/ uuparser 2We use the implementation from Qi et al. (2018). by Dozat et al. (2017) is very similar, but em- ploys the MLP as a further step in the featuriza- tion process prior to scoring via a biaffine clas- sifier. To keep the comparison as exact as pos- sible, we forego comparing our transition-based systems to the Dozat et al. (2017) parser (and its numerous modifications). In addition, preliminary experiments showed that our chosen graph-based parser outperforms its transition-based counter- part, which was itself competitive in the CoNLL 2018 shared task (Zeman et al., 2018). Input Representations 5.2 In our experiments, we evaluate three pairs of sys- tems -- differing only in their input representations. The first is a baseline that represents tokens by wk = xk ◦ BILSTM(c1:M ), as described in Sec- tion 5.1. The word embeddings xk are initialized via pretrained fastText vectors (xk ∈ R300) (Grave et al., 2018), which are updated for the parsing task. We term these transition-based and graph- based baselines TR and GR. For the ELMo experiments, we make use of pretrained models provided by Che et al. (2018), who train ELMo on 20 million words randomly sampled from raw WikiDump and Common Crawl datasets for 44 languages. We encode each gold- segmented sentence in our treebank via the ELMo model for that language, which yields a tensor SELMo = RN×L×D, where N is the number of words in the sentence, L = 3 is the number of ELMo layers, and D = 1024 is the ELMo vec- tor dimensionality. Following Peters et al. (2018) (see Eq. 1), we learn a linear combination and a task-specific γ of each token's ELMo representa- tion, which yields a vector ELMok ∈ R1024. We then concatenate this vector with wk and pass it to the BiLSTM. We call the transition-based and graph-based systems enhanced with ELMo TR+E and GR+E. For the BERT experiments, we employ the pretrained multilingual cased model provided by Google,3 4 which is trained on the concatenation of WikiDumps for the top 104 languages with the largest Wikipedias.5 The model's parameters fea- ture a 12-layer transformer trained with 768 hid- 3https://github.com/google-research/ bert pretrained model. 4Except for Chinese, for which we make use of a separate, 5See sorted list here: https://meta.wikimedia. org/wiki/List_of_Wikipedias den units and 12 self-attention heads. In order to obtain a word-level vector for each token in a sen- tence, we experimented with a variety of represen- tations: namely, concatenating each transformer layer's word representation into a single vector wconcat ∈ R768∗12, employing the last layer's rep- resentation, or learning a linear combination over a range of layers, as we do with ELMo (e.g., via Eq. 1). In a preliminary set of experiments, we found that the latter approach over layers 4 -- 8 con- sistently yielded the best results, and thus chose to adopt this method going forward. Regarding tokenization, we select the vector for the first sub- word token, as produced by the native BERT to- kenizer. Surprisingly, this gave us better results than averaging subword token vectors in a prelim- inary round of experiments. Like with the ELMo representations, we concatenate each BERT vec- tor BERTk ∈ R768 with wk and pass it to the respective TR+B and GR+B parsers. It is important to note that while the ELMo models we work with are monolingual, the BERT model is multilingual. In other words, while the standalone ELMo models were trained on the tokenized WikiDump and CommonCrawl for each language respectively, the BERT model was trained only on the former, albeit simultaneously for 104 languages. This means that the models are not strictly comparable, and it is an interest- ing question whether either of the models has an advantage in terms of training regime. However, since our purpose is not to compare the two mod- els but to study their impact on parsing, we leave this question for future work. 5.3 Language and Treebank Selection For treebank selection, we rely on the criteria pro- posed by de Lhoneux et al. (2017c) and adapted by Smith et al. (2018b) to have languages from dif- ferent language families, with different morpho- logical complexity, different scripts and character set sizes, different training sizes and domains, and with good annotation quality. This gives us 13 treebanks from UD v2.3 (Nivre et al., 2018), in- formation about which is shown in Table 1. 5.4 Parser Training and Evaluation In all experiments, we train parsers with default settings6 for 30 epochs and select the model with 6All hyperparameters are specified in the supplementary material (Part A). Language Treebank Family Order Train PADT Arabic 6.1k non-IE VSO BDT 5.4k Basque non-IE SOV GSD Chinese 4.0k non-IE SVO EWT SVO 12.5k English IE TDT non-IE SVO 12.2k Finnish HTB non-IE SVO Hebrew 5.2k SOV 13.3k IE HDTB Hindi ISDT Italian IE SVO 13.1k 7.1k non-IE SOV Japanese GSD GSD Korean non-IE SOV 4.4k SVO 48.8k SynTagRus IE Russian Swedish Talbanken IE SVO 4.3k 3.7k non-IE SOV IMST Turkish Table 1: Languages and treebanks used in experiments. Family = Indo-European (IE) or not. Order = domi- nant word order according to WALS (Haspelmath et al., 2005). Train = number of training sentences. the best labeled attachment score on the dev set. For each combination of model and training set, we repeat this procedure three times with different random seeds, apply the three selected models to the test set, and report the average result. 5.5 Error Analysis In order to conduct an error analysis along the lines of McDonald and Nivre (2007, 2011), we ex- tract all sentences from the smallest development set in our treebank sample (Hebrew HTB, 484 sen- tences) and sample the same number of sentences from each of the other development sets (6,292 sentences in total). For each system, we then ex- tract parses of these sentences for the three train- ing runs with different random seeds (18,876 pre- dictions in total). Although it could be interest- ing to look at each language separately, we follow McDonald and Nivre (2007, 2011) and base our main analysis on all languages together to prevent data sparsity for longer dependencies, longer sen- tences, etc.7 6 Results and Discussion Table 2 shows labeled attachment scores for the six parsers on all languages, averaged over three training runs with random seeds. The results clearly corroborate our main hypothesis. While ELMo and BERT provide significant improve- ments for both transition-based and graph-based 7The supplementary material contains tables for the error analysis (Part B) and graphs for each language (Part C). Language TR Arabic 79.1 73.6 Basque 75.3 Chinese English 82.7 Finnish 80.0 Hebrew 81.1 88.4 Hindi Italian 88.0 Japanese 92.1 79.6 Korean 88.3 Russian Swedish 80.5 57.8 Turkish Average 80.5 GR TR+E GR+E TR+B GR+B 79.9 82.0 81.7 81.9 81.8 79.8 77.6 80.1 81.4 77.9 83.4 76.7 79.8 80.4 83.7 83.3 87.0 86.5 87.8 87.6 83.9 81.4 87.0 86.6 85.1 85.9 82.4 85.2 85.9 85.5 90.8 89.6 91.0 91.2 89.5 88.2 90.9 90.6 92.0 91.7 92.1 92.2 93.1 93.0 92.9 84.2 81.2 82.3 82.3 83.7 91.0 88.0 90.7 90.6 91.5 81.6 86.9 86.2 87.6 86.9 64.9 61.2 62.6 63.8 64.2 81.8 84.5 84.6 84.9 84.9 Table 2: Labeled attachment score on 13 languages for parsing models with and without deep contextualized word representations. the magnitude of the improvement parsers, is greater in the transition-based case: 3.99 vs. 2.85 for ELMo and 4.47 vs. 3.13 for BERT. In terms of error reduction, this corresponds to 21.1% vs. 16.5% for ELMo and 22.5% vs. 17.4% for BERT. The differences in error reduction are statistically significant at α = 0.01 (Wilcoxon). Although both parsing accuracy and absolute improvements vary across languages, the overall trend is remarkably consistent and the transition- based parser improves more with both ELMo and BERT for every single language. Furthermore, a linear mixed effect model analysis reveals that, when accounting for language as a random effect, there are no significant interactions between the improvement of each model (over its respective baseline) and factors such as language family (IE vs. non-IE), dominant word order, or number of training sentences. In other words, the improve- ments for both parsers seem to be largely indepen- dent of treebank-specific factors. Let us now see to what extent they can be explained by the error analysis. 6.1 Dependency Length Figure 2 shows labeled F-score for dependencies of different lengths, where the length of a depen- dency between words wi and wj is equal to i − j (and with root tokens in a special bin on the far left). For the baseline parsers, we see that the curves diverge with increasing length, clearly indi- cating that the transition-based parser still suffers Figure 2: Labeled F-score by dependency length. Figure 3: Labeled F-score by distance to root. Figure 4: Labeled precision (left) and recall (right) for non-projective dependencies. from search errors on long dependencies, which require longer transition sequences for their con- struction. However, the differences are much smaller than in McDonald and Nivre (2007, 2011) and the transition-based parser no longer has an advantage for short dependencies, which is consis- tent with the BiLSTM architecture providing the parsers with more similar features that help the graph-based parser overcome the limited scope of the first-order model. Adding deep contextualized word representa- tions clearly helps the transition-based parser to perform better on longer dependencies. For ELMo there is still a discernible difference for dependen- cies longer than 5, but for BERT the two curves are almost indistinguishable throughout the whole range. This could be related to the aforemen- tioned intuition that a Transformer captures long dependencies more effectively than a BiLSTM (see Tran et al. (2018) for contrary observations, albeit for different tasks). The overall trends for both baseline and enhanced models are quite con- sistent across languages, although with large vari- ations in accuracy levels. 6.2 Distance to Root Figure 3 reports labeled F-score for dependencies at different distances from the root of the tree, where distance is measured by the number of arcs in the path from the root. There is a fairly strong (inverse) correlation between dependency length and distance to the root, so it is not surprising that the plots in Figure 3 largely show the mirror image of the plots in Figure 2. For the baseline parsers, the graph-based parser has a clear advantage for dependencies near the root (including the root it- self), but the transition-based parser closes the gap with increasing distance.8 For ELMo and BERT, the curves are much more similar, with only a slight advantage for the graph-based parser near the root and with the transition-based BERT parser being superior from distance 5 upwards. The main trends are again similar across all languages. 6.3 Non-Projective Dependencies Figure 4 shows precision and recall specifically for non-projective dependencies. We see that there is a clear tendency for the transition-based parser to have better precision and the graph-based parser better recall.9 In other words, non-projective de- pendencies are more likely to be correct when they are predicted by the transition-based parser using the swap transition, but real non-projective depen- dencies are more likely to be found by the graph- based parser using a spanning tree algorithm. In- terestingly, adding deep contextualized word rep- resentations has almost no effect on the graph- based parser,10 while especially the ELMo em- 8At the very end, the curves appear to diverge again, but the data is very sparse in this part of the plot. 9Incidentally, the same pattern is reported by McDon- ald and Nivre (2007, 2011), even though the techniques for processing non-projective dependencies are different in that study: pseudo-projective parsing (Nivre and Nilsson, 2005) for the transition-based parser and approximate second-order non-projective parsing (McDonald and Pereira, 2006) for the graph-based parser. 10The breakdown per language shows marginal improve- ments for the enhanced graph-based models on a few lan- Figure 5: Labeled attachment score by sentence length. beddings improve both precision and recall for the transition-based parser. 6.4 Parts of Speech and Dependency Types Thanks to the cross-linguistically consistent UD annotations, we can relate errors to linguistic cate- gories more systematically than in the old study. The main impression, however, is that there are very few clear differences, which is again indica- tive of the convergence between the two parsing approaches. We highlight the most notable differ- ences and refer to the supplementary material (Part B) for the full results. Looking first at parts of speech, the baseline graph-based parser is slightly more accurate on verbs and nouns than its transition-based counter- part, which is consistent with the old study for verbs but not for nouns. After adding the deep contextualized word representations, both differ- ences are essentially eliminated. With regard to dependency relations, the base- line graph-based parser has better precision and recall than the baseline transition-based parser for the relations of coordination (conj), which is con- sistent with the old study, as well as clausal sub- jects (csubj) and clausal complements (ccomp), which are relations that involve verbs in clausal structures. Again, the differences are greatly re- duced in the enhanced parsing models, especially for clausal complements, where the transition- based parser with ELMo representations is even slightly more accurate than the graph-based parser. 6.5 Sentence Length Figure 5 plots labeled attachment score for sen- tences of different lengths, measured by number of words in bins of 1 -- 10, 11 -- 20, etc. Here we guages, canceled out by equally marginal degradations on others. find the most unexpected results of the study. First of all, although the baseline parsers exhibit the familiar pattern of accuracy decreasing with sen- tence length, it is not the transition-based but the graph-based parser that is more accurate on short sentences and degrades faster. In other words, al- though the transition-based parser still seems to suffer from search errors, as shown by the results on dependency length and distance to the root, it no longer seems to suffer from error propagation in the sense that earlier errors make later errors more probable. The most likely explanation for this is the improved training for transition-based parsers using dynamic oracles and aggressive ex- ploration to learn how to behave optimally also in non-optimal configurations (Goldberg and Nivre, 2012, 2013; Kiperwasser and Goldberg, 2016). Turning to the models with deep contextual- ized word representations, we find that transition- based and graph-based parsers behave more simi- larly, which is in line with our hypotheses. How- ever, the most noteworthy result is that accuracy improves with increasing sentence length. For ELMo this holds only from 1 -- 10 to 11 -- 20, but for BERT it holds up to 21 -- 30, and even sentences of length 31 -- 40 are parsed with higher accuracy than sentences of length 1 -- 10. A closer look at the breakdown per language reveals that this picture is slightly distorted by different sentence length dis- tributions in different languages. More precisely, high-accuracy languages seem to have a higher proportion of sentences of mid-range length, caus- ing a slight boost in the accuracy scores of these bins, and no single language exhibits exactly the patterns shown in Figure 5. Nevertheless, several languages exhibit an increase in accuracy from the first to the second bin or from the second to the third bin for one or more of the enhanced mod- els (especially the BERT models). And almost all languages show a less steep degradation for the en- hanced models, clearly indicating that deep con- textualized word representations improve the ca- pacity to parse longer sentences. 7 Conclusion In this paper, we have essentially replicated the study of McDonald and Nivre (2007, 2011) for neural parsers. In the baseline setting, where parsers use pre-trained word embeddings and character representations fed through a BiLSTM, we can still discern the basic trade-off identified in the old study, with the transition-based parser suffering from search errors leading to lower accu- racy on long dependencies and dependencies near the root of the tree. However, important details of the picture have changed. The graph-based parser is now as accurate as the transition-based parser on shorter dependencies and dependencies near the leaves of the tree, thanks to improved represen- tation learning that overcomes the limited feature scope of the first order model. And with respect to sentence length, the pattern has actually been reversed, with the graph-based parser being more accurate on short sentences and the transition- based parser gradually catching up thanks to new training methods that prevent error propagation. When adding deep contextualized word repre- sentations, the behavior of the two parsers con- verge even more, and the transition-based parser in particular improves with respect to longer de- pendencies and dependencies near the root, as a result of fewer search errors thanks to enhanced information about the global sentence structure. One of the most striking results, however, is that both parsers improve their accuracy on longer sen- tences, with some models for some languages in fact being more accurate on medium-length sen- tences than on shorter sentences. This is a mile- stone in parsing research, and more research is needed to explain it. In a broader perspective, we hope that future studies on dependency parsing will take the re- sults obtained here into account and extend them by investigating other parsing approaches and neu- ral network architectures. Indeed, given the rapid development of new representations and archi- tectures, future work should include analyses of how all components in neural parsing architec- tures (embeddings, encoders, decoders) contribute to distinct error profiles (or lack thereof). Acknowledgments We want to thank Ali Basirat, Christian Hard- meier, Jamie Henderson, Ryan McDonald, Paola Merlo, Gongbo Tang, and the EMNLP review- ers and area chairs for valuable feedback on pre- liminary versions of this paper. We acknowledge the computational resources provided by CSC in Helsinki and Sigma2 in Oslo through NeIC-NLPL (www.nlpl.eu). References Daniel Andor, Chris Alberti, David Weiss, Aliaksei Severyn, Alessandro Presta, Kuzman Ganchev, Slav Petrov, and Michael Collins. 2016. Globally nor- In Pro- malized transition-based neural networks. ceedings of the 54th Annual Meeting of the Asso- ciation for Computational Linguistics (ACL), pages 2442 -- 2452. Giuseppe Attardi, Felice DellOrletta, Maria Simi, and Joseph Turian. 2009. Accurate dependency parsing In Proceed- with a stacked multilayer perceptron. ings of EVALITA 2009. Miguel Ballesteros, Chris Dyer, and Noah A. Smith. Improved transition-based parsing by mod- 2015. eling characters instead of words with LSTMs. In Proceedings of the Conference on Empirical Meth- ods in Natural Language Processing (EMNLP), pages 349 -- 359. Ezra Black, Frederick Jelinek, John D. Lafferty, David M. Magerman, Robert L. Mercer, and Salim Roukos. 1992. Towards history-based grammars: Using richer models for probabilistic parsing. In Proceedings of the 5th DARPA Speech and Natural Language Workshop, pages 31 -- 37. Bernd Bohnet and Jonas Kuhn. 2012. The best of both worlds -- a graph-based completion model for transition-based parsers. In Proceedings of the 13th Conference of the European Chpater of the Associ- ation for Computational Linguistics (EACL), pages 77 -- 87. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2016. Enriching word vec- arXiv preprint tors with subword information. arXiv:1607.04606. Sabine Buchholz and Erwin Marsi. 2006. CoNLL-X shared task on multilingual dependency parsing. In Proceedings of the 10th Conference on Computa- tional Natural Language Learning (CoNLL), pages 149 -- 164. Xavier Carreras. 2007. Experiments with a higher- order projective dependency parser. In Proceedings of the CoNLL Shared Task of EMNLP-CoNLL 2007, pages 957 -- 961. Wanxiang Che, Yijia Liu, Yuxuan Wang, Bo Zheng, and Ting Liu. 2018. Towards better UD parsing: Deep contextualized word embeddings, ensemble, and treebank concatenation. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 55 -- 64. Danqi Chen and Christopher Manning. 2014. A fast and accurate dependency parser using neural net- In Proceedings of the Conference on Em- works. pirical Methods in Natural Language Processing (EMNLP), pages 740 -- 750. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language under- standing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Tech- nologies. Timothy Dozat and Christopher D. Manning. 2017. Deep biaffine attention for neural dependency pars- ing. In Proceedings of the 5th International Confer- ence on Learning Representations. Timothy Dozat, Peng Qi, and Christopher D. Manning. 2017. Stanford's graph-based neural dependency In Proceed- parser at the conll 2017 shared task. ings of the CoNLL 2017 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 20 -- 30. Chris Dyer, Miguel Ballesteros, Wang Ling, Austin Matthews, and Noah A. Smith. 2015. Transition- based dependency parsing with stack long short- In Proceedings of the 53rd Annual term memory. Meeting of the Association for Computational Lin- guistics (ACL), pages 334 -- 343. Jack Edmonds. 1967. Optimum branchings. Journal of Research of the National Bureau of Standards, 71B:233 -- 240. Jason M. Eisner. 1996. Three new probabilistic models In Pro- for dependency parsing: An exploration. ceedings of the 16th International Conference on Computational Linguistics (COLING), pages 340 -- 345. Agnieszka Falenska and Jonas Kuhn. 2019. The (non- )utility of structural features in BiLSTM-based de- In Proceedings of the 57th An- pendency parsers. nual Meeting of the Association for Computational Linguistics (ACL), pages 117 -- 128. Yoav Goldberg. 2019. Assessing BERT's syntactic abilities. CoRR, abs/1901.05287. Yoav Goldberg and Joakim Nivre. 2012. A dynamic or- acle for arc-eager dependency parsing. In Proceed- ings of the 24th International Conference on Com- putational Linguistics (COLING), pages 959 -- 976. Yoav Goldberg and Joakim Nivre. 2013. Training de- terministic parsers with non-deterministic oracles. Transactions of the Association for Computational Linguistics, 1:403 -- 414. Edouard Grave, Piotr Bojanowski, Prakhar Gupta, Ar- manpd Joulin, and Tomas Mikolov. 2018. Learn- In Proceed- ing word vectors for 157 languages. ings of the International Conference on Language Resources and Evaluation (LREC 2018). Martin Haspelmath, Matthew S. Dryer, David Gil, and Bernard Comrie. 2005. Thw World Atlas of Lan- guage Structures. Oxford University Press. John Hewitt and Christopher D. Manning. 2019. A structural probe for finding syntax in word represen- In Proceedings of the 2019 Conference of tations. the North American Chapter of the Association for Computational Linguistics: Human Language Tech- nologies. Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, Jurgen Schmidhuber, et al. 2001. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural computation, Long short-term memory. 9(8):1735 -- 1780. Liang Huang and Kenji Sagae. 2010. Dynamic pro- gramming for linear-time incremental parsing. In Proceedings of the 48th Annual Meeting of the Asso- ciation for Computational Linguistics (ACL), pages 1077 -- 1086. Ganesh Jawahar, Benjamin Muller, Amal Fethi, Louis Martin, Eric Villemonte de la Clergerie, Benoıt Sagot, and Djam´e Seddah. 2018. ELMoLex: Con- necting ELMo and lexicon features for dependency parsing. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Univer- sal Dependencies, pages 223 -- 237. Richard Johansson and Pierre Nugues. 2007. Incre- mental dependency parsing using online learning. In Proceedings of the CoNLL Shared Task of EMNLP- CoNLL 2007, pages 1134 -- 1138. Eliyahu Kiperwasser and Yoav Goldberg. 2016. Sim- ple and accurate dependency parsing using bidirec- Transactions tional lstm feature representations. of the Association for Computational Linguistics, 4:313 -- 327. Daniel Kondratyuk. 2019. 75 languages, 1 model: Parsing universal dependencies universally. CoRR, abs/1904.02099. Terry Koo and Michael Collins. 2010. Efficient third- In Proceedings of the order dependency parsers. 48th Annual Meeting of the Association for Compu- tational Linguistics (ACL), pages 1 -- 11. Terry Koo, Alexander M. Rush, Michael Collins, Tommi Jaakkola, and David Sontag. 2010. Dual decomposition for parsing with non-projective head automata. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Process- ing, pages 1288 -- 1298. Marco Kuhlmann, Carlos G´omez-Rodr´ıguez, and Gior- gio Satta. 2011. Dynamic programming algorithms In Pro- for transition-based dependency parsers. ceedings of the 49th Annual Meeting of the Asso- ciation for Computational Linguistics (ACL), pages 673 -- 682. Miryam de Lhoneux, Yan Shao, Ali Basirat, Eliyahu Kiperwasser, Sara Stymne, Yoav Goldberg, and Joakim Nivre. 2017a. From raw text to Universal In Proceedings of Dependencies -- Look, no tags! the CoNLL 2017 Shared Task: Multilingual Pars- ing from Raw Text to Universal Dependencies, pages 207 -- 217. Miryam de Lhoneux, Sara Stymne, and Joakim Nivre. 2017b. Arc-hybrid non-projective dependency pars- ing with a static-dynamic oracle. In Proceedings of the 15th International Conference on Parsing Tech- nologies, pages 99 -- 104. Miryam de Lhoneux, Sara Stymne, and Joakim Nivre. 2017c. Old school vs. new school: Comparing transition-based parsers with and without neural net- work enhancement. In Proceedings of the 15th Tree- banks and Linguistic Theories Workshop (TLT). KyungTae Lim, Cheoneum Park, Changki Lee, and Thierry Poibeau. 2018. SEx BiST: A multi-source trainable parser with deep contextualized lexical representations. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 143 -- 152. Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. 2019. Lin- guistic knowledge and transferability of contextual representations. CoRR, abs/1903.08855. Ryan McDonald, Koby Crammer, and Fernando Pereira. 2005a. Online large-margin training of de- In Proceedings of the 43rd An- pendency parsers. nual Meeting of the Association for Computational Linguistics (ACL), pages 91 -- 98. Ryan McDonald, Kevin Lerman, and Fernando Pereira. 2006. Multilingual dependency analysis with a two- In Proceedings of the stage discriminative parser. 10th Conference on Computational Natural Lan- guage Learning (CoNLL), pages 216 -- 220. Ryan McDonald and Joakim Nivre. 2007. Character- izing the errors of data-driven dependency parsing In Proceedings of the 2007 Joint Confer- models. ence on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), pages 122 -- 131. Ryan McDonald and Joakim Nivre. 2011. Analyzing and integrating dependency parsers. Computational Linguistics, pages 197 -- 230. Ryan McDonald and Fernando Pereira. 2006. Online learning of approximate dependency parsing algo- In Proceedings of the 11th Conference of rithms. the European Chapter of the Association for Com- putational Linguistics (EACL), pages 81 -- 88. Ryan McDonald, Fernando Pereira, Kiril Ribarov, and Jan Hajic. 2005b. Non-projective dependency pars- In Proceed- ing using spanning tree algorithms. ings of the Human Language Technology Confer- ence and the Conference on Empirical Methods in Natural Language Processing (HLT/EMNLP), pages 523 -- 530. Tomas Mikolov, Kai Chen, Greg Corrado, and Jef- Efficient estimation of word arXiv preprint frey Dean. 2013. representations in vector space. arXiv:1301.3781. Joakim Nivre. 2003. An efficient algorithm for pro- In Proceedings of the jective dependency parsing. 8th International Workshop on Parsing Technologies (IWPT), pages 149 -- 160. Joakim Nivre. 2008. Algorithms for deterministic in- cremental dependency parsing. Computational Lin- guistics, 34:513 -- 553. Joakim Nivre. 2009. Non-projective dependency pars- In Proceedings of the ing in expected linear time. Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP (ACL- IJCNLP), pages 351 -- 359. Joakim Nivre, Mitchell Abrams, Zeljko Agi´c, Lars Ahrenberg, Lene Antonsen, Katya Aplonova, Maria Jesus Aranzabe, Gashaw Arutie, Masayuki Asahara, Luma Ateyah, Mohammed Attia, Aitz- iber Atutxa, Liesbeth Augustinus, Elena Bad- maeva, Miguel Ballesteros, Esha Banerjee, Sebas- tian Bank, Verginica Barbu Mititelu, Victoria Bas- mov, John Bauer, Sandra Bellato, Kepa Bengoetxea, Yevgeni Berzak, Irshad Ahmad Bhat, Riyaz Ah- mad Bhat, Erica Biagetti, Eckhard Bick, Rogier Blokland, Victoria Bobicev, Carl Borstell, Cristina Bosco, Gosse Bouma, Sam Bowman, Adriane Boyd, Aljoscha Burchardt, Marie Candito, Bernard Caron, Gauthier Caron, Guls¸en Cebiroglu Eryigit, Flavio Massimiliano Cecchini, Giuseppe G. A. C´eplo, Savas Cetin, Fabricio Celano, Slavom´ır Chalub, Jinho Choi, Yongseok Cho, Jayeol Chun, Silvie Cinkov´a, Aur´elie Collomb, C¸ agrı C¸ oltekin, Miriam Connor, Marine Courtin, Elizabeth David- son, Marie-Catherine de Marneffe, Valeria de Paiva, Arantza Diaz de Ilarraza, Carly Dickerson, Pe- ter Dirix, Kaja Dobrovoljc, Timothy Dozat, Kira Droganova, Puneet Dwivedi, Marhaba Eli, Ali Elkahky, Binyam Ephrem, Tomaz Erjavec, Aline Etienne, Rich´ard Farkas, Hector Fernandez Al- calde, Jennifer Foster, Cl´audia Freitas, Katar´ına Gajdosov´a, Daniel Galbraith, Marcos Garcia, Moa Gardenfors, Sebastian Garza, Kim Gerdes, Filip Ginter, Iakes Goenaga, Koldo Gojenola, Memduh Gokırmak, Yoav Goldberg, Xavier G´omez Guino- vart, Berta Gonz´ales Saavedra, Matias Grioni, Nor- munds Gr¯uz¯ıtis, Bruno Guillaume, C´eline Guillot- Barbance, Nizar Habash, Jan Hajic, Jan Hajic jr., Linh H`a My, Na-Rae Han, Kim Harris, Dag Haug, Barbora Hladk´a, Jaroslava Hlav´acov´a, Florinel Hociung, Petter Hohle, Jena Hwang, Radu Ion, Elena Irimia, O. l´aj´ıd´e Ishola, Tom´as Jel´ınek, An- ders Johannsen, Fredrik Jørgensen, Huner Kas¸ıkara, Sylvain Kahane, Hiroshi Kanayama, Jenna Kan- erva, Boris Katz, Tolga Kayadelen, Jessica Ken- ney, V´aclava Kettnerov´a, Jesse Kirchner, Kamil Kopacewicz, Natalia Kotsyba, Simon Krek, Sooky- oung Kwak, Veronika Laippala, Lorenzo Lam- bertino, Lucia Lam, Tatiana Lando, Septina Dian Larasati, Alexei Lavrentiev, John Lee, Phuong Le H`ong, Alessandro Lenci, Saran Lertpradit, Her- man Leung, Cheuk Ying Li, Josie Li, Keying Li, KyungTae Lim, Nikola Ljubesi´c, Olga Logi- nova, Olga Lyashevskaya, Teresa Lynn, Vivien Macketanz, Aibek Makazhanov, Michael Mandl, Christopher Manning, Ruli Manurung, Catalina Maranduc, David Marecek, Katrin Marheinecke, H´ector Mart´ınez Alonso, Andr´e Martins, Jan Masek, Yuji Matsumoto, Ryan McDonald, Gus- tavo Mendonc¸a, Niko Miekka, Margarita Misir- pashayeva, Anna Missila, Catalin Mititelu, Yusuke Miyao, Simonetta Montemagni, Amir More, Laura Moreno Romero, Keiko Sophie Mori, Shinsuke Mori, Bjartur Mortensen, Bohdan Moskalevskyi, Kadri Muischnek, Yugo Murawaki, Kaili Muurisep, Pinkey Nainwani, Juan Ignacio Navarro Horniacek, Anna Nedoluzhko, Gunta Nespore-B¯erzkalne, Lu- ong Nguyen Thi., Huy`en Nguyen Thi. Minh, Vi- taly Nikolaev, Rattima Nitisaroj, Hanna Nurmi, Stina Ojala, Ad´edayo. Ol´u`okun, Mai Omura, Petya Ostling, Lilja Øvrelid, Niko Osenova, Robert Partanen, Elena Pascual, Marco Passarotti, Ag- nieszka Patejuk, Guilherme Paulino-Passos, Siyao Peng, Cenel-Augusto Perez, Guy Perrier, Slav Petrov, Jussi Piitulainen, Emily Pitler, Barbara Plank, Thierry Poibeau, Martin Popel, Lauma Pretkalnin¸a, Sophie Pr´evost, Prokopis Proko- pidis, Adam Przepi´orkowski, Tiina Puolakainen, Sampo Pyysalo, Andriela Raabis, Alexandre Rade- maker, Loganathan Ramasamy, Taraka Rama, Car- los Ramisch, Vinit Ravishankar, Livy Real, Siva Reddy, Georg Rehm, Michael Riessler, Larissa Ri- naldi, Laura Rituma, Luisa Rocha, Mykhailo Ro- manenko, Rudolf Rosa, Davide Rovati, Valentin Roca, Olga Rudina, Jack Rueter, Shoval Sadde, Benoıt Sagot, Shadi Saleh, Tanja Samardzi´c, Stephanie Samson, Manuela Sanguinetti, Baiba Saul¯ıte, Yanin Sawanakunanon, Nathan Schnei- der, Sebastian Schuster, Djam´e Seddah, Wolfgang Seeker, Mojgan Seraji, Mo Shen, Atsuko Shi- mada, Muh Shohibussirri, Dmitry Sichinava, Na- talia Silveira, Maria Simi, Radu Simionescu, Katalin Simk´o, M´aria Simkov´a, Kiril Simov, Aaron Smith, Isabela Soares-Bastos, Carolyn Spadine, Antonio Stella, Milan Straka, Jana Strnadov´a, Alane Suhr, Umut Sulubacak, Zsolt Sz´ant´o, Dima Taji, Yuta Takahashi, Takaaki Tanaka, Isabelle Tellier, Trond Trosterud, Anna Trukhina, Reut Tsarfaty, Francis Tyers, Sumire Uematsu, Zdenka Uresov´a, Larraitz Uria, Hans Uszkoreit, Sowmya Vajjala, Daniel van Niekerk, Gertjan van Noord, Viktor Varga, Eric Villemonte de la Clergerie, Veronika Vincze, Lars Wallin, Jing Xian Wang, Jonathan North Washing- ton, Seyi Williams, Mats Wir´en, Tsegay Wolde- mariam, Tak-sum Wong, Chunxiao Yan, Marat M. Yavrumyan, Zhuoran Yu, Zdenek Zabokrtsk´y, Amir Zeldes, Daniel Zeman, Manying Zhang, and Hanzhi Zhu. 2018. Universal dependencies 2.3. LIN- DAT/CLARIN digital library at the Institute of For- mal and Applied Linguistics ( ´UFAL), Faculty of Mathematics and Physics, Charles University. Joakim Nivre, Johan Hall, Sandra Kubler, Ryan Mc- Donald, Jens Nilsson, Sebastian Riedel, and Deniz Yuret. 2007. The CoNLL 2007 shared task on de- In Proceedings of the CoNLL pendency parsing. Shared Task of EMNLP-CoNLL 2007, pages 915 -- 932. Joakim Nivre, Johan Hall, Jens Nilsson, Gulsen Eryigit, and Svetoslav Marinov. 2006. Labeled pseudo-projective dependency parsing with support vector machines. In Proceedings of the 10th Confer- ence on Computational Natural Language Learning (CoNLL), pages 221 -- 225. Joakim Nivre and Ryan McDonald. 2008. Integrat- ing graph-based and transition-based dependency In Proceedings of the 46th Annual Meet- parsers. ing of the Association for Computational Linguistics (ACL), pages 950 -- 958. Joakim Nivre and Jens Nilsson. 2005. Pseudo- In Proceedings of projective dependency parsing. the 43rd Annual Meeting of the Association for Computational Linguistics (ACL), pages 99 -- 106. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532 -- 1543. Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word rep- In Proceedings of the 2018 Confer- resentations. ence of the North American Chapter of the Associ- ation for Computational Linguistics: Human Lan- guage Technologies, Volume 1 (Long Papers), pages 2227 -- 2237. Peng Qi, Timothy Dozat, Yuhao Zhang, and Christo- pher D Manning. 2018. Universal dependency pars- ing from scratch. In Proceedings of the 2018 CoNLL Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, page 160. Kenji Sagae and Alon Lavie. 2006. Parser combination In Proceedings of the Human Lan- by reparsing. guage Technology Conference of the NAACL, Com- panion Volume: Short Papers, pages 129 -- 132. Tal Schuster, Ori Ram, Regina Barzilay, and Amir Globerson. 2019. Cross-lingual alignment of con- textual word embeddings, with applications to zero- In Proceedings of the shot dependency parsing. 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Hu- man Language Technologies, Volume 1 (Long and Short Papers), pages 1599 -- 1613, Minneapolis, Min- nesota. Association for Computational Linguistics. Aaron Smith, Bernd Bohnet, Miryam de Lhoneux, Joakim Nivre, Yan Shao, and Sara Stymne. 2018a. 82 treebanks, 34 models: Universal dependency parsing with multi-treebank models. In Proceedings of the 2018 CoNLL Shared Task: Multilingual Pars- ing from Raw Text to Universal Dependencies. Aaron Smith, Miryam de Lhoneux, Sara Stymne, and Joakim Nivre. 2018b. An investigation of the inter- actions between pre-trained word embeddings, char- acter models and pos tags in dependency parsing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R. Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R. Bowman, Dipan- jan Das, and Ellie Pavlick. 2019. What do you learn from context? probing for sentence structure in con- textualized word representations. In Proceedings of the 5th International Conference on Learning Rep- resentations. Ivan Titov and James Henderson. 2007. A latent vari- In able model for generative dependency parsing. Proceedings of the 10th International Conference on Parsing Technologies (IWPT), pages 144 -- 155. Ke Tran, Arianna Bisazza, and Christof Monz. 2018. The importance of being recurrent for modeling hi- In Proceedings of the 2018 erarchical structure. Conference on Empirical Methods in Natural Lan- guage Processing, pages 4731 -- 4736. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Pro- cessing Systems, pages 5998 -- 6008. Jorn Veenstra and Walter Daelemans. 2000. A memory-based alternative for connectionist shift- reduce parsing. Technical Report ILK-0012, Tilburg University. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis plat- In Pro- form for natural language understanding. ceedings of the 7th International Conference on Learning Representations. David Weiss, Chris Alberti, Michael Collins, and Slav Petrov. 2015. Structured training for neural net- work transition-based parsing. In Proceedings of the 53rd Annual Meeting of the Association for Compu- tational Linguistics (ACL), pages 323 -- 333. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google's neural ma- chine translation system: Bridging the gap between arXiv preprint human and machine translation. arXiv:1609.08144. Hiroyasu Yamada and Yuji Matsumoto. 2003. Statis- tical dependency analysis with support vector ma- In Proceedings of the 8th International chines. Workshop on Parsing Technologies (IWPT), pages 195 -- 206. Daniel Zeman, Jan Hajic, Martin Popel, Martin Pot- thtyersast, Milan Straka, Filip Ginter, Joakim Nivre, and Slav Petrov. 2018. CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies. Hao Zhang and Ryan McDonald. 2012. Generalized higher-order dependency parsing with cube prun- ing. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Process- ing and Computational Natural Language Learning (EMNLP-CoNLL), pages 320 -- 331. Yue Zhang and Stephen Clark. 2008. A tale of two parsers: Investigating and combining graph-based In Pro- and transition-based dependency parsing. ceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 562 -- 571. Yue Zhang and Joakim Nivre. 2011. Transition-based parsing with rich non-local features. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics (ACL), pages 188 -- 193. Yue Zhang and Joakim Nivre. 2012. Analyzing the effect of global learning and beam-search on In Proceed- transition-based dependency parsing. ings of COLING 2012: Posters, pages 1391 -- 1400. Supplementary Material A Hyperparameters Component Specification wk dim. ELMok dim. BERTk dim. BiLSTM output dim. MLP output dim. No. BiLSTM layers BiLSTM dropout rate No. training epochs Model selection 500 (100 ∗ 2 (char) + 300 (word)) 1024 768 125 100 2 0.33 30 best dev. performance B Error Analysis B.1 Dependency Length GR pr 0.91 0.89 0.83 0.76 0.74 0.70 0.68 0.66 0.65 0.66 0.69 rc 0.91 0.90 0.84 0.77 0.72 0.67 0.66 0.64 0.61 0.64 0.66 GR+B pr rc 0.92 0.92 0.91 0.90 0.86 0.85 0.80 0.80 0.77 0.78 0.72 0.74 0.72 0.73 0.72 0.70 0.67 0.71 0.72 0.71 0.73 0.71 GR+E rc 0.92 0.91 0.86 0.80 0.76 0.71 0.70 0.69 0.66 0.70 0.69 pr 0.92 0.90 0.86 0.80 0.77 0.73 0.72 0.70 0.70 0.69 0.71 TR TR+B pr 0.88 0.88 0.82 0.76 0.73 0.67 0.65 0.64 0.63 0.64 0.65 rc 0.88 0.90 0.83 0.75 0.70 0.64 0.63 0.61 0.58 0.63 0.63 pr 0.91 0.90 0.86 0.81 0.78 0.74 0.73 0.72 0.71 0.71 0.72 rc 0.91 0.91 0.86 0.80 0.76 0.71 0.72 0.71 0.67 0.70 0.71 TR+E pr 0.90 0.90 0.85 0.80 0.78 0.73 0.70 0.68 0.68 0.68 0.70 rc 0.90 0.92 0.86 0.80 0.76 0.71 0.69 0.67 0.64 0.67 0.68 root 1 2 3 4 5 6 7 8 9 >=10 B.2 Distance to Root GR pr 0.91 0.83 0.81 0.81 0.82 0.82 0.82 0.82 0.82 0.83 0.81 rc 0.91 0.81 0.82 0.82 0.82 0.83 0.83 0.83 0.84 0.81 0.84 GR+B pr rc 0.92 0.92 0.84 0.85 0.85 0.84 0.85 0.85 0.85 0.85 0.86 0.85 0.86 0.84 0.85 0.86 0.85 0.83 0.82 0.83 0.84 0.85 GR+E rc 0.92 0.84 0.84 0.84 0.84 0.85 0.85 0.85 0.84 0.83 0.87 pr 0.92 0.85 0.84 0.84 0.84 0.84 0.84 0.85 0.84 0.84 0.85 TR TR+B pr 0.88 0.81 0.81 0.81 0.81 0.81 0.82 0.81 0.81 0.79 0.80 rc 0.88 0.80 0.81 0.81 0.82 0.83 0.83 0.83 0.83 0.81 0.84 pr 0.91 0.85 0.84 0.85 0.85 0.85 0.85 0.85 0.84 0.84 0.83 rc 0.91 0.84 0.85 0.85 0.85 0.86 0.86 0.86 0.85 0.83 0.85 TR+E pr 0.90 0.84 0.84 0.84 0.85 0.84 0.84 0.85 0.85 0.83 0.83 rc 0.90 0.83 0.84 0.84 0.85 0.85 0.85 0.85 0.85 0.82 0.87 0 1 2 3 4 5 6 7 8 9 >=10 B.3 Projectivity GR pr 0.35 0.83 rc 0.43 0.83 GR+B rc pr 0.36 0.45 0.85 0.86 GR+E rc 0.45 0.85 pr 0.36 0.85 TR TR+B pr 0.48 0.81 rc 0.33 0.82 pr 0.49 0.85 rc 0.37 0.85 TR+E pr 0.52 0.85 rc 0.40 0.85 Non-proj Proj B.4 Part of Speech GR ADJ 0.82 ADP 0.95 ADV 0.78 AUX 0.93 CCONJ 0.85 DET 0.94 INTJ 0.50 NOUN 0.77 NUM 0.83 PART 0.86 PRON 0.83 PROPN 0.79 PUNCT 0.82 SCONJ 0.90 SYM 0.85 VERB 0.76 X 0.64 GR+B GR+E 0.85 0.85 0.96 0.96 0.80 0.80 0.93 0.94 0.87 0.88 0.95 0.95 0.48 0.44 0.81 0.80 0.84 0.84 0.87 0.89 0.86 0.85 0.84 0.82 0.84 0.85 0.93 0.93 0.84 0.84 0.79 0.80 0.67 0.65 TR 0.82 0.95 0.77 0.92 0.84 0.94 0.44 0.76 0.82 0.84 0.82 0.78 0.81 0.89 0.82 0.74 0.64 TR+B TR+E 0.85 0.85 0.96 0.96 0.81 0.80 0.93 0.94 0.86 0.87 0.95 0.95 0.48 0.45 0.80 0.80 0.84 0.84 0.88 0.90 0.86 0.85 0.84 0.83 0.84 0.86 0.93 0.93 0.85 0.86 0.78 0.79 0.68 0.67 B.5 Dependency Relation GR pr acl 0.69 advcl 0.68 advmod 0.77 amod 0.86 appos 0.55 aux 0.95 case 0.95 cc 0.84 ccomp 0.67 clf 0.87 compound 0.85 conj 0.68 cop 0.84 csubj 0.59 dep 0.68 det 0.93 discourse 0.74 dislocated 0.40 expl 0.75 fixed 0.78 flat 0.79 goeswith 0.71 iobj 0.83 list 0.31 mark 0.89 nmod 0.78 nsubj 0.79 nummod 0.87 obj 0.79 obl 0.74 orphan 0.29 parataxis 0.77 punct 0.82 root 0.90 vocative 0.43 xcomp 0.68 rc 0.69 0.69 0.77 0.87 0.54 0.95 0.96 0.85 0.64 0.90 0.84 0.69 0.85 0.51 0.56 0.94 0.61 0.32 0.81 0.72 0.78 0.44 0.81 0.28 0.87 0.78 0.80 0.90 0.80 0.75 0.11 0.70 0.82 0.90 0.28 0.62 GR+B pr rc 0.76 0.75 0.71 0.68 0.78 0.79 0.88 0.89 0.63 0.61 0.95 0.95 0.97 0.96 0.87 0.88 0.67 0.71 0.95 0.94 0.86 0.87 0.75 0.76 0.86 0.86 0.54 0.62 0.74 0.60 0.95 0.94 0.62 0.78 0.32 0.43 0.79 0.82 0.76 0.81 0.83 0.85 0.92 0.31 0.80 0.82 0.32 0.32 0.91 0.91 0.81 0.81 0.83 0.82 0.91 0.88 0.83 0.82 0.77 0.77 0.12 0.31 0.72 0.80 0.85 0.85 0.92 0.92 0.32 0.43 0.71 0.66 GR+E rc 0.73 0.72 0.79 0.90 0.60 0.96 0.96 0.87 0.66 0.92 0.86 0.72 0.87 0.56 0.58 0.95 0.65 0.39 0.81 0.77 0.81 0.44 0.82 0.33 0.91 0.81 0.83 0.91 0.84 0.78 0.11 0.72 0.84 0.92 0.43 0.68 pr 0.73 0.70 0.80 0.89 0.59 0.96 0.96 0.87 0.71 0.92 0.87 0.72 0.87 0.63 0.72 0.94 0.75 0.44 0.79 0.82 0.83 0.68 0.86 0.38 0.91 0.80 0.82 0.88 0.83 0.77 0.35 0.77 0.84 0.92 0.65 0.70 TR TR+B pr 0.66 0.66 0.76 0.85 0.54 0.95 0.95 0.83 0.65 0.89 0.84 0.64 0.83 0.55 0.65 0.92 0.72 0.28 0.75 0.78 0.79 0.61 0.83 0.28 0.88 0.77 0.77 0.87 0.77 0.73 0.21 0.75 0.81 0.90 0.53 0.65 rc 0.66 0.67 0.76 0.87 0.57 0.95 0.95 0.83 0.60 0.87 0.84 0.65 0.84 0.49 0.56 0.93 0.60 0.26 0.79 0.73 0.78 0.28 0.78 0.23 0.87 0.77 0.78 0.89 0.78 0.73 0.10 0.70 0.81 0.88 0.35 0.62 pr 0.75 0.69 0.79 0.88 0.62 0.95 0.96 0.87 0.72 0.95 0.87 0.74 0.85 0.64 0.73 0.95 0.79 0.34 0.79 0.82 0.83 0.84 0.85 0.34 0.91 0.81 0.82 0.88 0.83 0.77 0.35 0.80 0.86 0.92 0.58 0.74 rc 0.75 0.71 0.80 0.89 0.64 0.95 0.97 0.88 0.68 0.94 0.87 0.74 0.86 0.53 0.60 0.95 0.65 0.36 0.83 0.76 0.82 0.41 0.79 0.33 0.91 0.81 0.83 0.92 0.83 0.77 0.13 0.74 0.86 0.91 0.38 0.69 TR+E pr 0.73 0.70 0.80 0.88 0.59 0.96 0.96 0.86 0.71 0.92 0.86 0.71 0.86 0.63 0.69 0.94 0.76 0.35 0.81 0.82 0.82 0.75 0.85 0.41 0.91 0.80 0.81 0.88 0.84 0.77 0.38 0.79 0.84 0.92 0.52 0.73 rc 0.73 0.71 0.80 0.90 0.61 0.96 0.96 0.86 0.68 0.90 0.87 0.70 0.87 0.55 0.57 0.95 0.56 0.44 0.82 0.78 0.82 0.46 0.83 0.36 0.90 0.81 0.82 0.92 0.83 0.78 0.15 0.73 0.84 0.90 0.38 0.70 B.6 Sentence Length GR 83.50 83.50 83.00 81.90 81.70 50+ 78.70 1-10 11-20 21-30 31-40 41-50 GR+B GR+E 84.90 83.40 85.80 86.20 85.50 86.20 84.30 85.20 84.40 83.80 81.50 81.60 TR 81.80 82.10 82.00 81.00 80.70 78.60 TR+B TR+E 84.80 83.40 85.70 86.00 85.10 86.10 84.20 84.90 84.10 83.60 81.70 82.20 C Per-Language Error Analysis
1509.05490
2
1509
2015-09-28T02:21:20
TransA: An Adaptive Approach for Knowledge Graph Embedding
[ "cs.CL" ]
Knowledge representation is a major topic in AI, and many studies attempt to represent entities and relations of knowledge base in a continuous vector space. Among these attempts, translation-based methods build entity and relation vectors by minimizing the translation loss from a head entity to a tail one. In spite of the success of these methods, translation-based methods also suffer from the oversimplified loss metric, and are not competitive enough to model various and complex entities/relations in knowledge bases. To address this issue, we propose \textbf{TransA}, an adaptive metric approach for embedding, utilizing the metric learning ideas to provide a more flexible embedding method. Experiments are conducted on the benchmark datasets and our proposed method makes significant and consistent improvements over the state-of-the-art baselines.
cs.CL
cs
TransA: An Adaptive Approach for Knowledge Graph Embedding Han Xiao1, Minlie Huang1, Hao Yu1, Xiaoyan Zhu1 1Department of Computer Science and Technology, State Key Lab on Intelligent Technology and Systems, National Lab for Information Science and Technology, Tsinghua University, Beijing, China 5 1 0 2 p e S 8 2 ] L C . s c [ 2 v 0 9 4 5 0 . 9 0 5 1 : v i X r a Abstract Knowledge representation is a major topic in AI, and many studies attempt to represent entities and relations of knowl- edge base in a continuous vector space. Among these at- tempts, translation-based methods build entity and relation vectors by minimizing the translation loss from a head en- tity to a tail one. In spite of the success of these methods, translation-based methods also suffer from the oversimplified loss metric, and are not competitive enough to model vari- ous and complex entities/relations in knowledge bases. To address this issue, we propose TransA, an adaptive metric approach for embedding, utilizing the metric learning ideas to provide a more flexible embedding method. Experiments are conducted on the benchmark datasets and our proposed method makes significant and consistent improvements over the state-of-the-art baselines. Introduction Knowledge graphs such as Wordnet (Miller 1995) and Free- base (Bollacker et al. 2008) play an important role in AI re- searches and applications. Recent researches such as query expansion prefer involving knowledge graphs (Bao et al. 2014) while some industrial applications such as question answering robots are also powered by knowledge graphs (Fader, Zettlemoyer, and Etzioni 2014). However, knowl- edge graphs are symbolic and logical, where numerical ma- chine learning methods could hardly be applied. This dis- advantage is one of the most important challenges for the usage of knowledge graph. To provide a general paradigm to support computing on knowledge graph, various knowl- edge graph embedding methods have been proposed, such as TransE (Bordes et al. 2013), TransH (Wang et al. 2014) and TransR (Lin et al. 2015). Embedding is a novel approach to address the represen- tation and reasoning problem for knowledge graph. It trans- forms entities and relations into continuous vector spaces, where knowledge graph completion and knowledge classi- fication can be done. Most commonly, knowledge graph is composed by triples (h, r, t) where a head entity h, a rela- tion r and a tail entity t are presented. Among all the pro- posed embedding approaches, geometry-based methods are an important branch, yielding the state-of-the-art predictive Copyright c(cid:13) 2015, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: Visualization of TransE embedding vectors for Freebase with PCA dimension reduction. The navy crosses are the matched tail entities for an actor’s award nominee, while the red circles are the unmatched ones. TransE ap- plies Euclidean metric and spherical equipotential surfaces, so it must make seven mistakes as (a) shows. Whilst TransA takes advantage of adaptive Mahalanobis metric and ellipti- cal equipotential surfaces in (b), four mistakes are avoided. performance. More specifically, geometry-based embedding methods represent an entity or a relation as k-dimensional vector, then define a score function fr(h, t) to measure the plausibility of a triple (h, r, t). Such approaches almost fol- low the same geometric principle h + r ≈ t and apply the same loss metric h + r − t2 2 but differ in the relation space where a head entity h connects to a tail entity t. However, the loss metric in translation-based models is oversimplified. This flaw makes the current embedding methods incompetent to model various and complex enti- ties/relations in knowledge base. Firstly, due to the inflexibility of loss metric, cur- rent translation-based methods apply spherical equipoten- tial hyper-surfaces with different plausibilities, where more near to the centre, more plausible the triple is. As illustrated in Fig.1, spherical equipotential hyper-surfaces are applied in (a), so it is difficult to identify the matched tail entities from the unmatched ones. As a common sense in knowledge graph, complex relations, such as one-to-many, many-to-one and many-to-many relations, always lead to complex em- bedding topologies. Though complex embedding situation is Related Work We classify prior studies into two lines: one is the translation-based embedding methods and the other includes many other embedding methods. Translation-Based Embedding Methods All the translation-based methods share a common princi- ple h + r ≈ t, but differ in defining the relation-related space where a head entity h connects to a tail entity t. This principle indicates that t should be the nearest neighbour of (h + r). Hence, the translation-based methods all have the same form of score function that applies Euclidean distance to measure the loss, as follows: fr(h, t) = hr + r − tr2 2 nal space, say hr = h, tr = t. r hwr, tr = t − w(cid:62) where hr, tr are the entity embedding vectors projected in the relation-specific space. Note that this branch of methods keeps the state-of-the-art performance. • TransE (Bordes et al. 2013) lays the entities in the origi- • TransH (Wang et al. 2014) projects the entities into a hy- perplane for addressing the issue of complex relation em- bedding, say hr = h − w(cid:62) • TransR (Lin et al. 2015) transforms the entities by the same matrix to also address the issue of complex relation embedding, as: hr = Mrh, tr = Mrt. Projecting entities into different hyperplanes or trans- forming entities by different matrices allow entities to play different roles under different embedding situations. How- ever, as the “Introduction” argues, these methods are incom- petent to model complex knowledge graphs well and partic- ularly perform unsatisfactorily in various and complex enti- ties/relations situation, because of the oversimplified metric. TransM (Fan et al. 2014) pre-calculates the distinct r twr. weight for each training triple to perform better. Other Embedding Methods There are also many other models for knowledge graph em- bedding. Unstructured Model (UM). The UM (Bordes et al. 2012) is a simplified version of TransE by setting all the re- lation vectors to zero r = 0. Obviously, relation is not con- sidered in this model. Structured Embedding (SE). The SE model (Bordes et al. 2011) applies two relation-related matrices, one for head and the other for tail. The score function is defined as fr(h, t) = Mh,rh − Mt,rt2 2. According to (Socher et al. 2013), this model cannot capture the relationship among en- tities and relations. Single Layer Model (SLM). SLM applies neural net- work to knowledge graph embedding. The score function is defined as fr(h, t) = u(cid:62) r g(Mr,1h + Mr,2t) Figure 2: Specific illustration of weighting dimensions. The data are selected from Wordnet. The solid dots are cor- rect matches while the circles are not. The arrows indicate HasPart relation. (a) The incorrect circles are matched, due to the isotropic Euclidean distance. (b) By weighting embed- ding dimensions, we up-weighted y-axis component of loss and down-weighted x-axis component of loss, thus the em- beddings are refined because the correct ones have smaller loss in x-axis direction. an urgent challenge, spherical equipotential hyper-surfaces are not flexible enough to characterise the topologies, mak- ing current translation-based methods incompetent for this task. Secondly, because of the oversimplified loss metric, cur- rent translation-based methods treat each dimension iden- tically. This observation leads to a flaw illustrated in Fig.2. As each dimension is treated identically in (a)1, the incorrect entities are matched, because they are closer than the correct ones, measured by isotropic Euclidean distance. Therefore, we have a good reason to conjecture that a relation could only be affected by several specific dimensions while the other unrelated dimensions would be noisy. Treating all the dimensions identically involves much noises and degrades the performance. Motivated by these two issues, in this paper, we propose TransA, an embedding method by utilizing an adaptive and flexible metric. First, TransA applies elliptical surfaces in- stead of spherical surfaces. By this mean, complex embed- ding topologies induced by complex relations could be rep- resented better. Then, as analysed in “Adaptive Metric Ap- proach”, TransA could be treated as weighting transformed feature dimensions. Thus, the noise from unrelated dimen- sions is suppressed. We demonstrate our ideas in Fig.1 (b) and Fig.2 (b). To summarize, TransA takes the adaptive metric ideas for better knowledge representation. Our method effectively models various and complex entities/relations in knowledge base, and outperforms all the state-of-the-art baselines with significant improvements in experiments. The rest of the paper is organized as follows: we sur- vey the related researches and then introduce our approach, along with the theoretical analysis. Next, the experiments are present and at the final part, we summarize our paper. 1The dash lines indicate the x-axis component of the loss (hx + rx − tx) and the y-axis component of the loss (hy + ry − ty). Note that SLM is a special case of NTN when the zero ten- sors are applied. (Collobert and Weston 2008) had proposed a similar method but applied this approach into the language model. Semantic Matching Energy (SME). The SME model (Bordes et al. 2012) (Bordes et al. 2014) attempts to cap- ture the correlations between entities and relations by ma- trix product and Hadamard product. The score functions are defined as follows: fr = (M1h + M2r + b1)(cid:62)(M3t + M4r + b2) fr = (M1h ⊗ M2r + b1)(cid:62)(M3t ⊗ M4r + b2) where M1, M2, M3 and M4 are weight matrices, ⊗ is the Hadamard product, b1 and b2 are bias vectors. In some re- cent work (Bordes et al. 2014), the second form of score function is re-defined with 3-way tensors instead of matri- ces. Latent Factor Model (LFM). The LFM (Jenatton et al. 2012) uses the second-order correlations between entities by a quadratic form, defined as fr(h, t) = h(cid:62)Wrt. Neural Tensor Network (NTN). The NTN model (Socher et al. 2013) defines an expressive score function for graph embedding to joint the SLM and LFM. fr(h, t) = u(cid:62) where ur is a relation-specific linear layer, g(·) is the tanh function, Wr ∈ Rd×d×k is a 3-way tensor. However, the high complexity of NTN may degrade its applicability to large-scale knowledge bases. r g(h(cid:62)W··rt + Mr,1h + Mr,2t + br) RESCAL. is a collective matrix factorization model as a common embedding method. (Nickel, Tresp, and Kriegel 2011) (Nickel, Tresp, and Kriegel 2012). Semantically Smooth Embedding (SSE). (Guo et al. 2015) aims at leveraging the geometric structure of em- bedding space to make entity representations semantically smooth. (Wang et al. 2014) jointly embeds knowledge and texts. (Wang, Wang, and Guo 2015) involves the rules into em- bedding. (Lin, Liu, and Sun 2015) considers the paths of knowledge graph into embedding. Adaptive Metric Approach In this section, we would introduce the adaptive metric ap- proach, TransA, and present the theoretical analysis from two perspectives. Adaptive Metric Score Function As mentioned in “Introduction”, all the translation-based methods obey the same principle h + r ≈ t, but they differ in the relation-specific spaces where entities are projected into. Thus, such methods share a similar score function. fr(h, t) = h + r − t2 2 = (h + r − t)(cid:62)(h + r − t) (1) This score function is actually Euclidean metric. The disad- vantages of the oversimplified metric have been discussed in “Introduction”. As a consequence, the proposed TransA replaces inflexible Euclidean distance with adaptive Maha- lanobis distance of absolute loss, because Mahalanobis dis- tance is more flexible and more adaptive (Wang and Sun 2014). Thus, our score function is as follows: fr(h, t) = (h + r − t)(cid:62)Wr(h + r − t) (2) = (h1 + r1− t1,h2 + r2− t2, ...,hn + where h + r − t . rn − tn) and Wr is a relation-specific symmetric non- negative weight matrix that corresponds to the adaptive metric. Different from the traditional score functions, we take the absolute value, since we want to measure the ab- solute loss between (h + r) and t. Furthermore, we would list two main reasons for the applied absolute operator. On one hand, the absolute operator makes the score function as a well-defined norm only under the condi- tion that all the entries of Wr are non-negative. A well- defined norm is necessary for most metric learning scenes (Kulis 2012), and the non-negative condition could be achieved more easily than PSD, so it generalises the com- mon metric learning algebraic form for better render- ing the knowledge topologies. Expanding our score func- = h + r − t. Obviously, Nr is non-negative, identical and . e absolute homogeneous. Besides with the easy-to-verified tion as an induced norm Nr(e) = (cid:112)fr(h, t) where inequality Nr(e1 + e2) = (cid:112)e1 + e2(cid:62)Wre1 + e2 ≤ (cid:112)e1(cid:62)Wre1+(cid:112)e2(cid:62)Wre2 = Nr(e1)+Nr(e2), the triangle inequality is hold. Totally, absolute operators make the metric a norm with an easy-to-achieve condition, helping to generalise the representation ability. On the other hand, in geometry, negative or positive val- ues indicate the downward or upward direction, while in our approach, we do not consider this factor. Let’s see an in- stance as shown in Fig.2. For the entity Goniff, the x-axis component of its loss vector is negative, thus enlarging this component would make the overall loss smaller, while this case is supposed to make the overall loss larger. As a result, absolute operator is critical to our approach. For a numerical example without absolute operator, when the embedding di- mension is two, weight matrix is [0 1; 1 0] and the loss vector (h + r − t) = (e1, e2), the overall loss would be 2e1e2. If e1 ≥ 0 and e2 ≤ 0, much absolute larger e2 would reduce the overall loss and this is not desired. Perspective from Equipotential Surfaces TransA shares almost the same geometric explanations with other translation-based methods, but they differ in the loss metric. For other translation-based methods, the equipoten- tial hyper-surfaces are spheres as the Euclidean distance de- fines: (t − h) − r2 2 = C (3) where C means the threshold or the equipotential value. However, for TransA, the equipotential hyper-surfaces are elliptical surfaces as the Mahalanobis distance of absolute loss states (Kulis 2012): (t − h) − r(cid:62)Wr(t − h) − r = C (4) Note that the elliptical hyper-surfaces would be distorted a bit as the absolute operator applied, but this makes no differ- ence for analysing the performance of TransA. As we know, different equipotential hyper-surfaces correspond to differ- ent thresholds and different thresholds decide whether the triples are correct or not. Due to the practical situation that our knowledge base is large-scale and very complex, the topologies of embedding cannot be distributed as uniform as spheres, justified by Fig.1. Thus, replacing the spherical equipotential hyper-surfaces with the elliptical ones would enhance the embedding. As Fig.1 illustrated, TransA would perform better for one- to-many relations. The metric of TransA is symmetric, so it is reasonable that TransA would also perform better for many-to-one relations. Moreover, a many-to-many relation could be treated as both a many-to-one and a one-to-many relation. Generally, TransA would perform better for all the complex relations. Perspective from Feature Weighting TransA could be regarded as weighting transformed fea- tures. For weight matrix Wr that is symmetric, we ob- tain the equivalent unique form by LDL Decomposition (Golub and Van Loan 2012) as follows: Wr = L(cid:62) r DrLr fr = (Lrh + r − t)(cid:62)Dr(Lrh + r − t) (5) (6) Wr = + be defined as follows: min (cid:88) (cid:88) (cid:32)(cid:88) (h,r,t)∈∆ r∈R λ [Wr]ij ≥ 0 (cid:33) (h(cid:48),r(cid:48),t(cid:48))∈∆(cid:48) Wr2 F + C (cid:32)(cid:88) e∈E [fr(h, t) + γ − fr(cid:48)(h(cid:48), t(cid:48))]+ + (cid:33) (cid:88) r∈R e2 2 + r2 2 . = max(0, (7) s.t. where [ · ]+ · ), ∆ is the set of golden triples and ∆(cid:48) is the set of incorrect ones, γ is the margin that sepa- rates the positive and negative triples. · F is the F-norm of matrix. C controls the scaling degree, and λ controls the regularization of adaptive weight matrix. The E means the set of entities and the R means the set of relations. At each round of training process, Wr could be worked out directly by setting the derivation to zero. Then, in order to ensure the non-negative condition of Wr, we set all the negative entries of Wr to zero. − (cid:88) (cid:88) (h,r,t)∈∆ (h(cid:48),r(cid:48),t(cid:48))∈∆(cid:48) (cid:16)h + r − th + r − t(cid:62)(cid:17) (cid:16)h(cid:48) + r(cid:48) − t(cid:48)h(cid:48) + r(cid:48) − t(cid:48)(cid:62)(cid:17) (8) In above equations, Lr can be viewed as a transformation matrix, which transforms the loss vector h + r − t to an- other space. Furthermore, Dr = diag(w1, w2, w3....) is a diagonal matrix and different embedding dimensions are weighted by wi. As analysed in “Introduction”, a relation could only be af- fected by several specific dimensions while the other dimen- sions would be noisy. Treating different dimensions identi- cally in current translation-based methods can hardly sup- press the noise, consequently working out an unsatisfactory performance. We believe that different dimensions play dif- ferent roles, particularly when entities are distributed di- vergently. Unlike existing methods, TransA can automat- ically learn the weights from the data. This may explain why TransA outperforms TransR although both TransA and TransR transform the entity space with matrices. Connection to Previous Works Regarding TransR that rotates and scales the embedding spaces, TransA holds two advantages against it. Firstly, we weight feature dimensions to avoid the noise. Secondly, we loosen the PSD condition for a flexible representation. Re- garding TransM that weights feature dimensions using pre- computed coefficients, TransA holds two advantages against it. Firstly, we learn the weights from the data, which makes the score function more adaptive. Secondly, we apply the feature transformation that makes the embedding more ef- fective. Training Algorithm To train the model, we use the margin-based ranking error. Taking other constraints into account, the target function can As to the complexity of our model, the weight matrix is completely calculated by the existing embedding vectors, which means TransA almost has the same free parameter number as TransE. As to the efficiency of our model, the weight matrix has a closed solution, which speeds up the training process to a large extent. Experiments We evaluate the proposed model on two benchmark tasks: link prediction and triples classification. Experiments are conducted on four public datasets that are the subsets of Wordnet and Freebase. The statistics of these datasets are listed in Tab.1. ATPE is short for “Averaged Triple number Per En- tity”. This quantity measures the diversity and complexity of datasets. Commonly, more triples lead to more complex structures of knowledge graph. To express the more com- plex structures, entities would be distributed variously and complexly. Overall, embedding methods produce less satis- factory results in the datasets with higher ATPE, because a large ATPE means a various and complex entities/relations embedding situation. Link Prediction Link prediction aims to predict a missing entity given the other entity and the relation. In this task, we predict t given (h, r,∗), or predict h given (∗, r, t). The WN18 and FB15K datasets are the benchmark datasets for this task. Evaluation Protocol. We follow the same protocol as used in TransE (Bordes et al. 2013), TransH (Wang et al. 2014) and TransR (Lin et al. 2015). For each testing triple (h, r, t), we replace the tail t by every entity e in the knowl- edge graph and calculate a dissimilarity score with the score Datasets Metric SE(Bordes et al. 2011) SME (Bordes et al. 2012) LFM (Jenatton et al. 2012) TransE (Bordes et al. 2013) TransH (Wang et al. 2014) TransR (Lin et al. 2015) Adaptive Metric (PSD) TransA Table 2: Evaluation results on link prediction WN18 FB15K HITS@10(%) Mean Rank Mean Rank Raw 1,011 545 469 263 401 238 289 405 Filter Raw 68.5 985 533 65.1 71.4 456 75.4 251 73.0 388 225 79.8 77.6 278 82.3 392 Raw Filter Raw 28.8 273 274 30.7 26.0 283 34.9 243 45.7 212 198 48.2 52.4 172 155 56.1 162 154 164 125 87 77 88 74 HITS@10(%) Filter 39.8 40.8 33.1 47.1 64.4 68.7 74.2 80.4 Filter 80.5 74.1 81.6 89.2 82.3 92.0 89.6 94.3 Data #Rel #Ent #Train #Valid #Test ATPE 2 Table 1: Statistics of datasets WN18 WN11 FB15K 1,345 14,951 483,142 50,000 59,071 39.61 18 40,943 141,442 5,000 5,000 3.70 FB13 13 75,043 316,232 5,908 23,733 4.61 11 38,696 112,581 2,609 10,544 3.25 function fr(h, e) for the corrupted triple (h, r, e). Ranking these scores in ascending order, we then get the rank of the original correct triple. There are two metrics for evaluation: the averaged rank (Mean Rank) and the proportion of test- ing triples, whose ranks are not larger than 10 (HITS@10). This is called “Raw” setting. When we filter out the cor- rupted triples that exist in all the training, validation and test datasets, this is the“Filter” setting. If a corrupted triple exists in the knowledge graph, ranking it before the original triple is acceptable. To eliminate this issue, the “Filter” setting is more preferred. In both settings, a lower Mean Rank or a higher HITS@10 is better. Implementation. As the datasets are the same, we di- rectly copy the experimental results of several baselines from the literature, as in (Bordes et al. 2013), (Wang et al. 2014) and (Lin et al. 2015). We have tried several settings on the validation dataset to get the best configuration for both Adaptive Metric (PSD) and TransA. Under the “bern.” sampling strategy, the optimal configurations are: learning rate α = 0.001, embedding dimension k = 50, γ = 2.0, C = 0.2 on WN18; α = 0.002, k = 200, γ = 3.2, and C = 0.2 on FB15K. Results. Evaluation results on WN18 and FB15K are re- ported in Tab.2 and Tab.3, respectively. We can conclude that: 1. TransA outperforms all the baselines significantly and justifies the effectiveness of consistently. This result TransA. 2ATPE:Averaged Triple number Per Entity. Triples are summed up from all the #Train, #Valid and #Test. 2. FB15K is a very various and complex entities/relations embedding situation, because its ATPE is absolutely high- est among all the datasets. However, TransA performs better than other baselines on this dataset, indicating that TransA performs better in various and complex en- tities/relations embedding situation. WN18 may be less complex than FB15K because of a smaller ATPE. Com- pared to TransE, the relative improvement of TransA on WN18 is 5.7% while that on FB15K is 95.2%. This com- parison shows TransA has more advantages in the various and complex embedding environment. 3. TransA promotes the performance for 1-1 relations, which means TransA generally promotes the performance on simple relations. TransA also promotes the performance for 1-N, N-1, N-N relations3, which demonstrates TransA works better for complex relation embedding. 4. Compared to TransR, better performance of TransA means the feature weighting and the generalised metric form leaded by absolute operators, have significant bene- fits, as analysed. 5. Compared to Adaptive Metric (PSD) which applies the score function fr(h, t) = (h + r − t)(cid:62)Wr(h + r − t) and constrains Wr as PSD, TransA is more competent, because our score function with non-negative matrix con- dition and absolute operator produces a more flexible rep- resentation than that with PSD matrix condition does, as analysed in “Adaptive Metric Approach”. 6. TransA performs bad in Mean Rank on WN18 dataset. Digging into the detailed situation, we discover there are 27 testing triples (0.54% of the testing set) whose ranks are more than 30,000, and these few cases would make about 162 mean rank loss. The tail or head entity of all these triples have never been co-occurring with the corre- sponding relation in the training set. It is the insufficient training data that leads to the over-distorted weight matrix and the over-distorted weight matrix is responsible for the bad Mean Rank. 3Mapping properties of relations follow the same rules in (Bor- des et al. 2013). Table 3: Evaluation results on FB15K by mapping properties of relations(%) Tasks Relation Category SE(Bordes et al. 2011) SME (Bordes et al. 2012) TransE (Bordes et al. 2013) TransH (Wang et al. 2014) TransR (Lin et al. 2015) TransA Predicting Head(HITS@10) N-N 1-1 37.5 35.6 40.3 35.1 43.7 47.2 64.5 66.8 69.2 78.8 86.8 77.8 1-N N-1 17.2 62.6 19.0 53.7 65.7 18.2 28.7 87.6 34.1 89.2 95.4 42.7 Predicting Tail(HITS@10) N-N 1-1 41.3 34.9 43.3 32.7 43.7 50.0 67.2 65.5 72.1 79.2 86.7 80.6 1-N N-1 68.3 14.6 61.6 14.9 19.7 66.7 83.3 39.8 90.4 37.4 54.3 94.4 Table 4: Triples classification: accuracies(%) for different embedding methods Methods LFM NTN TransE TransH TransR Adaptive Metric (PSD) TransA WN11 73.8 70.4 75.9 78.8 85.9 81.4 83.2 FB13 Avg. 79.0 84.3 78.8 87.1 78.7 81.5 83.3 81.1 84.2 82.5 84.3 87.1 87.3 85.3 Triples Classification Triples classification is a classical task in knowledge base embedding, which aims at predicting whether a given triple (h, r, t) is correct or not. Our evaluation protocol is the same as prior studies. Besides, WN11 and FB13 are the bench- mark datasets for this task. Evaluation of classification needs negative labels. The datasets have already been built with negative triples, where each correct triple is corrupted to get one negative triple. Evaluation Protocol. The decision rule is as follows: for a triple (h, r, t), if fr(h, t) is below a threshold σr, then posi- tive; otherwise negative. The thresholds {σr} are determined on the validation dataset. The final accuracy is based on how many triples are classified correctly. Implementation. As all methods use the same datasets, we directly copy the results of different methods from the literature. We have tried several settings on the validation dataset to get the best configuration for both Adaptive Metric (PSD) and TransA. The optimal configurations are: “bern” sampling, α = 0.02, k = 50, γ = 10.0, C = 0.2 on WN11, and “bern” sampling, α = 0.002, k = 200, γ = 3.0, C = 0.00002 on FB13. Results. Accuracies are reported in Tab.4 and Fig.3. Ac- cording to “Adaptive Metric Approach” section, we could work out the weights by LDL Decomposition for each relation. Because the minimal weight is too small to make a significant analysis, we choose the median one to rep- resent relative small weight. Thus, “Weight Difference” is . Bigger the calculated by weight difference is, more significant effect, the feature weighting makes. Notably, scaling by the median weight (cid:16) M aximalW eight−M edianW eight M edianW eight (cid:17) Figure 3: Triples classification accuracies for each relation on WN11(left) and FB13(right). The “weight difference” is worked out by the scaled difference between maximal and median weight. makes the weight differences comparable to each other. We observe that: 1. Overall, TransA yields the best average accuracy, illus- trating the effectiveness of TransA. 2. Accuracies vary with the weight difference, meaning the feature weighting benefits the accuracies. This proves the theoretical analysis and the effectiveness of TransA. 3. Compared to Adaptive Metric (PSD) , TransA performs better, because our score function with non-negative ma- trix condition and absolute operator leads to a more flex- ible representation than that with PSD matrix condition does. Conclusion In this paper, we propose TransA, a translation-based knowl- edge graph embedding method with an adaptive and flex- ible metric. TransA applies elliptical equipotential hyper- surfaces to characterise the embedding topologies and weights several specific feature dimensions for a relation to avoid much noise. Thus, our adaptive metric approach could effectively model various and complex entities/relations in knowledge base. Experiments are conducted with two benchmark tasks and the results show TransA achieves con- sistent and significant improvements over the current state- of-the-art baselines. To reproduce our results, our codes and data will be published in github. [Lin, Liu, and Sun 2015] Lin, Y.; Liu, Z.; and Sun, M. 2015. Modeling relation paths for representation learning of knowledge bases. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics. [Miller 1995] Miller, G. A. 1995. Wordnet: a lexi- cal database for english. Communications of the ACM 38(11):39–41. [Nickel, Tresp, and Kriegel 2011] Nickel, M.; Tresp, V.; and Kriegel, H.-P. 2011. A three-way model for collective learn- ing on multi-relational data. In Proceedings of the 28th inter- national conference on machine learning (ICML-11), 809– 816. [Nickel, Tresp, and Kriegel 2012] Nickel, M.; Tresp, V.; and Kriegel, H.-P. 2012. Factorizing yago: scalable machine learning for linked data. In Proceedings of the 21st interna- tional conference on World Wide Web, 271–280. ACM. [Socher et al. 2013] Socher, R.; Chen, D.; Manning, C. D.; and Ng, A. 2013. Reasoning with neural tensor networks for knowledge base completion. In Advances in Neural In- formation Processing Systems, 926–934. [Wang and Sun 2014] Wang, F., and Sun, J. 2014. Survey on distance metric learning and dimensionality reduction in data mining. Data Mining and Knowledge Discovery 1–31. [Wang et al. 2014] Wang, Z.; Zhang, J.; Feng, J.; and Chen, Z. 2014. Knowledge graph embedding by translating on hy- perplanes. In Proceedings of the Twenty-Eighth AAAI Con- ference on Artificial Intelligence, 1112–1119. [Wang, Wang, and Guo 2015] Wang, Q.; Wang, B.; and Guo, L. 2015. Knowledge base completion using embeddings In Proceedings of the 24th International Joint and rules. Conference on Artificial Intelligence. References [Bao et al. 2014] Bao, J.; Duan, N.; Zhou, M.; and Zhao, T. 2014. Knowledge-based question answering as machine translation. Cell 2:6. [Bollacker et al. 2008] Bollacker, K.; Evans, C.; Paritosh, P.; Sturge, T.; and Taylor, J. 2008. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international con- ference on Management of data, 1247–1250. ACM. [Bordes et al. 2011] Bordes, A.; Weston, J.; Collobert, R.; Bengio, Y.; et al. 2011. Learning structured embeddings of knowledge bases. In Proceedings of the Twenty-fifth AAAI Conference on Artificial Intelligence. [Bordes et al. 2012] Bordes, A.; Glorot, X.; Weston, J.; and Bengio, Y. 2012. Joint learning of words and meaning representations for open-text semantic parsing. In Interna- tional Conference on Artificial Intelligence and Statistics, 127–135. [Bordes et al. 2013] Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; and Yakhnenko, O. 2013. Translating em- beddings for modeling multi-relational data. In Advances in Neural Information Processing Systems, 2787–2795. [Bordes et al. 2014] Bordes, A.; Glorot, X.; Weston, J.; and Bengio, Y. 2014. A semantic matching energy function for learning with multi-relational data. Machine Learning 94(2):233–259. [Collobert and Weston 2008] Collobert, R., and Weston, J. 2008. A unified architecture for natural language process- ing: Deep neural networks with multitask learning. In Pro- ceedings of the 25th international conference on Machine learning, 160–167. ACM. [Fader, Zettlemoyer, and Etzioni 2014] Fader, A.; Zettle- moyer, L.; and Etzioni, O. 2014. Open question answering In Proceed- over curated and extracted knowledge bases. ings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, 1156–1165. ACM. [Fan et al. 2014] Fan, M.; Zhou, Q.; Chang, E.; and Zheng, T. F. 2014. Transition-based knowledge graph embedding In Proceedings of the with relational mapping properties. 28th Pacific Asia Conference on Language, Information, and Computation, 328–337. [Golub and Van Loan 2012] Golub, G. H., and Van Loan, C. F. 2012. Matrix computations, volume 3. JHU Press. [Guo et al. 2015] Guo, S.; Wang, Q.; Wang, B.; Wang, L.; and Guo, L. 2015. Semantically smooth knowledge graph embedding. In Proceedings of ACL. [Jenatton et al. 2012] Jenatton, R.; Roux, N. L.; Bordes, A.; and Obozinski, G. R. 2012. A latent factor model for highly In Advances in Neural Information multi-relational data. Processing Systems, 3167–3175. [Kulis 2012] Kulis, B. 2012. Metric learning: A survey. Foundations & Trends in Machine Learning 5(4):287–364. [Lin et al. 2015] Lin, Y.; Liu, Z.; Sun, M.; Liu, Y.; and Zhu, X. 2015. Learning entity and relation embeddings for knowledge graph completion. In Proceedings of the Twenty- Ninth AAAI Conference on Artificial Intelligence.
1908.11355
1
1908
2019-08-29T17:12:04
Human-grounded Evaluations of Explanation Methods for Text Classification
[ "cs.CL", "cs.AI", "cs.LG" ]
Due to the black-box nature of deep learning models, methods for explaining the models' results are crucial to gain trust from humans and support collaboration between AIs and humans. In this paper, we consider several model-agnostic and model-specific explanation methods for CNNs for text classification and conduct three human-grounded evaluations, focusing on different purposes of explanations: (1) revealing model behavior, (2) justifying model predictions, and (3) helping humans investigate uncertain predictions. The results highlight dissimilar qualities of the various explanation methods we consider and show the degree to which these methods could serve for each purpose.
cs.CL
cs
Human-grounded Evaluations of Explanation Methods for Text Classification Piyawat Lertvittayakumjorn and Francesca Toni Department of Computing Imperial College London, UK {pl1515, ft}@imperial.ac.uk 9 1 0 2 g u A 9 2 ] L C . s c [ 1 v 5 5 3 1 1 . 8 0 9 1 : v i X r a Abstract Due to the black-box nature of deep learn- ing models, methods for explaining the mod- els' results are crucial to gain trust from hu- mans and support collaboration between AIs and humans. In this paper, we consider sev- eral model-agnostic and model-specific expla- nation methods for CNNs for text classifica- tion and conduct three human-grounded eval- uations, focusing on different purposes of ex- planations: (1) revealing model behavior, (2) justifying model predictions, and (3) help- ing humans investigate uncertain predictions. The results highlight dissimilar qualities of the various explanation methods we consider and show the degree to which these methods could serve for each purpose. Introduction 1 Explainable Artificial Intelligence (XAI) is aimed at providing explanations for decisions made by AI systems. The explanations are useful for sup- porting collaboration between AIs and humans in many cases (Samek et al., 2018). Firstly, if an AI outperforms humans in a certain task (e.g., Al- phaGo (Silver et al., 2016)), humans can learn and distill knowledge from the given explanations. Secondly, if an AI's performance is close to hu- man intelligence, the explanations can increase humans' confidence and trust in the AI (Symeoni- dis et al., 2009). Lastly, if an AI is duller than humans, the explanations help humans verify the decisions made by the AI and also improve the AI (Biran and McKeown, 2017). One of the challenges in XAI is to explain prediction results given by deep learning mod- els, which sacrifice transparency for high predic- tion performance. This type of explanations is called local explanations as they explain individ- ual predictions (in contrast to global explanations which explain the trained model independently of any specific prediction). There have been several methods proposed to produce local explanations. Some of them are model-agnostic, applicable to any machine learning model (Ribeiro et al., 2016; Lundberg and Lee, 2017). Others are applicable to a class of models such as neural networks (Bach et al., 2015a; Dimopoulos et al., 1995) or to a specific model such as Convolutional Neural Net- works (CNNs) (Zhou et al., 2016). With so many explanation methods available, the next challenge is how to evaluate them so as to choose the right methods for different settings. In this paper, we focus on human-grounded evalu- ations of local explanation methods for text classi- fication. Particularly, we propose three evaluation tasks which target different purposes of explana- tions for text classification -- (1) revealing model behavior to human users, (2) justifying the predic- tions, and (3) helping humans investigate uncer- tain predictions. We then use the proposed tasks to evaluate nine explanation methods working on a standard CNN for text classification. These ex- planation methods are different in several aspects. For example, regarding granularity, four expla- nation methods select words from the input text as explanations, whereas the other five select n- grams as explanations. In terms of generality, one of the explanation methods is model-agnostic, two are random baselines, another two (newly pro- posed in this paper) are specific to 1D CNNs for text classification, and the rest are applicable to neural networks in general. Overall, the contribu- tions of our work can be summarized as follows. • We propose three human-grounded evalua- tion tasks to assess the quality of explanation methods with respect to different purposes of usage for text classification. (Section 3) • To increase diversity in the experiments, we develop two new explanation methods for CNNs for text classification. One is based on gradient-based analysis (Grad-CAM-Text). The other is based on model extraction using decision trees. (Section 4.3.1-4.3.2) • We evaluate both new methods as well as random baselines and well-known existing methods using the three evaluation tasks pro- posed. The results highlight dissimilar quali- ties of the explanation methods and show the degree to which these methods could serve for each purpose. (Section 5) 1.1 Terminology Used We use the following terms throughout the paper. (1) Model: a deep learning classifier we want to explain, e.g., a CNN. (2) Explanation: an or- dered list of text fragments (words or n-grams) in the input text which are most relevant to a predic- tion. Explanations for and against the predicted class are called evidence and counter-evidence, respectively. (3) (Local) explanation method: a method producing an explanation for a model and an input text. (4) Evaluation method: a process to quantitatively assign to explanations scores which reflect the quality of the explanation method. 2 Background and Related Work This section discusses recent advances of explana- tion methods and evaluation for text classification as well as background knowledge about 1D CNNs -- the model used in the experiments. 2.1 Local Explanation Methods Generally, there are several ways to explain a re- sult given by a deep learning model, such as ex- plaining by examples (Kim et al., 2014) and gen- erating textual explanations (Liu et al., 2019). For text classification in particular, most of the exist- ing explanation methods identify parts of the in- put text which contribute most towards the pre- dicted class (so called attribution methods or rel- evance methods) by exploiting various techniques such as input perturbation (Li et al., 2016), gradi- ent analysis (Dimopoulos et al., 1995), and rele- vance propagation (Arras et al., 2017b). Besides, there are other explanation methods designed for specific deep learning architectures such as atten- tion mechanism (Ghaeini et al., 2018) and extrac- tive rationale generation (Lei et al., 2016). We select some well-known explanation meth- ods (which are applicable to CNNs for text classi- fication) and evaluate them together with two new explanation methods proposed in this paper. 2.2 Evaluation Methods Focusing on text classification, early works eval- uated explanation methods by word deletion -- gradually deleting words from the input text in the order of their relevance and checking how the prediction confidence drops (Arras et al., 2016; Nguyen, 2018). Arras et al. (2017a) and Xiong et al. (2018) used relevance scores gen- erated by explanation methods to construct doc- ument vectors by weighted-averaging word vec- tors and checked how well traditional machine learning techniques manage these document vec- tors. Poerner et al. (2018) proposed two evaluation paradigms -- hybrid documents and morphosyntac- tic agreements. Both check whether an explana- tion method correctly points to the (known) root cause of the prediction. Note that all of the afore- mentioned evaluation methods are conducted with no humans involved. For human-grounded evaluation, Mohseni and Ragan (2018) proposed a benchmark which con- tains a list of relevant words for the actual class of each input text, identified by human experts. How- ever, comparing human explanations with the ex- planations given by the tested method may be in- appropriate since the mismatches could be due to not only the poor explanation method but also the inaccuracy of the model or the model reasoning differently from humans. Nguyen (2018) asked humans to guess the output of a text classifier, given an input text with the highest relevant words highlighted by the tested explanation method. In- formative (and discriminative) explanations will lead to humans' correct guesses. Ribeiro et al. (2016) asked humans to choose a model which can generalize better by considering their local expla- nations. Also, they let humans remove irrelevant words, existing in the explanations, from the cor- pus to improve the prediction performance. Com- pared to previous work, our work is more compre- hensive in terms of the various human-grounded evaluation tasks proposed and the number and di- mensions of explanation methods being evaluated. 2.3 CNNs for Text Classification CNNs have been found to achieve promising re- sults in many text classification tasks (Johnson and Zhang, 2015; Gamback and Sikdar, 2017; Zhang et al., 2019). Figure 1 shows a standard 1D CNN If the performance of the two models is clearly different, good explanation methods should en- able humans to notice the poor model, which is more likely to decide based on non-discriminative words, even though both models predict the same class for an input text. Additionally, there are some important points to note for this task. First, the chosen input texts must be classified into the same class by both mod- els so the humans make decisions based only on the different explanations. However, it is worth to consider both the cases where both models cor- rectly classify and where they misclassify. Sec- ond, we provide the choices for the two models along with confidence levels for the humans to se- lect. If they select the right model with high con- fidence, the explanation method will get a higher positive score. In contrast, a confident but incor- rect answer results in a large negative score. Also, the humans have the option to state no preference, for which the explanation method will get a zero score (See the last row of Table 1). 3.2 Justifying the Predictions Explanations are sometimes used by humans as the reasons for the predicted class. This task tests whether the evidence texts are truly related to the predicted class and can distinguish it from the other classes, so called class-discriminative (Sel- varaju et al., 2017). To set up the task, we use a well-trained model and select an input exam- ple classified by this model with high confidence (maxc pc > τh where τh is a threshold parame- ter), so as to reduce the cases of unclear expla- nations due to low model accuracy or text ambi- guity. (Note that we will look at low-confidence predictions later in Task 3.) Then we show only the top-m evidence text fragments generated by the method of interest to humans and ask them to guess the class of the document containing the evidence. The explanation method which makes the humans surely guess the class predicted by the model will get a high positive score. As in the pre- vious task, this task considers both the correct and incorrect predictions with high confidence to see how well the explanations justify each of the cases. For incorrect predictions, an explanation method gets a positive score when a human guesses the same incorrect class after seeing the explanation. In real applications, convincing explanations for incorrect classes can help humans understand the Figure 1: CNN for text classification. for text classification which consists of four main steps: (i) embedding an input text into an embed- ded matrix W; (ii) applying K fixed-size convo- lution filters to W to find n-grams that possibly discriminate one class from the others; (iii) pool- ing only the maximum value found by each filter, corresponding to the most relevant n-gram in text, to construct a filter-based feature vector, v, of the input; and (iv) using fully-connected layers (F C) to predict the results, and applying a softmax func- tion to the outputs to obtain predicted probability of the classes (p), i.e., p = sof tmax(F C(v)). While the original version of this model uses only one linear layer as F C (Kim, 2014), more hidden layers can be added to increase the model capacity for prediction. Also, more than one filter size can be used to detect n-grams with short- and long- span relations (Conneau et al., 2017). 3 Human-grounded Evaluation Methods We propose three human tasks to evaluate expla- nation methods for text classification as summa- rized in Table 1. Figure 2 gives an example ques- tion for each task, discussed next. 3.1 Revealing the Model Behavior Task 1 evaluates whether explanations can expose irrational behavior of a poor model. This property of explanation methods is very useful when we do not have a labelled dataset to evaluate the model quantitatively. To set up the task, firstly, we train two models to make them have different perfor- mance on classifying testing examples (i.e., differ- ent capability to generalize to unseen data). Then we use these models to classify an input text and apply the explanation method of interest to explain the predictions -- highlighting top-m evidence text fragments on the text for each model. Next, we ask humans, based on the highlighted texts from the two models, which model is more reasonable? Embedding Convolution Max Pooling Fully-connected LayersFeature Extraction ClassificationWpc1c2cKvPredictionProbability(aftersoftmax)onewilddifferencebetweenthetwoprinters: Assumption Model(s) Input text Information displayed Human task Scores to the explanation method Task 1 (Section 3.1) Good explanations can reveal model behavior Two classifiers with different performance on a test dataset A test example for which both classifiers predict the same class 1. The input text 2. The predicted class 3. (Highlighted) top-m evidence texts of each model Select the more reasonable model and state if they are confident or not (-)1.0: (In)correct, confident (-)0.5: (In)correct, unconfident 0.0: No preference Task 2 (Section 3.2) Good explanations justify the predictions One well-trained classifier A test example which the classifier predicts with high confidence (maxc pc > τh) 1. Top-m evidence texts Select the most likely class of the document which contains the evidence texts and state if they are confident or not (-)1.0: (In)correct, confident (-)0.5: (In)correct, unconfident 0.0: No preference Task 3 (Section 3.3) Good explanations help humans investigate uncertain predictions One well-trained classifier A test example which the classifier predicts with low confidence (maxc pc < τl) 1. The predicted class 2. The predicted probability p 3. Top-m evidence and top-m counter-evidence texts Select the most likely class of the input text and state if they are confident or not (-)1.0: (In)correct, confident (-)0.5: (In)correct, unconfident Table 1: A summary of the proposed human-grounded evaluation tasks. model's weakness and create additional fixing ex- amples to retrain and improve the model. Investigating Uncertain Predictions 3.3 If an AI system makes a prediction with low con- fidence, it may need to raise the case with humans and let them decide, but with the analyzed results as additional information. This task aims to check if the explanations can help humans comprehend the situation and correctly classify the input text or not. To set up, we use a well-trained model and an input text classified by this model with low confidence (maxc pc < τl where τl is a thresh- old parameter). Then we apply the explanation method of interest to find top-m evidence and top- m counter-evidence texts of the predicted class. We present both types of evidence to humans1 to- gether with the predicted class and probability p and ask the humans to use all the information to guess the actual class of the input text, without seeing the input text itself. The scoring criteria of this task are similar to the previous tasks except that we do not provide the "no preference" option as the humans can still rely on the predicted scores when all the explanations are unhelpful. 4 Experimental Setup 4.1 Datasets We used two English textual datasets for the three tasks. (1) Amazon Review Polarity is a sentiment anal- ysis dataset with positive and negative classes 1We present counter-evidence as evidence for the other classes to simplify the task questions. (Zhang et al., 2015). We randomly selected 100K, 50K, and 100K examples for training, validating, and testing the CNN models, respectively. (2) ArXiv Abstract is a text classification dataset we created by collecting abstracts of scientific arti- cles publicly available on ArXiv2. Particularly, we collected abstracts from the "Computer Science (CS)", "Mathematics (MA)", and "Physics (PH)" categories, which are the three main categories on ArXiv. We then created a dataset with three dis- joint classes removing the abstracts which belong to more than one of the three categories. In the experiments, we randomly selected 6K, 1.5K, and 10K examples for training, validating, and testing the CNN model, respectively. 4.2 Classification Models: 1D CNNs As for the classifiers, we used 1D CNNs with the same structures for all the tasks and datasets. Specifically, we used 200-dim GloVe vectors as non-trainable weights in the embedding layer (Pennington et al., 2014). The convolution layer had three filter sizes [2, 3, 4] with 50 filters for each size, while the intermediate fully-connected layer had 150 units. The activation functions of the filters and the fully-connected layers are ReLU (except the softmax at the output layer). The models were implemented using Keras and trained with Adam optimizer. The macro-average F1 are 0.90 and 0.94 for the Amazon and the ArXiv datasets, respectively. Overall, the ArXiv appears to be an easier task as it is likely solvable by look- ing at individual keywords. In contrast, the Ama- 2https://arxiv.org Method Name Random (W) Random (N) LIME LRP (W) LRP (N) DeepLIFT (W) DeepLIFT (N) Grad-CAM-Text Decision Trees (DTs) Approach Random Baselines Perturbation Relevance Propagation Gradient Model Extraction Granularity Words N-grams Words Words N-grams Words N-grams N-grams N-grams Table 2: Nine explanation methods evaluated. the Amazon dataset, while the first (well-trained) CNN needed eight epochs until the validation loss converges, we trained the second CNN for only one epoch to make it underfitting. For the ArXiv dataset, we trained the second CNN using the same number of examples as the first model but with more specific topics. To explain, we ran- domly selected only examples from the subclass 'Computation and Language', 'Dynamical Sys- tems', and 'Quantum Physics' as training and vali- dation examples for the class 'Computer Science', 'Mathematics', and 'Physics', respectively. In other words, the training and testing data of the worse CNN came from different distributions. As a result, the macro-average F1 of the worse CNNs are 0.81 and 0.85 for the Amazon and the ArXiv datasets, respectively. 4.3 Explanation Methods We evaluated nine explanation methods as sum- marized in Table 2. First, we used Random (W) and Random (N) as two baselines selecting words and non-overlapping n-grams randomly from the input text as evidence and counter-evidence. For the n-gram random baseline (and other n-gram based explanation methods in this paper), n is one of the CNN filter sizes [2, 3, 4]. Second, we selected LIME which is a well- known model-agnostic perturbation-based method (Ribeiro et al., 2016). It trains a linear model using samples (5,000 samples in this paper) around the input text to explain the importance of each word towards the prediction. The importance scores can be either positive (for the predicted class) or nega- tive (against the predicted class). Third, we selected layer-wise relevance prop- agation (LRP), specifically -LRP (Bach et al., 2015b), and DeepLIFT (Shrikumar et al., 2017) which are applicable to neural networks in gen- eral and performed very well in several evalua- Figure 2: Example questions and user interfaces. zon sentiment analysis is not quite easy. Many re- views mention both pros and cons of the products, so a classifier needs to analyze several parts of the input to reach a conclusion. However, this is still manageable by the CNN architecture we used. Also, in task 1, we need another model which performs worse than the well-trained model. In this experiment, we trained the second CNNs (i.e., the worse models) for the two datasets in dif- ferent ways to examine the capability of expla- nation methods in two different scenarios. For tions using proxy tasks (Xiong et al., 2018; Po- erner et al., 2018). LRP propagates the output of the target class (before softmax) back through lay- ers to find attributing words, while DeepLIFT does the same but propagates the difference between the output and the predicted output of the refer- ence input (i.e., all-zero embeddings in this pa- per). These two methods assign relevance scores to every word in the input text. Words with the highest and the lowest scores are selected as ev- idence for and counter-evidence against the pre- dicted class, respectively. Also, we extended LRP and DeepLIFT to generate explanations at an n- gram level. We considered all possible n-grams in the input text where n is one of the CNN filter sizes. Then the explanations are generated based on the relevance score of each n-gram, i.e., the sum of relevance scores of all words in the n-gram. Next, we searched for model-specific explana- tion methods which target 1D CNNs for text clas- sification. We found that Jacovi et al. (2018) pro- posed one: listing only n-grams corresponding to feature values in v (see Figure 1) that pass thresh- olds for their filters. Each of the thresholds is set subject to sufficient purity of the classification re- sults above it. However, their method is applicable to CNNs with only one linear layer as F C, while our CNNs have an additional hidden layer (with ReLU activation). So, we could not compare with their method in this work. To increase diversity in the experiments, we therefore propose two ad- ditional model-specific methods applicable to 1D CNNs with multiple layers in F C, presented next. 4.3.1 Grad-CAM-Text We adapt Grad-CAM (Selvaraju et al., 2017), orig- inally devised for explaining 2D CNNs, to find the most relevant n-grams for text classification. Since each value in the feature vector v corresponds to an n-gram selected by a filter, we use Ej,k to show the effect of an n-gram selected by the kth filter towards the prediction of class j: Ej,k = max( ∂F C(v)j (1) The partial derivative term shows how much the prediction of class j changes if the value from the kth filter slightly changes. As we are finding the evidence for the target class j, we consider only the positive value of the derivative. Then Ej,k combines this term with the strength of vk to show the overall effect of the kth filter for the input text. Next, we calculate the effect of each word wi in the input text by aggregating the effects of all the , 0) × vk. ∂vk n-grams containing wi. Ej,wi =(cid:80) k(Ej,k × I[wi ∈ Nk]) where Nk is an n-gram detected by the kth filter. Lastly, we select, as the evidence, non-overlapping n-grams which are detected by at least one of the filters and have the highest sums of the effects of all the words they contain. For example, to de- cide whether we will select the n-gram Nk as an Ej,wi. Note that we can find counter-evidence by chang- ing, in equation (1), from max to min. evidence text or not, we consider(cid:80) wi∈Nk 4.3.2 Decision Trees This explanation method is based on model extrac- tion (Bastani et al., 2017). We create a decision tree (DT ) which mimics the behavior of the classi- fication part (fully-connected layers) of the trained CNN. Given a filter-based feature vector v, the DT needs to predict the same class as predicted by the CNN. Formally, we want DT (v) = argmax pj = argmax F C(v)j. j j For multi-class classification, we construct one DT for each class (one vs. rest classification). We em- ploy CART with Gini index for learning DTs (Leo et al., 1984). All the training examples are gener- ated by the trained CNN using a training dataset, whereas a validation dataset is used to prune the DTs to prevent overfitting. Also, for each feature vj in v, we calculate the Pearson's correlation between vj and the output of each class (before softmax) in F C(v) using the training dataset, so we know which class is usually predicted given a high score of vj (i.e., correlated most to this feature). We use cj denoting the most correlated class of the feature vj. We can consider the DTs as a global explana- tion of the model as it explains the CNN in gen- eral. To create a local explanation, we use the DT of the predicted class to classify the input. At each decision node, we collect associated n-grams passing the nodes' thresholds to be evidence for (or counter-evidence against) the predicted class (depending on the most correlated class of each splitting feature). For example, an input text X is classified to class a, so we use the DT of class a to predict the input. If a decision node checks whether feature vj of this input is greater than 0.25 and assume it is true for this input, the n-gram cor- responding to vj will be evidence if the most cor- related class of vj is class a (i.e., cj = a). Other- wise, it will be counter-evidence if cj (cid:54)= a. An example from the Amazon dataset, Actual: Pos, Predicted: Pos, (Predicted scores: Pos 0.514, Neg 0.486): "OK but not what I wanted: These would be ok but I didn't realize just how big they are. I wanted something I could actually cook with. They are a full 12" long. The handles didn't fit comfortably in my hand and the silicon tips are hard, not rubbery texture like I'd imagined. The tips open to about 6" between them. Hope this helps someone else know ..." Method LIME (W) LRP (W) LRP (N) Grad-CAM- Text (N) DTs (N) Top-3 evidence texts comfortably / wanted / helps are / not / 6 are hard , not / about 6" between / not what I wanted comfortably in my hand / I wanted : These / . The tips open imagined . The tips Top-3 counter-evidence texts not / else / someone : / tips / open . The tips open / : These would / in my hand and not what I wanted / not rubbery texture like / Hope this helps someone 'd imagined . / are . I wanted / would be ok Table 3: Examples of evidence and counter-evidence texts generated by some of the explanation methods. Implementations3 4.4 We used public libraries of LIME4, LRP (Alber et al., 2018), and DeepLIFT5 in our experiments. Besides, the code for computing Grad-CAM-Text was adapted from keras-vis6, whereas we used scikit-learn (Pedregosa et al., 2011) for decision tree construction. All the DTs achieved over 80% macro-F1 in mimicking the CNNs' predictions. For the task parameters, we set m = 3, τh = 0.9, and τl = 0.7. For each task and dataset, we used 100 input texts, half of which were classified cor- rectly by the model(s) and the rest were misclas- sified. So, with nine explanation methods being evaluated, each task had 900 questions per dataset for human participants to answer. Examples of questions for each task are given in Figure 2. For the Amazon dataset, we posted our tasks on Amazon Mechanical Turk (MTurk). To ensure the quality of crowdsourcing, each question was answered by three workers and the scores were averaged. For the ArXiv dataset which requires background knowledge of the related subjects, we recruited graduates and post-graduate students in Computer Science, Mathematics, Physics, and En- gineering to perform the tasks, and each question was answered by one participant. In total, we had 367 and 121 participants for the Amazon and the ArXiv datasets, respectively. 5 Results and Discussion Examples of the generated explanations are shown in Table 3 and a separate appendix. Table 4 shows the average scores of each explanation method for each task and dataset, while Figure 3 displays 3The code and datasets of this paper are available at https://github.com/plkumjorn/CNNAnalysis 4https://github.com/marcotcr/lime 5https://github.com/kundajelab/deeplift 6https://github.com/raghakot/keras-vis the distributions of individual scores for all three tasks. We do not show the distributions of tasks 2 and 3 of the Amazon dataset as they look similar to the associated ones of the ArXiv dataset. 5.1 Task 1 For the Amazon dataset, though Grad-CAM-Text achieved the highest overall score, the perfor- mance was not significantly different from other methods including the random baselines. Also, the inter-rater agreement for this task was quite poor. It suggests that existing explanation methods can- not apparently reveal irrational behavior of the un- derfitting CNN to lay human users. So, the scores of most explanation methods distribute symmetri- cally around zero, as shown in Figure 3(a). For the ArXiv dataset, LRP (N) and DeepLIFT (N) got the highest scores when both CNNs pre- dicted correctly. Hence, they can help humans identify the poor model to some extent. However, there was no clear winner when both CNNs pre- dicted wrongly. One plausible reason is that evi- dence for an incorrect prediction, even by a well- trained CNN, is usually not convincing unless we set a (high) lower bound of the confidence of the predictions (as we did in task 2). Additionally, we found that psychological fac- tors fairly affect this task. Based on the results, for two explanations with comparable semantic quality, humans prefer the explanation with more evidence texts and select it as more reasonable. This is consistent with the findings by Zemla et al. (2017). Conversely, the DTs method performed in the opposite way. The DT of the better model usually focuses on a few most relevant texts in the input and outputs fewer evidence texts. This possi- bly causes the low performance of the DTs method in this task. Also, we got feedback from the partic- ipants that they sometimes penalized an evidence Task 1 ArXiv Task 2 Task 3 ArXiv Explanation Method .03 .06 .11 .03 .12 .07 .06 ArXiv Amazon A   A   .02 .10 .04 .06 .12 .13 .25 .12 .74 .64 .69 .64 .26 -.01 .13 .16 .08 .45 .39 .26 .37 .04 .16 .21 .47 -.01 .28 .23 .66 .41 .64 .65 .68 .59 .64 .32 0.274 / 0.371 .09 .32 .75 .36 .49 .35 .47 .65 .69 N/A .07 .29 .70 .26 .44 .26 .38 .53 .51 .00 .02 .02 -.06 Amazon A   A   .04 -.11 -.05 -.17 .02 .02 -.12 -.16 -.07 .02 .03 -.02 .02 -.03 -.01 -.05 .00 -.01 .24 -.01 -.07 -.04 -.09 .13 .04 .04 .00 .05 .06 .22 -.10 .07 .03 -.03 -.04 -.01 -.05 -.02 -.08 -.13 -.22 -.03 0.050 / 0.054 Amazon A   A   .32 -.30 .05 .29 -.25 -.01 .31 -.34 .02 -.02 .33 -.44 .60 -.26 .08 .28 -.44 -.03 .33 -.30 .05 .56 -.45 .05 .10 .29 -.50 N/A 0.212 / 0.499 Random (W) Random (N) LIME (W) LRP (W) LRP (N) DeepLIFT (W) DeepLIFT (N) Grad-CAM-T (N) DTs (N) Fleiss κ (Amazon) Table 4: The average scores of the three evaluation tasks. The score range is [-1,1] in which 1 is better. A, , and are for all, correctly classified, and misclassified input texts, respectively. Boldface numbers are the highest average scores in the columns. A number is underlined when there is no statistically significant difference between the scores of the corresponding method and the best method in the same column (at a significance level of 0.05). The last row reports inter-rater agreement measures (Fleiss' kappa) in the format of α / β where α considers answers with human confidence levels (5 categories for task 1-2 and 4 categories for task 3) and β considers answers regardless of the human confidence levels (3 categories for task 1-2 and 2 categories for task 3). .01 .53 -.43 .54 -.55 .02 .50 -.45 -.02 .50 -.54 -.06 .17 .60 -.43 .47 -.53 -.08 .02 .59 -.49 .51 -.42 .06 .60 -.40 -.11 .02 N/A Figure 3: Score distributions from task 1 of the Amazon dataset and from all the tasks of the ArXiv dataset. text which is highlighted in a strange way, such as "... greedy algorithm. In this paper, we ...". Hence, in real applications, syntax integrity should be taken into account to generate explanations. 5.2 Task 2 LIME clearly achieved the best results in task 2 followed by Grad-CAM-Text and DTs. These methods are class discriminative, being able to find good evidence for the predicted class regard- less of whether the prediction is correct. We believe that LIME performed well because it tests that the missing of evidence words from the input text greatly reduces the probability of the predicted class, so these words are semantically related to the predicted class (given that the model is accurate). Meanwhile, the DTs method selects evidence based on the most correlated class of the splitting features. So, the evidence n-grams are more likely related to the predicted class than the other classes. However, they may be less relevant than LIME's as the evidence is generated from a global explanation of the model (DTs). Besides, Grad-CAM-Text worked relatively well here prob- ably because it preserves the class discriminative property of Grad-CAM (Selvaraju et al., 2017). By contrast, LRP and DeepLIFT generated ac- ceptable evidence only for the correct predictions. Also, LRP (N) and DeepLIFT (N) performed bet- ter than LRP (W) and DeepLIFT (W) in both datasets. This might be because one evidence n- gram contains more information than one evidence word. Nevertheless, even the Random (N) method surpasses the LRP (W) and the DeepLIFT (W) for the ArXiv dataset. Thereby, whenever we use LRP and DeepLIFT, we should present to humans the most relevant words together with their contexts. 5.3 Task 3 The negative scores under the columns of task 3 show that using explanations to rectify the predic- tions is not easy. Hence, the overall average scores of many explanation methods stay close to zero. DTs performed well only on the Amazon dataset. The average numbers of n-grams per ex- planation, generated by the DTs, are 2.00 and 1.77 1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N) for the Amazon and ArXiv datasets, respectively. Also, the reported n-grams could be repetitive and overlapping. This reduced the amount of useful information displayed, and it may be insufficient for humans to choose one of the CS, MA, and PH categories, which are more similar to one another than the positive and negative sentiments. Meanwhile, LRP (N) performed consistently well on both datasets. This is reasonable consid- ering our discussions in task 2. First, LRP (N) generates good evidence for correct predictions, so it can gain high scores in the columns. On the other hand, the evidence for incorrect predic- tions () is usually not convincing, so the counter- evidence (which is likely to be the evidence of the correct class) can attract humans' attention. Fur- thermore, the fact that LRP is not class discrimi- native does not harm it in this task as humans can recognize an evidence text even if it is selected by the LRP (N) as counter-evidence (and vice versa). For example, in the ArXiv dataset, we found a case in which the predicted class is PH (score = 0.48) but the correct class is CS (score = 0.07). LRP (N) selected 'armed bandit settings with', 'the Wasserstein distance', and 'derive pol- icy gradients' as evidence for the class PH. These n-grams, however, are not truly related to PH. Rather, they revealed the true class of this text and made a human choose the CS option with high confidence despite the low predicted score. Regarding LIME, the situation is reversed as LIME can find both good evidence and counter- evidence. These make humans be indecisive and, possibly, select a wrong option as the explanation is presented at a word level (without any contexts). 5.4 Model Complexity Apart from the results of the three tasks, it is worth to discuss the size of the DTs which mimic the four CNNs in our experiments. As shown in Table 5, the size of the DTs can reflect the complexity of the CNNs. Although the well-trained CNN of the Amazon dataset got 0.9 F1 score, the DTs of this CNN needed more than 5,500 nodes to achieve 85% fidelity (compared to only hundreds of nodes required for the ArXiv dataset). This illustrates the high complexity of the Amazon task compared to the ArXiv task even though both tasks were man- aged effectively by the same CNN architecture. For the ArXiv dataset, the DTs of the poor CNN are smaller than the ones of the well-trained CNN. #Nodes Depth #Leaves 5535 5537 6405 6369 Amazon: 1st CNN (well-trained) -- F = 0.85 38 Negative Positive 45 Amazon: 2nd CNN (underfitting) -- F = 0.82 40 Negative Positive 40 ArXiv: 1st CNN (well-trained) -- F = 0.89 25 Computer Science 24 Mathematics Physics 24 ArXiv: 2nd CNN (specific data) -- F = 0.84 17 Computer Science 28 Mathematics Physics 29 107 263 237 363 565 325 2768 2769 3203 3185 182 283 163 54 132 119 Table 5: Metadata of the DTs in the experiments. F refers to fidelity of the DTs (macro-average F1). This is likely because the poor CNN was trained on a specific dataset (i.e., selected subtopics of the main categories), so it had to deal with fewer dis- criminative patterns in texts compared to the first CNN trained using texts from all subtopics. Further studies of this quality of the DTs would be useful for some applications, e.g., measuring model complexity (Bianchini and Scarselli, 2014) and model compression (Cheng et al., 2018). 6 Conclusion We proposed three human tasks to evaluate local explanation methods for text classification. Us- ing the tasks in this paper, we experimented on 1D CNNs and found that (i) LIME is the most class discriminative method, justifying predictions with relevant evidence; (ii) LRP (N) works fairly well in helping humans investigate uncertain pre- dictions; (iii) using explanations to reveal model behavior is challenging, and none of the methods achieved impressive results; (iv) whenever using LRP and DeepLIFT, we should present to humans the most relevant words together with their con- texts and (v) the size of the DTs can also reflect the model complexity. Lastly, we consider evaluating on other datasets and other advanced architectures beneficial future work as it may reveal further in- teresting qualities of the explanation methods. Acknowledgments We would like to thank all the participants in the experiments as well as Alon Jacovi and anony- mous reviewers for helpful comments. Also, the first author would like to thank the support from Anandamahidol Foundation, Thailand. References Maximilian Alber, Sebastian Lapuschkin, Philipp Seegerer, Miriam Hagele, Kristof T Schutt, Gr´egoire Montavon, Wojciech Samek, Klaus-Robert Muller, Sven Dahne, and Pieter-Jan Kindermans. 2018. arXiv preprint innvestigate neural networks! arXiv:1808.04260. Leila Arras, Franziska Horn, Gr´egoire Montavon, Klaus-Robert Muller, and Wojciech Samek. 2016. Explaining predictions of non-linear classifiers in nlp. In Proceedings of the 1st Workshop on Repre- sentation Learning for NLP, pages 1 -- 7. Association for Computational Linguistics. Leila Arras, Franziska Horn, Gr´egoire Montavon, Klaus-Robert Muller, and Wojciech Samek. 2017a. " what is relevant in a text document?": An in- terpretable machine learning approach. PloS one, 12(8):e0181142. Leila Arras, Gr´egoire Montavon, Klaus-Robert Muller, and Wojciech Samek. 2017b. Explaining recurrent neural network predictions in sentiment analysis. In Proceedings of the EMNLP'17 Workshop on Com- putational Approaches to Subjectivity, Sentiment & Social Media Analysis (WASSA), pages 159 -- 168. Association for Computational Linguistics. Sebastian Bach, Alexander Binder, Gr´egoire Mon- tavon, Frederick Klauschen, Klaus-Robert Muller, and Wojciech Samek. 2015a. On pixel-wise ex- planations for non-linear classifier decisions by PLoS ONE, layer-wise relevance propagation. 10(7):e0130140. Sebastian Bach, Alexander Binder, Gr´egoire Mon- tavon, Frederick Klauschen, Klaus-Robert Muller, and Wojciech Samek. 2015b. On pixel-wise ex- planations for non-linear classifier decisions by PloS one, layer-wise relevance propagation. 10(7):e0130140. Osbert Bastani, Carolyn Kim, and Hamsa Bastani. 2017. Interpretability via model extraction. CoRR, abs/1706.09773. Monica Bianchini and Franco Scarselli. 2014. On the complexity of neural network classifiers: A compar- ison between shallow and deep architectures. IEEE Transactions on Neural Networks and Learning Sys- tems, 25(8):1553 -- 1565. Or Biran and Kathleen R McKeown. 2017. Human- centric justification of machine learning predictions. In IJCAI, pages 1461 -- 1467. Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. 2018. Model compression and acceleration for deep neural networks: The principles, progress, and challenges. IEEE Signal Processing Magazine, 35(1):126 -- 136. 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 1107 -- 1116. Association for Computational Linguistics. Yannis Dimopoulos, Paul Bourret, and Sovan Lek. 1995. Use of some sensitivity criteria for choosing networks with good generalization ability. Neural Processing Letters, 2(6):1 -- 4. Bjorn Gamback and Utpal Kumar Sikdar. 2017. Us- ing convolutional neural networks to classify hate- In Proceedings of the First Workshop on speech. Abusive Language Online, pages 85 -- 90. Association for Computational Linguistics. Reza Ghaeini, Xiaoli Fern, and Prasad Tadepalli. 2018. Interpreting recurrent and attention-based neural models: a case study on natural language infer- In Proceedings of the 2018 Conference on ence. Empirical Methods in Natural Language Process- ing, pages 4952 -- 4957, Brussels, Belgium. Associ- ation for Computational Linguistics. Alon Jacovi, Oren Sar Shalom, and Yoav Goldberg. 2018. Understanding convolutional neural networks In Proceedings of the 2018 for text classification. EMNLP Workshop BlackboxNLP: Analyzing and In- terpreting Neural Networks for NLP, pages 56 -- 65. Association for Computational Linguistics. Rie Johnson and Tong Zhang. 2015. Effective use of word order for text categorization with convolu- tional neural networks. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 103 -- 112. Associa- tion for Computational Linguistics. Been Kim, Cynthia Rudin, and Julie Shah. 2014. The bayesian case model: A generative approach for case-based reasoning and prototype classification. In Proceedings of the 27th International Confer- ence on Neural Information Processing Systems - Volume 2, NIPS'14, pages 1952 -- 1960, Cambridge, MA, USA. MIT Press. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP), pages 1746 -- 1751. As- sociation for Computational Linguistics. Tao Lei, Regina Barzilay, and Tommi Jaakkola. 2016. Rationalizing neural predictions. In Proceedings of the 2016 Conference on Empirical Methods in Nat- ural Language Processing, pages 107 -- 117. Associ- ation for Computational Linguistics. Breiman Leo, Jerome H Friedman, Richard A Olshen, and Charles J Stone. 1984. Classification and re- gression trees. Wadsworth International Group. Alexis Conneau, Holger Schwenk, Loıc Barrault, and Yann Lecun. 2017. Very deep convolutional net- works for text classification. In Proceedings of the Jiwei Li, Will Monroe, and Dan Jurafsky. 2016. Un- derstanding neural networks through representation erasure. CoRR, abs/1612.08220. Hui Liu, Qingyu Yin, and William Yang Wang. 2019. Towards explainable NLP: A generative explanation framework for text classification. In Proceedings of the 57th Annual Meeting of the Association for Com- putational Linguistics, pages 5570 -- 5581. Associa- tion for Computational Linguistics. Scott M Lundberg and Su-In Lee. 2017. A unified approach to interpreting model predictions. In Ad- vances in Neural Information Processing Systems, pages 4765 -- 4774. Sina Mohseni and Eric D Ragan. 2018. A human- grounded evaluation benchmark for local expla- arXiv preprint nations of machine learning. arXiv:1801.05075. Dong Nguyen. 2018. Comparing automatic and hu- man evaluation of local explanations for text clas- In Proceedings of the 2018 Conference sification. of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1069 -- 1078. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Pretten- hofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Pas- sos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825 -- 2830. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Nat- ural Language Processing (EMNLP), pages 1532 -- 1543. Nina Poerner, Hinrich Schutze, and Benjamin Roth. 2018. Evaluating neural network explanation meth- ods using hybrid documents and morphosyntactic agreement. In Proceedings of the 56th Annual Meet- ing of the Association for Computational Linguistics (Volume 1: Long Papers), pages 340 -- 350. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016. "why should i trust you?": Explain- In Proceed- ing the predictions of any classifier. ings of the 22Nd ACM SIGKDD International Con- ference on Knowledge Discovery and Data Mining, KDD '16, pages 1135 -- 1144, New York, NY, USA. ACM. Wojciech Samek, Thomas Wiegand, and Klaus-Robert Muller. 2018. Explainable artificial intelligence: Understanding, visualizing and interpreting deep ICT Discoveries learning models. - Special Issue 1 - The Impact of Artificial Intel- ligence (AI) on Communication Networks and Ser- vices, 1(1):39 -- 48. ITU Journal: Ramprasaath R Selvaraju, Michael Cogswell, Ab- hishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. 2017. Grad-cam: Visual explana- tions from deep networks via gradient-based local- In Proceedings of the IEEE International ization. Conference on Computer Vision, pages 618 -- 626. Avanti Shrikumar, Peyton Greenside, and Anshul Kun- daje. 2017. Learning important features through propagating activation differences. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3145 -- 3153, International Convention Centre, Sydney, Australia. PMLR. David Silver, Aja Huang, Christopher J. Maddison, Arthur Guez, Laurent Sifre, George van den Driess- che, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. 2016. Mastering the game of go with deep neural networks and tree search. Nature, 529:484 -- 503. Panagiotis Symeonidis, Alexandros Nanopoulos, and Yannis Manolopoulos. 2009. Moviexplain: a recommender system with explanations. RecSys, 9:317 -- 320. Wenting Xiong, Iftitahu Ni'mah, Juan MG Huesca, Werner van Ipenburg, Jan Veldsink, and Mykola Pechenizkiy. 2018. Looking deeper into deep learning model: Attribution-based explanations of textcnn. arXiv preprint arXiv:1811.03970. Jeffrey C Zemla, Steven Sloman, Christos Bechlivani- dis, and David A Lagnado. 2017. Evaluating every- day explanations. Psychonomic bulletin & review, 24(5):1488 -- 1500. Jingqing Zhang, Piyawat Lertvittayakumjorn, and Yike Integrating semantic knowledge to Guo. 2019. In Proceed- tackle zero-shot text classification. ings of the 2019 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 1031 -- 1040. Associ- ation for Computational Linguistics. Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text clas- sification. In Proceedings of the 28th International Conference on Neural Information Processing Sys- tems - Volume 1, NIPS'15, pages 649 -- 657, Cam- bridge, MA, USA. MIT Press. Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. 2016. Learning deep features for discriminative localization. In Proceed- ings of the IEEE conference on computer vision and pattern recognition, pages 2921 -- 2929. A CNN models This section reports the performance of the trained CNN models on a test set of each dataset. A.1 Amazon Dataset 1st CNN (better) Negative Positive micro avg macro avg 2nd CNN (worse) Negative Positive micro avg macro avg Prec. 0.92 0.89 0.90 0.90 Prec. 0.82 0.81 0.81 0.81 Recall 0.89 0.92 0.90 0.90 Recall 0.81 0.82 0.81 0.81 F1 0.90 0.90 0.90 0.90 F1 0.81 0.81 0.81 0.81 Support 50039 49961 100000 100000 Support 50039 49961 100000 100000 Table 6: Precision, Recall, and F1 scores of both CNNs for the Amazon dataset A.2 ArXiv Dataset 1st CNN (better) Computer science Mathematics Physics micro avg macro avg 2nd CNN (worse) Computer science Mathematics Physics micro avg macro avg Prec. 0.94 0.92 0.96 0.94 0.94 Prec. 0.96 0.75 0.89 0.85 0.87 Recall 0.93 0.93 0.94 0.94 0.94 Recall 0.74 0.94 0.88 0.85 0.85 F1 0.93 0.92 0.95 0.94 0.94 F1 0.84 0.83 0.89 0.85 0.85 Support 10000 10000 10000 30000 30000 Support 10000 10000 10000 30000 30000 Table 7: Precision, Recall, and F1 scores of both CNNs for the ArXiv dataset B Decision Trees This section reports the decision trees perfor- mance in mimicking the CNNs' predictions (i.e., fidelity) on the test sets. All the DTs achieved over 80% macro-F1 in mimicking the CNNs pre- dictions. As the F1 scores say, it's easier for the decision trees to mimic the behavior of the well- trained CNNs than the poor CNNs. B.1 Amazon Dataset 1st CNN (better) Negative Positive micro avg macro avg 2nd CNN (worse) Negative Positive micro avg macro avg Prec. 0.84 0.85 0.85 0.85 Prec. 0.81 0.82 0.82 0.82 Recall 0.84 0.85 0.85 0.85 Recall 0.82 0.82 0.82 0.82 F1 0.84 0.85 0.85 0.85 F1 0.82 0.82 0.82 0.82 Support 48333 51667 100000 100000 Support 49482 50518 100000 100000 Table 8: Performance of the decision trees in mimick- ing the CNNs' predictions for the Amazon dataset B.2 ArXiv Dataset 1st CNN (better) Computer science Mathematics Physics micro avg macro avg 2nd CNN (worse) Computer science Mathematics Physics micro avg macro avg Prec. 0.89 0.89 0.90 0.89 0.89 Prec. 0.83 0.82 0.88 0.84 0.84 Recall 0.91 0.87 0.91 0.89 0.89 Recall 0.81 0.88 0.81 0.84 0.83 F1 0.90 0.88 0.90 0.89 0.89 F1 0.82 0.85 0.84 0.84 0.84 Support 9971 10203 9826 30000 30000 Support 7653 12506 9841 30000 30000 Table 9: Performance of the decision trees in mimick- ing the CNNs' predictions for the ArXiv dataset C Examples of the Explanations Example 1: Amazon Dataset, (Actual: Positive, Predicted: Negative) "Source hip hop hits Volume 3: THe songs listed aren't even on the CD! I bought it for Bling Bling and it wasn't on the CD. the other songs are good, but not what I was looking for. Amazon needs to get the info right on this listing." Top-5 evidence texts • Random (W): . / get / hip / was / I • Random (N): the CD ! I / the CD / needs to get the / info right on this / for . • LIME: not / bought / 3 / info / Bling • LRP (W): it / bought / . / listed / : • LRP (N): ! I bought it / : THe songs listed / was looking for . / right on this listing / not what I • DeepLIFT (W): it / bought / . / listed / : • DeepLIFT (N): ! I bought it / : THe songs listed / was looking for . / right on this listing / not what I • Grad-CAM-Text: n't even on the / not what I was / hits Volume 3 : / CD ! I / . Amazon needs to • DTs: n't even on the / CD ! I Example 2: ArXiv Dataset, (Actual: Physics (PH), Predicted: Computer Science (CS)) "Multiple-valued Logic (MVL) circuits are one of the most attractive applications of the Monostable-to-Multistable transition Logic (MML), and they are on the basis of advanced circuits for communications. The operation of such quantizer has two steps : sampling and holding. Once the quantizer samples the sig- nal, it must maintain the sampled value even if the input changes. However, holding property is not inherent to MML circuit topologies. This pa- per analyses the case of an MML ternary inverter used as a quantizer, and determines the relations that circuit representative parameters must verify to avoid this malfunction." Top-5 evidence texts • Random (W): not / This / one / basis / MML • Random (N): ) , and / , holding property is / are one of / sampled value even / circuit topologies • LIME: paper / Logic / circuits / communica- tions / applications • LRP (W): paper / - / communications / topologies / the • LRP (N): topologies . This paper / to - Mul- tistable transition / valued Logic ( MVL / cir- cuits for communications . / the quantizer samples the • DeepLIFT (W): paper / - / communications / Logic / the • DeepLIFT (N): topologies . This paper / val- ued Logic ( MVL / to - Multistable transition / circuits for communications . / the quantizer samples the • Grad-CAM-Text: circuits for communica- tions . / ( MVL ) circuits / MML ternary in- verter used / topologies . This paper / - valued Logic • DTs: MML ternary inverter / MVL ) circuits are / advanced circuits / circuits for commu- nications / to avoid this malfunction Top-5 counter-evidence texts • Random (W): texture / . / what / to / would • Random (N): this helps someone else / , not / wanted something I / and the / I did n't • LIME not / else / someone / ok / would • LRP (W): : / tips / open / in / The • LRP (N): . The tips open / : These would / in my hand and / could actually cook / I did n't realize • DeepLIFT (W): : / tips / open / in / The • DeepLIFT (N): . The tips open / : These would / in my hand and / could actually cook / I did n't realize • Grad-CAM-Text: not what I wanted / not rubbery texture like / Hope this helps some- one / would be ok / The handles did n't • DTs: 'd imagined . / are . I wanted / would be ok Example 3: Amazon Dataset, (Actual: Positive, Predicted: Positive), Predicted scores: Positive (0.514), Negative (0.486) "OK but not what I wanted: These would be ok but I didn't realize just how big they are. I wanted something I could actually cook with. They are a full 12" long. The handles didn't fit comfortably in my hand and the silicon tips are hard, not rubbery texture like I'd imagined. The tips open to about 6" between them.Hope this helps someone else know better if it's what they want." Top-5 evidence texts • Random (W): not / wanted / 'd / with / The • Random (N): did n't / be ok / could actually cook / are hard / 12 " long . • LIME: comfortably / wanted / helps / tips / fit • LRP (W): are / not / 6 / hard / helps • LRP (N): are hard , not / about 6 " between / not what I wanted / helps someone else know / wanted something I • DeepLIFT (W): are / not / 6 / hard / helps • DeepLIFT (N): are hard , not / about 6 " be- tween / not what I wanted / helps someone else know / wanted something I • Grad-CAM-Text: comfortably in my hand / I wanted : These / . The tips open / , not rubbery texture / Hope this helps someone • DTs: imagined . The tips Top-5 counter-evidence texts • Random (W): the / We / scalar / lattice / op- eration • Random (N): lattice . Addition / The scalar / interpreted as a selection / for a linear calcu- lus / . • LIME: intelligence / scalar / field / The / lat- tice • LRP (W): mnesors / interpreted / multiplica- tion / can / foundation • LRP (N): mnesors can be the / multiplication is interpreted as / to artificial intelligence / foundation for / field is • DeepLIFT (W): interpreted / mnesors / mul- tiplication / foundation / can • DeepLIFT (N): mnesors can be the / multi- plication is interpreted as / to artificial intelli- gence / foundation for / field is • Grad-CAM-Text: . The scalar field / vectors to artificial intelligence / show that mnesors can / and multiplication is interpreted / The mnesor theory is • DTs: vectors to artificial Example 4: ArXiv Dataset, (Actual: Computer Science (CS), Predicted: Mathematics (MA)), Predicted scores: Computer Science (0.108), Mathematics (0.552), Physics (0.340) "The mnesor theory is the adaptation of vectors to artificial intelligence. The scalar field is re- placed by a lattice. Addition becomes idempo- tent and multiplication is interpreted as a selec- tion operation. We also show that mnesors can be the foundation for a linear calculus." Top-5 evidence texts • Random (W): intelligence / to / theory / is / by • Random (N): replaced by a lattice / inter- / show that / preted as a / linear calculus . The mnesor • LIME: linear / a / idempotent / vectors / of • LRP (W): lattice / theory / scalar / linear / of • LRP (N): replaced by a lattice / . The scalar field / the adaptation of vectors / mnesor the- ory / a linear • DeepLIFT (W): lattice / theory / scalar / lin- ear / of • DeepLIFT (N): replaced by a lattice / . The scalar field / the adaptation of vectors / mne- sor theory / a linear • Grad-CAM-Text: for a linear calculus / Ad- dition becomes idempotent and / adaptation of vectors to / replaced by a lattice / mnesor theory is the • DTs: Addition becomes idempotent and / be- comes idempotent and multiplication D Score Distributions This section presents the distributions of individual scores rated by human participants for each task and dataset. We do not include the random baselines in the plots to reduce the plot complexity. D.1 Amazon Dataset Figure 4: Distributions of individual scores from task 1 of the Amazon dataset (A, , , respectively). Figure 5: Distributions of individual scores from task 2 of the Amazon dataset (A, , , respectively). Figure 6: Distributions of individual scores from task 3 of the Amazon dataset (A, , , respectively). 1.00.50.00.51.0Scores01020304050Percentage of the scoresTask: 1, Dataset: Amazon, Condition: All1.00.50.00.51.0Scores01020304050Percentage of the scoresTask: 1, Dataset: Amazon, Condition: Correct1.00.50.00.51.0Scores01020304050Percentage of the scoresTask: 1, Dataset: Amazon, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N)1.00.50.00.51.0Scores01020304050607080Percentage of the scoresTask: 2, Dataset: Amazon, Condition: All1.00.50.00.51.0Scores01020304050607080Percentage of the scoresTask: 2, Dataset: Amazon, Condition: Correct1.00.50.00.51.0Scores01020304050607080Percentage of the scoresTask: 2, Dataset: Amazon, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N)1.00.50.51.0Scores010203040506070Percentage of the scoresTask: 3, Dataset: Amazon, Condition: All1.00.50.51.0Scores010203040506070Percentage of the scoresTask: 3, Dataset: Amazon, Condition: Correct1.00.50.51.0Scores010203040506070Percentage of the scoresTask: 3, Dataset: Amazon, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N) D.2 ArXiv Dataset Figure 7: Distributions of individual scores from task 1 of the ArXiv dataset (A, , , respectively). Figure 8: Distributions of individual scores from task 2 of the ArXiv dataset (A, , , respectively). Figure 9: Distributions of individual scores from task 3 of the ArXiv dataset (A, , , respectively). 1.00.50.00.51.0scores01020304050percentage of the scoresTask: 1, Dataset: ArXiv, Condition: All1.00.50.00.51.0scores01020304050percentage of the scoresTask: 1, Dataset: ArXiv, Condition: Correct1.00.50.00.51.0scores01020304050percentage of the scoresTask: 1, Dataset: ArXiv, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N)1.00.50.00.51.0scores010203040506070percentage of the scoresTask: 2, Dataset: ArXiv, Condition: All1.00.50.00.51.0scores010203040506070percentage of the scoresTask: 2, Dataset: ArXiv, Condition: Correct1.00.50.00.51.0scores010203040506070percentage of the scoresTask: 2, Dataset: ArXiv, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N)1.00.50.51.0scores010203040506070percentage of the scoresTask: 3, Dataset: ArXiv, Condition: All1.00.50.51.0scores010203040506070percentage of the scoresTask: 3, Dataset: ArXiv, Condition: Correct1.00.50.51.0scores010203040506070percentage of the scoresTask: 3, Dataset: ArXiv, Condition: Incorrect1.00.50.00.51.0scores01020304050percentage of the scores(a) Task: 1, Dataset: Amazon1.00.50.00.51.0scores01020304050(b) Task: 1, Dataset: ArXiv1.00.50.00.51.0scores010203040506070(c) Task: 2, Dataset: ArXiv1.00.50.51.0scores01020304050(d) Task: 3, Dataset: ArXivLIME (W)LRP (W)LRP (N)DeepLIFT (W)DeepLIFT (N)Grad-CAM-T (N)DTs (N)
1907.04307
1
1907
2019-07-09T17:46:17
Multilingual Universal Sentence Encoder for Semantic Retrieval
[ "cs.CL" ]
We introduce two pre-trained retrieval focused multilingual sentence encoding models, respectively based on the Transformer and CNN model architectures. The models embed text from 16 languages into a single semantic space using a multi-task trained dual-encoder that learns tied representations using translation based bridge tasks (Chidambaram al., 2018). The models provide performance that is competitive with the state-of-the-art on: semantic retrieval (SR), translation pair bitext retrieval (BR) and retrieval question answering (ReQA). On English transfer learning tasks, our sentence-level embeddings approach, and in some cases exceed, the performance of monolingual, English only, sentence embedding models. Our models are made available for download on TensorFlow Hub.
cs.CL
cs
Multilingual Universal Sentence Encoder for Semantic Retrieval Yinfei Yang𝑎†, Daniel Cer𝑎†, Amin Ahmad𝑎, Mandy Guo𝑎, Jax Law𝑎, Noah Constant𝑎, Gustavo Hernandez Abrego𝑎, Steve Yuan𝑏, Chris Tar𝑎, Yun-Hsuan Sung𝑎, Brian Strope𝑎, Ray Kurzweil𝑎 9 1 0 2 l u J 9 ] L C . s c [ 1 v 7 0 3 4 0 . 7 0 9 1 : v i X r a 𝑎Google AI Mountain View, CA Abstract We introduce two pre-trained retrieval fo- cused multilingual sentence encoding mod- els, respectively based on the Transformer and CNN model architectures. The models em- bed text from 16 languages into a single se- mantic space using a multi-task trained dual- encoder that learns tied representations using translation based bridge tasks (Chidambaram et al., 2018). The models provide perfor- mance that is competitive with the state-of- the-art on: semantic retrieval (SR), translation pair bitext retrieval (BR) and retrieval question answering (ReQA). On English transfer learn- ing tasks, our sentence-level embeddings ap- proach, and in some cases exceed, the perfor- mance of monolingual, English only, sentence embedding models. Our models are made available for download on TensorFlow Hub. 1 Introduction We introduce three new members in the universal sentence encoder (USE) (Cer et al., 2018) fam- ily of sentence embedding models. Two multi- lingual models, one based on CNN (Kim, 2014) and the other based on the Transformer architec- ture (Vaswani et al., 2017), target performance on tasks requiring models to capture multilingual se- mantic similarity. The third member introduced is an alternative interface to our multilingual Trans- former model for use in retrieval question answer- ing (ReQA). The 16 languages supported by our multilingual models are given in Table 1.1 † Corresponding authors: {yinfeiy, cer}@google.com 1Due to character set differences, we treat Simplified Chi- nese, zh, and Traditional Chinese, zh-tw, prominently used in Taiwan, as two languages within our model. 𝑐Google Cambridge, MA Languages Arabic (ar) Chinese (PRC) (zh) Chinese (Taiwan) (zh-tw) Dutch(nl) English(en) German (de) French (fr) Italian (it) Portuguese (pt) Spanish (es) Japanese (ja) Korean (ko) Russian (ru) Polish (pl) Thai (th) Turkish (tr) Family Semitic Sino-Tibetan Germanic Latin Japonic Koreanic Slavic Kra -- Dai Turkic Table 1: Supported languages (ISO 639-1). 2 Model Toolkit Models are implemented in TensorFlow (Abadi et al., 2016) and made publicly available on Ten- sorFlow Hub.2 Listing 1 illustrates the gener- ation of sentence embeddings using one of our multilingual models. Listing 2 demonstrates us- ing the question answering interface. Responses are encoded with additional context information such that the resulting embeddings have a high dot product similarity score with the questions they answer. This allows for retrieval of indexed candi- dates using efficient nearest neighbor search.3 import tensorflow_hub as hub module = hub.Module("https://tfhub.dev/google/" "universal-sentence-encoder-multilingual/1") multilingual_embeddings = module([ "Hola Mundo!", "Bonjour le monde!", "Ciao mondo!" "Hello World!", "Hallo Welt!", "Hallo Wereld!", "ɕ˲!", "Привет, мир!", "!ﻢﻟﺎﻌﻟﺎﺑ ﺎﺒﺣﺮﻣ"]) Listing 1: Encoding for STS/Bitext retrieval. 2 https://www.tensorflow.org/hub/, Apache 2.0 license, with models available as saved TF graphs. 3Popular efficient search tools include FAISS https: //github.com/facebookresearch/faiss, Annoy https://github.com/spotify/annoy, or FLANN https://www.cs.ubc.ca/research/flann. module = hub.Module("https://tfhub.dev/google/" "universal-sentence-encoder-multilingual-qa/1") query_embeddings = module( dict(text=["What is your age?"]), signature="question_encoder", as_dict=True) candidate_embeddings = module( dict(text=["I am 20 years old."], context=["I will be 21 next year."]), signature="response_encoder", as_dict=True) Listing 2: Encoding for QA retrieval. 3 Encoder Architecture 3.1 Multi-task Dual Encoder Training Similar to Cer et al. (2018) and Chidambaram et al. (2018), we target broad coverage using a multi-task dual-encoder training framework, with a single shared encoder supporting multiple down- stream tasks. The training tasks include: a multi- feature question-answer prediction task,4 a trans- lation ranking task, and a natural language infer- ence (NLI) task. Additional task specific hidden layers for the question-answering and NLI tasks are added after the shared encoder to provide rep- resentational specialization for each type of task. 3.2 SentencePiece SentencePiece tokenization (Kudo and Richard- son, 2018) is used for all of the 16 languages sup- ported by our models. A single 128k Sentence- Piece vocabulary is trained from 8 million sen- tences sampled from our training corpus and bal- anced across the 16 languages. For validation, the trained vocab is used to process a separate devel- opment set, also sampled from the sentence en- coding model training corpus. We find the charac- ter coverage is higher than 99% for all languages, which means less than 1% output tokens are out of vocabulary. Each token in the vocab is mapped to a fixed length embedding vector.5 3.3 Shared Encoder Two distinct architectures for the sentence encod- ing models are provided: (i) transformer (Vaswani et al., 2017), targeted at higher accuracy at the cost 4Question-answer prediction is similar to conversational- response prediction (Yang et al., 2018). We treat the question as the conversational input and the answer as the response. For improved answer selection, we provide a bag-of-words (BoW) context feature as an additional input to the answer encoder. The context could be the surrounding text or longer version of answer that provides more information. The con- text feature is encoded using a separate DAN encoder. 5Out-of-vocabulary characters map to an <UNK> token. of resource consumption; (ii) convolutional neu- ral network (CNN) (Kim, 2014), designed for ef- ficient inference but obtaining reduced accuracy. Transformer The transformer encoding model embeds sentences using the encoder component of the transformer architecture (Vaswani et al., 2017). Bi-directional self-attention is used to compute context-aware representations of tokens in a sen- tence, taking into account both the ordering and the identity of the tokens. The context-aware to- ken representations are then averaged together to obtain a sentence-level embedding. CNN The CNN sentence encoding model feeds the input token sequence embeddings into a con- volutional neural network (Kim, 2014). Similar to the transformer encoder, average pooling is used to turn the token-level embeddings into a fixed- length representation. Sentence embeddings are then obtain by passing the averaged representation through additional feedforward layers. 4 Training and Configuration 4.1 Training Corpus Training data consists of mined question-answer pairs,6 mined translation pairs,7 and the Stanford Natural Language Inference (SNLI) corpus (Bow- man et al., 2015).8 SNLI only contains English data. The number of mined questions-answer pairs also varies across languages with a bias toward a handful of top tier languages. To balance training across languages, we use Google's translation sys- tem to translate SNLI to the other 15 languages. We also translate a portion of question-answer pairs to ensure each language has a minimum of 60M training pairs. For each of our datasets, we use 90% of the data for training, and the remain- ing 10% for development/validation. 4.2 Model Configuration Input sentences are truncated to 256 tokens for the CNN model and 100 tokens for the transformer. The CNN encoder uses 2 CNN layers with fil- ter width of [1, 2, 3, 5] and a filter size of 256. 6QA pairs are mined from online forums and QA web- sites, including Reddit, StackOverflow, and YahooAnswers. 7The translation pairs are mined using a system similar to the approach described in Uszkoreit et al. (2010). 8MultiNLI (Williams et al., 2018), a more extensive cor- pus, contains examples from multiple sources but with differ- ent licences. Employing SNLI avoids navigating the licens- ing complexity of using MultiNLI to training public models. Model Gillick et al. (2018) USECNN USETrans Quora AskUbuntu Average 62.4 64.6 65.7 37.3 39.9 42.3 87.5 89.2 89.1 Table 2: MAP@100 on SR (English). Models are compared with the best models from Gillick et al. (2018) that do not benefit from in-domain training data. The Transformer encoder employs 6 transformer layers, with 8 attentions heads, hidden size 512, and filter size 2048. Model hyperparameters are tuned on development data sampled from the same sources as the training data. We export sentence encoding modules for our two encoder architec- tures: USETrans and USECNN. We also export a larger graph for QA tasks from our Transformer based model that includes QA specific layers and support providing context information from the larger document as USEQA Trans+Cxt.9 5 Experiments on Retrieval Tasks In this section we evaluate our multilingual encod- ing models on semantic retrieval, bitext and re- trieval question answer tasks. 5.1 Semantic Retrieval (SR) Following Gillick et al. (2018), we construct semantic retrieval (SR) tasks from the Quora question-pairs (Hoogeveen et al., 2015) and AskUbuntu (Lei et al., 2016) datasets. The SR task is to identify all sentences in the retrieval corpus that are semantically similar to a query sentence.10 For each dataset, we first build a graph connect- ing each of the positive pairs, and then compute its transitive closure. Each sentence then serves as a test query that should retrieve all of the other sentences it is connected to within the transitive closure. Mean average precision (MAP) is em- ployed to evaluate the models. More details on the constructed datasets can be found in Gillick et al. (2018). Both datasets are English only. Table 2 shows the MAP@100 on the Quo- ra/AskUbuntu retrieval tasks. We use Gillick et al. (2018) as the baseline model, which is trained us- ing a similar dual encoder architecture. The num- 9While USEQA Trans+Cxt uses the same underlying shared encoder as USETrans but with additional task specific layers, we anticipate that the models could diverge in the future. 10The task is related to paraphrase identification (Dolan et al., 2004) and Semantic Textual Similarity (STS) (Cer et al., 2017), but with the identification of meaning similarity being assessed in the context of a retrieval task. Model Yang et al. (2019) USECNN USETrans en-es 89.0 85.8 86.1 en-fr 86.1 82.7 83.3 en-ru 89.2 87.4 88.9 en-zh 87.9 79.5 78.8 Table 3: P@1 on UN Bitext retrieval task. Model SQuAD Dev Paragraph Retrieval USEQA Trans+Cxt BM25 (baseline) USETrans USEQA Trans+Cxt Sentence Retrieval SQuAD Train 53.3 52.4 37.2 43.3 63.5 61.6 47.1 53.2 Table 4: P@1 for SQuAD ReQA. Models are not trained on SQuAD. Dev and Train only refer to the respective sections of the SQuAD dataset. bers listed here are from the models without in- domain training data 11. 5.2 Bitext Retrieval (BR) Bitext retrieval performance is evaluated on the United Nation (UN) Parallel Corpus (Ziemski et al., 2016), containing 86,000 bilingual docu- ment pairs matching English (en) documents with with their translations in five other languages: French (fr), Spanish (es), Russian (ru), Arabic (ar) and Chinese (zh). Document pairs are aligned at the sentence-level, which results in 11.3 million aligned sentence pairs for each language pair. Table 3 shows precision@1 (P@1) for the pro- posed models as well as the current state-of-the-art results from Yang et al. (2019), which uses a dual- encoder architecture trained on mined bilingual data. USETrans is generally better than USECNN, performing lower than the SOTA but not by too much with the exception of en-zh.12 5.3 Retrieval Question Answering (ReQA) Similar to the data set construction used for the SR tasks, the SQuAD v1.0 dataset (Rajpurkar et al., 2016) is transformed into a retrieval question an- swering (ReQA) task.13 We first break all docu- 11The model for Quora is trained on Paralex (http: //knowitall.cs.washington.edu/paralex) and AskUbuntu data. The model for AskUbuntu is trained on Par- alex and Quora. 12Performance is degraded from Yang et al. (2019) due to using a single sentencepiece vocabulary to cover 16 lan- guages. Languages like Chinese, Korean, Japanese have much more characters. To ensure the vocab coverage, senten- cepiece tends to split the text of these languages into single characters, which increases the difficulty of the task. 13The retrieval question answering task was suggested by Chen et al. (2017) and then recently explored further by Cakaloglu et al. (2018). However, Cakaloglu et al. (2018)'s Model en ar de es fr it ja ko nl pt pl ru th tr zh / zh-t Cross-lingual Semantic Retrieval (cl-SR) Quora USECNN USETrans AskUbuntu USECNN USETrans Average USECNN USETrans SQuAD train USEQA Trans+Cxt 89.2 89.1 39.9 42.3 64.6 65.7 79.9 83.7 85.0 85.0 85.5 82.4 77.6 81.3 85.2 78.3 83.8 83.5 79.9 83.1 85.5 86.3 86.7 86.8 85.1 82.5 83.8 86.5 82.1 85.7 85.8 82.5 33.0 35.0 35.6 35.2 36.1 35.5 35.1 34.5 35.6 32.9 35.2 35.2 32.8 38.2 40.0 39.9 39.3 40.2 40.6 40.3 39.5 39.8 38.4 39.6 40.3 37.7 56.5 59.4 60.3 60.1 60.8 59.0 56.4 57.9 60.4 55.6 59.5 59.4 56.4 60.7 62.8 63.1 63.0 63.5 63.8 62.4 61.7 63.2 60.7 62.7 63.1 60.1 Cross-lingual Retrieval Question Answering (cl-ReQA) 81.9 84.8 34.6 40.1 58.3 62.5 43.3 33.2 35.2 37.2 37.0 37.0 32.9 31.1 36.6 37.7 34.5 33.2 36.9 32.3 32.7 Table 5: Cross-lingual performance on Quora/AskUbuntu cl-SR (MAP) and SQuAD cl-ReQA (P@1). Queries/questions are machine translated to the other languages, while retrieval candidates remain in English. ments in the dataset into sentences using an off- the-shelf sentence splitter. Each question of the (question, answer spans) tuples in the dataset is treated as a query. The task is to retrieve the sen- tence designated by the tuple answer span. Search is performed on a retrieval corpus consisting of all of the sentences within the corpus. We con- trast sentence and paragraph-level retrieval using our models, with the later allowing for comparison against a BM25 baseline (Jones et al., 2000).14 We evaluated ReQA using the SQuAD dev and train sets and without training on the SQuAD data.15 The sentence and paragraph retrieval P@1 are shown in table 4. For sentence retrieval, we compare encodings produced using context from the text surrounding the retrieval candidate, USEQA Trans+Cxt, to sentence encodings produced without contextual cues, USETrans. Paragraph re- trieval contrasts USEQA Trans+Cxt with BM25. 5.4 Cross-lingual Retrieval Our earlier experiments are extended to explore cross-lingual semantic retrieval (cl-SR) and cross- lingual retrieval question answering (cl-ReQA). 14BM25 is a strong baseline for text retrieval use of sampling makes it difficult to directly compare with their results and we provide our own baseline base on BM25. tasks. Paragraph-level experiments use the BM25 implementation: https://github.com/nhirakawa/BM25, with de- fault parameters. We exclude sentence-level BM25, as BM25 generally performs poorly at this granularity. 15 For sentences, the resulting retrieval task for develop- ment set consists of 11,425 questions and 10,248 candidates, and the retrieval task for train set is consists of 87,599 ques- tions and 91,703 candidates. For paragraph retrieval, there are 2,067 retrieval candidates in the development set and 18,896 in the training set. To retrieve paragraphs with our model, we first run sentence retrieval and use the retrieved nearest sentence to select the enclosing paragraph. SR queries and ReQA questions are machine translated into other languages, while keeping the retrieval candidates in English.16 Table 5 provides our cross-lingual retrieval results. On all the lan- guages, USETrans outperforms USECNN. While cross-lingual performance lags the English only tasks, the performance is surprisingly close given the added difficulty of the cross-lingual setting. 6 Experiments on Transfer Tasks For comparison with prior USE models, English task transfer performance is evaluated on SentE- val (Conneau and Kiela, 2018). For sentence clas- sification transfer tasks, the output of the sentence encoders are provided to a task specific DNN. For the pairwise semantic similarity task, the sim- ilarity of sentence embeddings 𝑢 and 𝑣 is as- sessed using − arccos following Yang et al. (2018). As shown in table 6, our multi- lingual models show competitive transfer perfor- mance comparing with state-of-the-art sentence embedding models. USETrans performs better than USECNN in all tasks. Our new multilin- gual USETrans even outperforms our best previ- ously released English only model, USETrans for English (Cer et al., 2018), on some tasks. 𝑢 𝑣 (︁ )︁ 𝑢𝑣 7 Resource Usage Figure (1) provides compute and memory usage benchmarks for our models.17 Inference times on 16Poor translations are detected and rejected when the orig- inal English text and English back translation have a cosine similarity < 0.5 according our previously released English USETrans model (Cer et al., 2018). 17 CPU benchmarks are run on Intel(R) Xeon(R) Platinum 8173M CPU @ 2.00GHz. GPU benchmarks were run on an NVidia v100. Memory footprint was measured on CPU. Model USE mutlilingual models USECNN USETransformer The state-of-the-art English embedding models InferSent (Conneau et al., 2017) Skip-Thought LN (Ba et al., 2016) Quick-Thought (Logeswaran and Lee, 2018) USEDAN for English (Cer et al., 2018) USETransformer for English (Cer et al., 2018) MR CR SUBJ MPQA TREC SST 73.8 78.1 81.1 79.4 82.4 72.2 82.2 83.2 87.0 86.3 83.1 86.0 78.5 84.2 90.1 92.1 92.4 93.7 94.8 92.1 95.5 87.7 89.9 90.2 89.3 90.2 86.9 88.1 96.4 96.6 88.2 -- 92.4 88.1 93.2 78.1 80.9 84.6 -- 87.6 77.5 83.7 STS Bench (dev / test) 0.829 / 0.809 0.837 / 0.825 0.801 / 0.758 -- -- 0.760 / 0.717 0.802 / 0.766 Table 6: Performance on English transfer tasks from SentEval (Conneau and Kiela, 2018). (a) CPU Inference Time (b) GPU Inference Time (c) Memory Footprint Figure 1: Resource usage for the multilingual Transformer and CNN encoding models. GPU are 2 to 3 times faster than CPU. Our CNN models have the smallest memory footprint and are the fastest on both CPU and GPU. The memory requirements increase with sentence length, with the Transformer model increasing more than twice as fast as the CNN model.18 While this makes CNNs an attractive choice for efficiently encoding longer texts, this comes with a corresponding drop in accuracy on many retrieval and transfer tasks. 8 Conclusion two multilingual models for em- We present bedding sentence-length text. Our models em- bed text from 16 languages into a shared se- mantic embedding space and achieve perfor- mance on transfer tasks that approaches mono- lingual sentence embedding models. The mod- els achieve good performance on semantic re- trieval (SR), bitext retrieval (BR) and retrieval question answering (ReQA). They achieve per- formance on cross-lingual semantic retrieval (cl- 18Transformer models are ultimately governed by a time and space complexity of 𝑂(𝑛2). The benchmarks show for shorter sequence lengths the time and space requirements are dominated by computations that scale linearly with length and have a larger constant factor than the quadratic terms. SR) and cross-lingual retrieval question answer- ing (cl-ReQA) that approaches monolingual SR and ReQA performance for many language pars. Our models are made freely available with ad- ditional documentation and tutorial colaboratory notebooks at: https://tfhub.dev/s?q=universal- sentence- encoder-multilingual. Acknowledgments We thank our teammates from Descartes and other Google groups for their feedback and suggestions. Special thanks goes to Muthu Chidambaram for his early exploration of multilingual training, Taku Kudo for the SentencePiece model support, Chen Chen for the templates used to perform the transfer learning experiments and Mario Guajardo for an early version of the ReQA tutorial Colab. References Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Va- sudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiao- qiang Zheng. 2016. Tensorflow: A system for large-scale machine learning. In Proceedings of USENIX OSDI'16, OSDI'16, pages 265 -- 283. Lei Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. 2016. Layer normalization. CoRR, abs/1607.06450. Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus In Proceedings for learning natural language inference. of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632 -- 642. Tolgahan Cakaloglu, Christian Szegedy, and Xiaowei Xu. 2018. Text embeddings for retrieval from a large knowl- edge base. CoRR, abs/1810.10176. Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez-Gazpio, and Lucia Specia. 2017. SemEval-2017 task 1: Seman- tic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Work- shop on Semantic Evaluation (SemEval-2017), pages 1 -- 14. Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, Brian Strope, and Ray Kurzweil. 2018. Universal sentence encoder for English. In Proceedings of the 2018 Conference on Em- pirical Methods in Natural Language Processing: System Demonstrations, pages 169 -- 174. Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bor- des. 2017. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1870 -- 1879. Muthuraman Chidambaram, Yinfei Yang, Daniel Cer, Steve Yuan, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. 2018. Learning cross-lingual sentence representations via a multi-task dual-encoder model. CoRR, abs/1810.12836. Alexis Conneau and Douwe Kiela. 2018. SentEval: An eval- uation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC-2018). Alexis Conneau, Douwe Kiela, Holger Schwenk, Loïc Bar- rault, and Antoine Bordes. 2017. Supervised learning of universal sentence representations from natural language In Proceedings of the 2017 Conference inference data. on Empirical Methods in Natural Language Processing, pages 670 -- 680, Copenhagen, Denmark. Association for Computational Linguistics. Bill Dolan, Chris Quirk, and Chris Brockett. 2004. Unsuper- vised construction of large paraphrase corpora: Exploiting massively parallel news sources. In COLING 2004: Pro- ceedings of the 20th International Conference on Compu- tational Linguistics, pages 350 -- 356. Daniel Gillick, Alessandro Presta, and Gaurav Singh Tomar. 2018. End-to-end retrieval in continuous space. CoRR, abs/1811.08008. Doris Hoogeveen, Karin M. Verspoor, and Timothy Bald- win. 2015. Cqadupstack: A benchmark data set for com- In Proceedings of munity question-answering research. the 20th Australasian Document Computing Symposium, ADCS '15, pages 3:1 -- 3:8. K. Sparck Jones, S. Walker, and S. E. Robertson. 2000. A probabilistic model of information retrieval: Develop- Inf. Process. Man- ment and comparative experiments. age., 36(6):779 -- 808. Yoon Kim. 2014. Convolutional neural networks for sen- tence classification. In Proceedings of the 2014 Confer- ence on Empirical Methods in Natural Language Process- ing (EMNLP), pages 1746 -- 1751. Taku Kudo and John Richardson. 2018. SentencePiece: A simple and language independent subword tokenizer and In Proceedings detokenizer for neural text processing. of the 2018 Conference on Empirical Methods in Natu- ral Language Processing: System Demonstrations, pages 66 -- 71. Tao Lei, Hrishikesh Joshi, Regina Barzilay, Tommi Jaakkola, Kateryna Tymoshenko, Alessandro Moschitti, and Lluís Màrquez. 2016. Semi-supervised question retrieval with gated convolutions. In Proceedings of the 2016 Confer- ence of the North American Chapter of the Association for Computational Linguistics: Human Language Tech- nologies, pages 1279 -- 1289. Lajanugen Logeswaran and Honglak Lee. 2018. An efficient framework for learning sentence representations. In Inter- national Conference on Learning Representations (ICLR). Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for ma- chine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383 -- 2392. Jakob Uszkoreit, Jay Ponte, Ashok Popat, and Moshe Du- biner. 2010. Large scale parallel document mining for ma- chine translation. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pages 1101 -- 1109. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkor- eit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Proceed- ings of NIPS, pages 6000 -- 6010. Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence under- In Proceedings of the 2018 standing through inference. Conference of the North American Chapter of the Asso- ciation for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112 -- 1122. Yinfei Yang, Gustavo Hernández Ábrego, Steve Yuan, Mandy Guo, Qinlan Shen, Daniel Cer, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. 2019. Improv- ing multilingual sentence embedding using bi-directional CoRR, dual encoder with additive margin softmax. abs/1902.08564. Yinfei Yang, Steve Yuan, Daniel Cer, Sheng-yi Kong, Noah Constant, Petr Pilar, Heming Ge, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. 2018. Learning semantic tex- In Proceedings of tual similarity from conversations. The Third Workshop on Representation Learning for NLP, pages 164 -- 174. Michał Ziemski, Marcin Junczys-Dowmunt, and Bruno Pouliquen. 2016. The united nations parallel corpus v1.0. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC 2016), pages 3530 -- 3534.
1908.11828
1
1908
2019-08-30T16:40:00
PAWS-X: A Cross-lingual Adversarial Dataset for Paraphrase Identification
[ "cs.CL" ]
Most existing work on adversarial data generation focuses on English. For example, PAWS (Paraphrase Adversaries from Word Scrambling) consists of challenging English paraphrase identification pairs from Wikipedia and Quora. We remedy this gap with PAWS-X, a new dataset of 23,659 human translated PAWS evaluation pairs in six typologically distinct languages: French, Spanish, German, Chinese, Japanese, and Korean. We provide baseline numbers for three models with different capacity to capture non-local context and sentence structure, and using different multilingual training and evaluation regimes. Multilingual BERT fine-tuned on PAWS English plus machine-translated data performs the best, with a range of 83.1-90.8 accuracy across the non-English languages and an average accuracy gain of 23% over the next best model. PAWS-X shows the effectiveness of deep, multilingual pre-training while also leaving considerable headroom as a new challenge to drive multilingual research that better captures structure and contextual information.
cs.CL
cs
PAWS-X: A Cross-lingual Adversarial Dataset for Paraphrase Identification Yinfei Yang∗, Yuan Zhang∗, Chris Tar and Jason Baldridge Google Research, Mountain View, 94043 {yinfeiy, zhangyua, ctar, jasonbaldridge}@google.com 9 1 0 2 g u A 0 3 ] L C . s c [ 1 v 8 2 8 1 1 . 8 0 9 1 : v i X r a Abstract Most existing work on adversarial data gen- eration focuses on English. For example, PAWS (Paraphrase Adversaries from Word Scrambling) (Zhang et al., 2019) consists of challenging English paraphrase identification pairs from Wikipedia and Quora. We rem- edy this gap with PAWS-X, a new dataset of 23,659 human translated PAWS evaluation pairs in six typologically distinct languages: French, Spanish, German, Chinese, Japanese, and Korean. We provide baseline numbers for three models with different capacity to capture non-local context and sentence struc- ture, and using different multilingual training and evaluation regimes. Multilingual BERT (Devlin et al., 2019) fine-tuned on PAWS En- glish plus machine-translated data performs the best, with a range of 83.1-90.8 accuracy across the non-English languages and an av- erage accuracy gain of 23% over the next best model. PAWS-X shows the effectiveness of deep, multilingual pre-training while also leaving considerable headroom as a new chal- lenge to drive multilingual research that better captures structure and contextual information. 1 Introduction Adversarial examples have effectively highlighted the deficiencies of state-of-the-art models for many natural language processing tasks, e.g. ques- tion answering (Jia and Liang, 2017; Chen et al., 2018; Ribeiro et al., 2018), textual entailment (Zhao et al., 2018; Glockner et al., 2018), and text classification (Alzantot et al., 2018; Iyyer et al., 2018). Zhang et al. (2019) introduce PAWS, which has adversarial paraphrase identification pairs with high lexical overlap, like flights from New York to Florida and flights from Florida to New York. Such pairs stress the importance of modeling sentence structure and context because ∗equal contribution they have high word overlap ratio but different semantic meaning. In addition to revealing fail- ures of state-of-the-art models, research on ad- versarial examples has generally shown that aug- menting training data with good adversarial exam- ples can boost performance for some models -- providing greater clarity to the modeling land- scape as well providing new headroom for further improvements. Most previous work focuses only on English de- spite the fact that the problems highlighted by ad- versarial examples are shared by other languages. Existing multilingual datasets for paraphrase iden- tification, e.g. Multi30k (Elliott et al., 2016) and Opusparcus (Creutz, 2018), lack challenging ex- amples like PAWS. The lack of high-quality ad- versarial examples in other languages makes it difficult to benchmark model improvements. We bridge this gap by creating Cross-lingual PAWS (PAWS-X), an extension of the Wikipedia por- tion of the PAWS evaluation and test examples to six languages: Spanish, French, German, Chi- nese, Japanese, and Korean. This new corpus con- sists of 23,659 human translated example pairs with paraphrase judgments in each target lan- guage. Like previous work on multilingual cor- pus creation (Conneau et al., 2018), we machine translate the original PAWS English training set (49,401 pairs). Note that all translated pairs still have high word overlap and they inherit seman- tic similarity labels from the original PAWS exam- ples; thus, the resulting dataset preserves the abil- ity of probing structure and context sensitivity for models. We also machine translate the evaluation pairs of each language into English to establish the baseline performance of a translate-then-predict strategy. The PAWS-X dataset, including both the new human translated pairs and the machine translated examples, is available for download at https://github.com/google-research-datasets/paws. Language Text en fr es de zh ja ko Original Pair (id: 000005309 9438, label: not-paraphrasing) However, in order to defeat Slovak, Derek must become a vampire attacker. However, in order to become Slovak, Derek must defeat a vampire assassin. Human Translated Pairs Toutefois, pour battre Slovak, Derek doit devenir un vampire attaquant. Cependant, pour devenir Slovak, Derek doit vaincre un vampire assassin. Sin embargo, para derrotar a Slovak, Derek debe convertirse en un atacante vampiro. Sin embargo, para poder convertirse en Slovak, Derek debe derrotar a un asesino de vampiros. Um Slovak zu besiegen, muss Derek jedoch zum Vampirjager werden. Um jedoch Slowake zu werden, muss Derek einen Vampirjager besiegen. 但为击败斯洛伐克,德里克必须成为吸血鬼攻击者。 然而,为了成为斯洛伐克人,德里克必须击败吸血鬼刺客。 ただし、スロバークを倒すためには、デレクは吸血鬼アタッカーになる必要があります。 しかし、デレクがスロバックになるには、バンバイア・アサシンを倒さなければならない。 하nᅵђ҉ᆫ Slovaknᅵ яtьᅵ nғјҊ Dereknҕ ѓ҉ яҕѕᅵ ѓҊ 파nᅵnҍ n҉ᆷѕ҉ᆯ자ёҕ ђt ёᅵnҏ야ђ҉ᆫ ј҉ юᅵ다. 하nᅵђ҉ᆫ Slovaknҕ ђt ёᅵnᅵьᅵ nғјҊ Dereknҕ ѓҊ 파nᅵnҍ 사юҋᆼэt nᅵ яtnҍ야ђ҉ᆫ јҊ ѕҕ юᅵ다. Table 1: Examples of human translated pairs for each of the six languages. Our experiments show that PAWS-X effectively measures the multilingual adaptability of models and how well they capture context and word or- der. The state-of-the-art multilingual BERT model (Devlin et al., 2019) obtains a 32% (absolute) ac- curacy improvement over a bag-of-words model. We also show that machine translation helps and works better than a zero-shot strategy. We find that performance on German, French, Spanish is overall better than Chinese, Japanese and Korean. 2 PAWS-X Corpus The core of our corpus creation procedure is to translate the Wikipedia portion of the original PAWS corpus from English (en) to six languages: French (fr), Spanish (es), German (de), Chinese (zh), Japanese (ja), and Korean (ko). To this end, we hire human translators to translate the develop- ment and test sets, and use a neural machine trans- lation (NMT) service1 to translate the training set. We choose translation instead of repeating the PAWS data generation approach (Zhang et al., 2019) to other languages. This has at least three advantages. First, human translation does not re- quire high-quality multilingual part-of-speech tag- gers or named entity recognizers, which play a key role in the data generation process used in Zhang et al. (2019). Second, human translators are trained to produce the target sentence while preserving meaning, thereby ensuring high data quality. Third, the resulting data can provide a new testbed for cross-lingual transfer techniques because examples in all languages are translated from the same sources. For example, PAWS-X 1https://cloud.google.com/translate/ fr 1,992 1,985 es 1,962 1,999 de 1,932 1,967 zh 1,984 1,975 ja 1,980 1,946 ko 1,965 1,972 dev test Table 2: Examples translated per language. could be used to evaluate whether a German or French sentence is a paraphrase of a Chinese or Japanese one. Translating Evaluation Sets We obtain human translations on a random sample of 4,000 sentence pairs from the PAWS development set for each of the six languages (48,000 translations). The manual translation is performed by 10-20 in-house professionals that are native speakers of each lan- guage. A randomly sampled subset is presented and validated by a second worker. The final de- livery is guaranteed to have less than 5% word level error rate. The sampled 4,000 pairs are split into new development and test sets, 2,000 pairs for each. Due to time and cost constraints, we could not translate all 16,000 examples in both of original PAWS development and test set. Each sentence in a pair is presented independently so that trans- lation is not affected by context. In our initial studies we noticed that sometimes it was difficult to translate an entity mention. We therefore ask translators to translate entity mentions, but differ- ent translators may have different preferences ac- cording to their background knowledge. Table 1 gives example translated pairs in each language. Resulting Corpus Some sentences could not be be translated. Table 2 shows the final counts trans- lated to each language. Most of the untranslated sentences were due to incompleteness or ambigu- ities, such as It said that Easipower was, and Park Green took over No. These sentences are likely from the adversarial generation process when cre- ating PAWS. On average less than 2% of the pairs are not translated, and we simply exclude them. The authors further verified translation quality for a random sample of ten pairs in each language. PAWS-X includes 23,459 human-translated pairs, including 11,815 and 11,844 pairs in development and test, respectively. Finally, original PAWS la- bels (paraphrase or not paraphrase) are mapped to the translations. Positive pairs account for 44.0% of development sets and 45.4% of test respectively -- close to the PAWS label distribution. Translation brings new challenges to the para- phrasing identification task. An entity can be translated differently, such as Slovak and Slowake (Table 1) and models need to capture that these refer to the same entity. In a more challenging ex- ample, Four Rivers, Audubon and Shawnee Trails are translated in just one of the sentences: en s1 From the merger of the Four Rivers Council and the Audubon Council, the Shawnee Trails Council was born. s2 Shawnee Trails Council was formed from the merger of the Four Rivers Council and the Audubon Council. zh s1 Four Rivers 委 员 会 与 Audubon 委 员 会 合 并 后,Shawnee Trails 委员会得以问世. s2 肖尼小径(Shawnee Trails) 委 员 会 由 合 并 四河 (Four Rivers) 委员会和 奥杜邦 (Audubon) 委 员会成立. In the zh-s2 example, the parentheses give English glosses of Chinese entity mentions. BOW ESIM BERT Non-local context Word interaction Translate Train Translate Test Zero Shot Merged × × X X × × X × X X × × X X X X X X Table 3: Complexity of each evaluated model and the training/evaluation strategies being tested. similarity. Third, we evaluate BERT, Bidirec- tional Encoder Representations from Transform- ers (Devlin et al., 2019), which recently achieved state-of-the-art results on eleven natural language processing tasks. We evaluate all models with two strategies (Conneau et al., 2018): (1) Translate Train: the English training data is machine-translated into each target language to provide data to train each model and (2) Translate Test: train a model using the English training data, and machine-translate all test examples to English for evaluation. Multilingual BERT is a single model trained on 104 languages, which enables experiments with cross-lingual training regimes. (1) Zero Shot: the model is trained on the PAWS English training data, and then directly evaluated on all others. Ma- chine translation is not involved in this strategy. (2) Merged: train a multilingual model on all lan- guages, including the original English pairs and machine-translated data in all other languages. Table 3 summarizes the models with respect to whether they represent non-local contexts or sup- port cross-sentential word interaction, plus which strategies are evaluated for each model. 3 Evaluated Methods 4 Experiments and Results The goal of PAWS-X is to probe models' abil- ity to capture structure and context in a multi- lingual setting. We consider three models with varied complexity and expressiveness. The first baseline is a simple bag-of-words (BOW) encoder with cosine similarity. It uses unigram to bigram token encoding as input features and takes a co- sine value above 0.5 as a paraphrase. The second model is ESIM, Enhanced Sequential Inference Model (Chen et al., 2017). Following Zhang et al. (2019), ESIM encodes each sentence using a BiL- STM, and passes the concatenation of encod- ings through a feed-forward layer for classifica- tion. The additional layers allow ESIM to capture more complex sentence interaction than cosine We use the latest public multilingual BERT base model with 12 layers2 and apply the default fine- tuning strategy with batch size 32 and learning rate 1e-5. For BOW and ESIM, we use our own im- plementations and 300 dimensional multilingual word embeddings from fastText.3 We allow fine- tuning word embeddings during training, which gives better empirical performance. We use two metrics: classification accuracy and area-under-curve scores of precision-recall curves (AUC-PR). For BERT, probability scores for the positive class is used to compute AUC-PR. For BOW and ESIM a cosine threshold of 0.5 is used 2http://goo.gl/language/bert 3https://fasttext.cc/ Method BOW en fr es de zh ja ko en fr es de zh ja ko Accuracy AUC-PR Translate Train Translate Test 55.8 51.7 54.9 -- 47.9 50.2 54.7 55.2 54.5 55.1 55.3 55.9 56.7 55.2 41.1 -- 48.9 46.8 46.3 45.5 46.4 50.0 45.8 50.9 48.7 49.3 46.8 48.5 ESIM Translate Train Translate Test 67.2 66.2 66.2 -- 66.0 63.7 66.3 66.0 60.3 59.6 62.0 62.3 54.2 60.6 69.6 -- 67.0 64.2 68.4 69.5 59.2 58.2 68.2 62.3 56.3 50.5 61.8 60.3 BERT Translate Train Translate Test Zero shot Merged 93.5 89.3 88.7 85.2 93.8 90.8 -- -- 89.0 85.3 89.3 88.4 86.0 82.2 90.7 89.2 82.3 79.2 79.3 75.3 75.8 70.5 85.4 83.1 79.9 72.6 71.7 83.9 97.1 -- -- 96.5 93.6 92.4 93.8 93.1 91.0 90.5 94.0 92.9 92.0 87.4 92.9 85.1 89.4 79.6 92.9 88.9 81.4 82.4 80.9 80.1 72.7 75.5 86.0 86.3 Table 4: Accuracy (%) and AUC-PR (%) of each approach. Best numbers in each column are marked in bold. Method BOW ESIM BERT Averaged Accuracy AUC-PR Translate Train Translate Test Translate Train Translate Test Translate Train Translate Test Zero Shot Merged 52.7 55.2 61.7 63.9 84.2 82.3 78.6 87.2 48.4 47.3 59.2 65.1 88.2 87.6 83.1 90.2 Table 5: Average Accuracy (%) and AUC-PR (%) over the six languages. to compute accuracy. In all experiments, the best model checkpoint is chosen based on accuracy on development sets and report results on testing sets. Results Table 4 shows the performance of all methods and languages. Table 5 summarizes the average results for the six non-English languages. Model Comparisons: On both Translate Train and Translate Test, BERT consistently outper- forms both BOW and ESIM by a substantial mar- gin (>15% absolute accuracy gains) across all seven languages. BERT Translate Train achieves an average 20% accuracy gain. This result demon- strates that PAWS-X effectively measures models' sensitivity to word order and syntactic structure. Training/Evaluation Strategies: As Table 4 and 5 show, the Zero Shot strategy yields the low- est performance compared to other strategies on BERT. This is evidence that machine-translated data helps in the multilingual scenario. Indeed, when training on machine-translated examples in all languages (Merged), the model achieves the best performance, with 8.6% accuracy and 7.1% AUC-PR average gains over Zero Shot. BERT and ESIM show different performance patterns on Translate Train and Translate Test. Translate Test appears to give consistently bet- ter performance then Translate Train on ESIM, 0 # 32 % 1.6 1-2 52 2.6 3-4 140 7.0 5-6 542 27.1 7 1234 61.7 Table 6: The count of examples by number of lan- guages (of 7) that agree with the gold label in test set. but not on BERT. This may be because multilin- gual BERT is pre-trained on over one hundred lan- guages; hence BERT provides better initialization for non-English languages than ESIM (which re- lies on fastText embeddings). The gap between training on English and on other languages is therefore smaller on BERT than on ESIM, which makes Translate Train work better on BERT. Language Difference: Across all models and approaches, performance on Indo-European lan- guages (German, French, Spanish) is consistently better than CJK (Chinese, Japanese, Korean). The performance difference is particularly noticeable on Zero Shot. This can be explained from two perspectives. First, the MT system we used works better on Indo-European languages than on CJK. Second, the CJK family is more typologically and syntactically different from English. For example, in table 1, Slowake in German is much closer to the original term Slovak in English, compared with its Chinese translation 斯洛伐克. This at least partly explains why performance on CJK is particularly poor in Zero Shot. Error Analysis: To gauge the difficulty of each example for the best model (BERT-merged), Table 6 shows the count of examples based on how many languages for the same pair are assigned the cor- rect label in test set. The majority of the examples are easy, with 61.7% correct in all languages. Of the 32 examples that failed in all languages, most are hard or highly ambiguous. Some have incor- rect gold labels or were generated incorrectly in the original PAWS data. The following is a sample of these. a1 On July 29, 1791, Sarah married Lea Thomas Wright Hill (1765 -- 1842) at St. Martin's Church in Birmingham and had 8 children. a2 Thomas Wright Hill married Sarah Lea (1765 -- 1842) on 29 July 1791 at St Martin's Church, Birmingham and had 8 children. match b1 He established himself eventually in the northwest of Italy, apparently supported by Guy, where he probably comes "title". b2 He eventually established himself in northwestern Italy, apparently supported by Guy, where he probably received the title of "comes". not match We also considered examples that are correctly predicted in just half of the languages. Some of these failed because of translation noise, e.g. in- consistent entity translations (as shown in §2). 5 Conclusion We introduce PAWS-X, a challenging paraphrase identification dataset with 23,659 human trans- lated evaluation pairs in six languages. Our exper- imental results showed that PAWS-X effectively measures sensitivity of models to word order and the efficacy of cross-lingual learning approaches. It also leaves considerable headroom as a new challenging benchmark to drive multilingual re- search on the problem of paraphrase identification. Acknowledgments We would like to thank our anonymous review- ers and the Google AI Language team, especially Luheng He, for the insightful comments that con- tributed to this paper. Many thanks also to the translate team, especially Mengmeng Niu, for the help with the annotations. References Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018. Generating natural language adversarial ex- amples. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Process- ing, pages 2890 -- 2896, Brussels, Belgium. Associ- ation for Computational Linguistics. Hongge Chen, Huan Zhang, Pin-Yu Chen, Jinfeng Yi, and Cho-Jui Hsieh. 2018. Attacking visual language grounding with adversarial examples: A case study on neural image captioning. In Proceedings of the 56th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), pages 2587 -- 2597, Melbourne, Australia. Association for Computational Linguistics. Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. 2017. Enhanced LSTM for natural language inference. In Proceedings of the 55th Annual Meeting of the Association for Com- putational Linguistics (Volume 1: Long Papers), pages 1657 -- 1668, Vancouver, Canada. Association for Computational Linguistics. Alexis Conneau, Ruty Rinott, Guillaume Lample, Ad- ina Williams, Samuel Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. XNLI: Evaluating cross-lingual sentence representations. In Proceed- ings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2475 -- 2485, Brussels, Belgium. Association for Computational Linguistics. Mathias Creutz. 2018. Open subtitles paraphrase corpus for six languages. In Proceedings of the Eleventh International Conference on Language Re- sources and Evaluation (LREC-2018), Miyazaki, Japan. European Languages Resources Association (ELRA). Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language under- standing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171 -- 4186, Minneapolis, Minnesota. Associ- ation for Computational Linguistics. Desmond Elliott, Stella Frank, Khalil Sima'an, and Lu- cia Specia. 2016. Multi30K: Multilingual English- German image descriptions. In Proceedings of the 5th Workshop on Vision and Language, pages 70 -- 74, Berlin, Germany. Association for Computational Linguistics. Max Glockner, Vered Shwartz, and Yoav Goldberg. 2018. Breaking NLI systems with sentences that re- quire simple lexical inferences. In Proceedings of the 56th Annual Meeting of the Association for Com- putational Linguistics (Volume 2: Short Papers), pages 650 -- 655, Melbourne, Australia. Association for Computational Linguistics. Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. 2018. Adversarial example generation with syntactically controlled paraphrase networks. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1875 -- 1885, New Orleans, Louisiana. Association for Computational Linguistics. Robin Jia and Percy Liang. 2017. Adversarial exam- ples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empiri- cal Methods in Natural Language Processing, pages 2021 -- 2031, Copenhagen, Denmark. Association for Computational Linguistics. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversar- ial rules for debugging NLP models. In Proceed- ings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Pa- pers), pages 856 -- 865, Melbourne, Australia. Asso- ciation for Computational Linguistics. Yuan Zhang, Jason Baldridge, and Luheng He. 2019. PAWS: Paraphrase adversaries from word scram- bling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Tech- nologies, Volume 1 (Long and Short Papers), pages 1298 -- 1308, Minneapolis, Minnesota. Association for Computational Linguistics. Zhengli Zhao, Dheeru Dua, and Sameer Singh. 2018. In Inter- Generating natural adversarial examples. national Conference on Learning Representations.
1511.06388
1
1511
2015-11-19T21:22:42
sense2vec - A Fast and Accurate Method for Word Sense Disambiguation In Neural Word Embeddings
[ "cs.CL", "cs.LG" ]
Neural word representations have proven useful in Natural Language Processing (NLP) tasks due to their ability to efficiently model complex semantic and syntactic word relationships. However, most techniques model only one representation per word, despite the fact that a single word can have multiple meanings or "senses". Some techniques model words by using multiple vectors that are clustered based on context. However, recent neural approaches rarely focus on the application to a consuming NLP algorithm. Furthermore, the training process of recent word-sense models is expensive relative to single-sense embedding processes. This paper presents a novel approach which addresses these concerns by modeling multiple embeddings for each word based on supervised disambiguation, which provides a fast and accurate way for a consuming NLP model to select a sense-disambiguated embedding. We demonstrate that these embeddings can disambiguate both contrastive senses such as nominal and verbal senses as well as nuanced senses such as sarcasm. We further evaluate Part-of-Speech disambiguated embeddings on neural dependency parsing, yielding a greater than 8% average error reduction in unlabeled attachment scores across 6 languages.
cs.CL
cs
Under review as a conference paper at ICLR 2016 SENSE2VEC - A FAST AND ACCURATE METHOD FOR WORD SENSE DISAMBIGUATION IN NEURAL WORD EMBEDDINGS. Andrew Trask & Phil Michalak & John Liu Digital Reasoning Systems, Inc. Nashville, TN 37212, USA {andrew.trask,phil.michalak,john.liu}@digitalreasoning.com ABSTRACT Neural word representations have proven useful in Natural Language Processing (NLP) tasks due to their ability to efficiently model complex semantic and syn- tactic word relationships. However, most techniques model only one representa- tion per word, despite the fact that a single word can have multiple meanings or ”senses”. Some techniques model words by using multiple vectors that are clus- tered based on context. However, recent neural approaches rarely focus on the application to a consuming NLP algorithm. Furthermore, the training process of recent word-sense models is expensive relative to single-sense embedding pro- cesses. This paper presents a novel approach which addresses these concerns by modeling multiple embeddings for each word based on supervised disambigua- tion, which provides a fast and accurate way for a consuming NLP model to select a sense-disambiguated embedding. We demonstrate that these embeddings can disambiguate both contrastive senses such as nominal and verbal senses as well as nuanced senses such as sarcasm. We further evaluate Part-of-Speech disam- biguated embeddings on neural dependency parsing, yielding a greater than 8% average error reduction in unlabeled attachment scores across 6 languages. 1 INTRODUCTION NLP systems seek to automate the extraction of information from human language. A key challenge in this task is the complexity and sparsity in natural language, which leads to a phenomenon known as the curse of dimensionality. To overcome this, recent work has learned real valued, distributed representations for words using neural networks (G.E. Hinton, 1986; Bengio et al., 2003; Morin & Bengio, 2005; Mnih & Hinton, 2009). These ”neural language models” embed a vocabulary into a smaller dimensional linear space that models ”the probability function for word sequences, ex- pressed in terms of these representations” (Bengio et al., 2003). The result is a vector-space model (VSM) that represents word meanings with vectors that capture the semantic and syntactic informa- tion of words (Maas & Ng, 2010). These distributed representations model shades of meaning across their dimensions, allowing for multiple words to have multiple real-valued relationships encoded in a single vector (Liang & Potts, 2015). Various forms of distributed representations have shown to be useful for a wide variety of NLP tasks including Part-of-Speech tagging, Named Entity Recognition, Analogy/Similarity Querying, Transliteration, and Dependency Parsing (Al-Rfou et al., 2013; Al-Rfou et al., 2015; Mikolov et al., 2013a;b; Chen & Manning, 2014). Extensive research has been done to tune these embeddings to various tasks by incorporating features such as character (compositional) information, word order information, and multi-word (phrase) information (Ling et al., 2015; Mikolov et al., 2013c; Zhang et al., 2015; Trask et al., 2015). Despite these advancements, most word embedding techniques share a common problem in that each word must encode all of its potential meanings into a single vector (Huang et al., 2012). For words with multiple meanings (or ”senses”), this creates a superposition in vector space where a vector takes on a mixture of its individual meanings. In this work, we will show that this superposition 1 Under review as a conference paper at ICLR 2016 obfuscates the context specific meaning of a word and can have a negative effect on NLP classifiers leveraging the superposition as input data. Furthermore, we will show that disambiguating multiple word senses into separate embeddings alleviates this problem and the corresponding confusion to an NLP model. 2 RELATED WORK 2.1 WORD2VEC Mikolov et al. (2013a) proposed two simple methods for learning continuous word embeddings using neural networks based on Skip-gram or Continuous-Bag-of-Word (CBOW) models and named it word2vec. Word vectors built from these methods map words to points in space that effectively encode semantic and syntactic meaning despite ignoring word order information. Furthermore, the word vectors exhibited certain algebraic relations, as exemplified by example: ”v[man] - v[king] + v[queen] ≈ v[woman]”. Subsequent work leveraging such neural word embeddings has proven to be effective on a variety of natural language modeling tasks (Al-Rfou et al., 2013; Al-Rfou et al., 2015; Chen & Manning, 2014). 2.2 WANG2VEC Because word embeddings in word2vec are insensitive to word order, they are suboptimal when used for syntactic tasks like POS tagging or dependency parsing. Ling et al. (2015) proposed modifica- tions to word2vec that incorporated word order. Consisting of structured skip-gram and continuous window methods that are together termed wang2vec, these models demonstrate significant ability to model syntactic representations. They come, however, at the cost of computation speed. Fur- thermore, because words have a single vector representation in wang2vec, the method is unable to model polysemic words with multiple meanings. For instance, the word ”work” in the sentence ”We saw her work” can be either a verb or noun depending on the broader context in surrounding this sentence. This technique encodes the co-occurrence statistics for each sense of a word into one or more fixed dimensional embeddings, generating embeddings that model multiple uses of a word. 2.3 STATISTICAL MULTI-PROTOTYPE VECTOR-SPACE MODELS OF WORD MEANING Perhaps a seminal work to vector-space word-sense disambiguation, the approach by Reisinger & Mooney (2010) creates a vector-space model that encodes multiple meanings for words by first clustering the contexts in which a word appears. Once the contexts are clustered, several prototype vectors can be initialized by averaging the statistically generated vectors for each word in the cluster. This process of computing clusters and creating embeddings based on a vector for each cluster has become the canonical strategy for word-sense disambiguation in vector spaces. However, this approach presents no strategy for the context specific selection of potentially many vectors for use in an NLP classifier. 2.4 CLUSTERING WEIGHTED AVERAGE CONTEXT EMBEDDINGS Our technique is inspired by the work of Huang et al. (2012), which uses a multi-prototype neu- ral vector-space model that clusters contexts to generate prototypes. Unlike Reisinger & Mooney (2010), the context embeddings are generated by a neural network in the following way: given a pre-trained word embedding model, each context embedding is generated by computing a weighted sum of the words in the context (weighted by tf-idf). Then, for each term, the associated context embeddings are clustered. The clusters are used to re-label each occurrence of each word in the cor- pus. Once these terms have been re-labeled with the cluster’s number, a new word model is trained on the labeled embeddings (with a different vector for each) generating the word-sense embeddings. In addition to the selection problem and clustering overhead described in the previous subsection, this model also suffers from the need to train neural word embeddings twice, which is a very expen- sive endeavor. 2 Under review as a conference paper at ICLR 2016 2.5 CLUSTERING CONVOLUTIONAL CONTEXT EMBEDDINGS Recent work has explored leveraging convolutional approaches to modeling the context embeddings that are clustered into word prototypes. Unlike previous approaches, Chen et al. (2015) selects the number of word clusters for each word based on the number of definitions for a word in the WordNet Gloss (as opposed to other approaches that commonly pick a fixed number of clusters). A variant on the MSSG model of Neelakantan et al. (2015), this work uses the WordNet Glosses dataset and convolutional embeddings to initialize the word prototypes. In addition to the selection problem, clustering overhead, and the need to train neural embeddings multiple times, this higher-quality model is somewhat limited by the vocabulary present in the En- glish WordNet resource. Furthermore, the majority of the WordNets relations connect words from the same Part-of-Speech (POS). ”Thus, WordNet really consists of four sub-nets, one each for nouns, verbs, adjectives and adverbs, with few cross-POS pointers.”1 3 THE SENSE2VEC MODEL We expand on the work of Huang et al. (2012) by leveraging supervised NLP labels instead of unsupervised clusters to determine a particular word instance’s sense. This eliminates the need to train embeddings multiple times, eliminates the need for a clustering step, and creates an efficient method by which a supervised classifier may consume the appropriate word-sense embedding. Figure 1: A graphical representation of wang2vec. Figure 2: A graphical representation of sense2vec. Given a labeled corpus (either by hand or by a model) with one or more labels per word, the sense2vec model first counts the number of uses (where a unique word maps set of one or more 1https://wordnet.princeton.edu/ 3 Under review as a conference paper at ICLR 2016 labels/uses) of each word and generates a random ”sense embedding” for each use. A model is then trained using either the CBOW, Skip-gram, or Structured Skip-gram model configurations. Instead of predicting a token given surrounding tokens, this model predicts a word sense given surrounding senses. 3.1 SUBJECTIVE EVALUATION - SUBJECTIVE BASELINE For subjective evaluation of these word embeddings, we trained models using several datasets for comparison. First, we trained using Word2vec’s Continuous Bag of Words 2 approach on the large unlabeled corpus used for the Google Word Analogy Task 3. Several word embeddings and their closest terms measured by cosine similarity are displayed in Table 1 below. bank banks banking hsbc citibank lender lending 1.0 .718 .672 .599 microsoft .586 .566 .559 ipod imac iphones 1.0 .687 .649 .603 .595 .594 .578 so but it if even do just Table 1: Single-sense Baseline Cosine Similarities apple iphone ipad 1.0 bad .879 good .858 worse lousy .842 stupid .833 horrible .831 .808 awful 1.0 .727 .718 .717 .710 .703 .697 perfect perfection perfectly ideal flawless good always 1.0 .681 .670 .644 .637 .622 .572 In this table, observe that the ”bank” column is similar to proper nouns (”hsbc”, ”citibank”), verbs (”lending”,”banking”), and nouns (”banks”,”lender”). This is because the term ”bank” is used in 3 different ways, as a proper noun, verb, and noun. This embedding for ”bank” has modeled a mixture of these three meanings. ”apple”, ”so”, ”bad”, and ”perfect” can also have a mixture of meanings. In some cases, such as ”apple”, one interpretation of the word is completely ignored (apple the fruit). In the case of ”so”, there is also an interjection sense of ”so” that is not well represented in the vector space. 3.2 SUBJECTIVE EVALUATION - PART-OF-SPEECH DISAMBIGUATION For Part-of-Speech disambiguation, we labeled the dataset from section 3.1 with Part-of-Speech tags using the Polyglot Universal Dependency Part-of-Speech tagger of Al-Rfou et al. (2013) and trained sense2vec with identical parameters as section 3.1. In table 2, we see that this method has successfully disambiguated the difference between the noun ”apple” referring to the fruit and the proper noun ”apple” referring to the company. In table 3, we see that all three uses of the word ”bank” have been disambiguated by their respective parts of speech, and in table 4, nuanced senses of the word ”so” have also been disambiguated. Table 2: Part-of-Speech Cosine Similarities for the Word: apple 1.0 apple apple apples pear peach NOUN NOUN .639 microsoft NOUN .581 iphone ipad NOUN .579 blueberry NOUN .570 almond NOUN .541 samsung blackberry PROPN 1.0 PROPN .603 NOUN .591 NOUN .586 PROPN .572 PROPN .564 2command line params: -size 500 -window 10 -negative 10 -hs 0 -sample 1e-5 -iter 3 -min-count 10 3the data.txt file generated from http://word2vec.googlecode.com/svn/trunk/demo-train-big-model-v1.sh 4 Under review as a conference paper at ICLR 2016 Table 3: Part-of-Speech Cosine Similarities for the Word: bank NOUN 1.0 bank NOUN .786 banks banking NOUN .629 NOUN .619 lender citibank PROPN .570 wachovia bank ubs PROPN .535 grindlays 1.0 PROPN .570 NOUN PROPN .536 PROPN .523 PROPN .503 PROPN .492 bank 1.0 gamble VERB .533 VERB .485 earn invest VERB .470 reinvest VERB .466 donate VERB .466 bank bank hsbc VERB Table 4: Part-of-Speech Cosine Similarities for the Word: so INTJ INTJ INTJ INTJ INTJ INTJ ADJ ADJ condemnable ADJ ADJ ADJ ADJ ADV ADV CONJ SCONJ ADV ADV disputable disapprove contestable 1.0 .753 .752 .720 .694 .671 1.0 .527 .520 .513 .505 .503 so too but because but really so poved 1.0 .588 .584 .578 .559 .558 so now obviously basically okay actually 3.3 SUBJECTIVE EVALUATION - SENTIMENT DISAMBIGUATION For Sentiment disambiguation, the IMDB labeled training corpus was labeled with Part-of-Speech tags using the Polyglot Part-of-Speech tagger from Al-Rfou et al. (2013). Adjectives were then labeled with the positive or negative sentiment associated with each comment. A CBOW sense2vec model was then trained on the resulting dataset, disambiguating between both Part-of-Speech and Sentiment (for adjectives). Table 5 shows the difference between the positive and negative vectors for the word ”bad”. The neg- ative vector is most similar to word indicating the classical meaning of bad (including the negative version of ”good”, e.g. ”good grief!”). The positive ”bad” vector denotes a tone of sarcasm, most closely relating to the positive sense of ”good” (e.g. ”good job!”). Table 5: Sentiment Cosine Similarities for the Word: bad bad NEG 1.0 bad terrible NEG .905 good horrible NEG .872 wrong NEG .870 funny awful NEG .863 good great NEG .845 weird stupid POS POS POS POS POS POS 1.0 .753 .752 .720 .694 .671 Table 6 shows the positive and negative senses of the word ”perfect”. The positive version of the word clusters most closely with words indicating excellence. The positive version clusters with the more sarcastic interpretation. 5 Under review as a conference paper at ICLR 2016 Table 6: Sentiment Cosine Similarities for the Word: perfect perfect real 1.0 NEG perfect NEG 0.682 wonderful brilliant incredible fantastic unfortunate NEG 0.680 NEG 0.673 NEG 0.673 NEG 0.673 NEG 0.661 NEG 0.650 serious complete ordinary typical misguided POS POS POS POS POS POS POS POS 1.0 0.843 0.842 0.840 0.839 0.823 0.822 0.814 great excellent amazing 4 NAMED ENTITY RESOLUTION To evaluate the embeddings when disambiguating on named entity resolution (NER), we labeled the standard word2vec dataset from section 3.2 with named entity labels. This demonstrated how sense2vec can also disambiguate between multi-word sequences of text as well as single word se- quences of text. Below, we see that the word ”Washington” is disambiguated with both a PERSON and a GPE sense of the word. Furthermore, we see that Hillary Clinton is very similar to titles that she has held within the time span of the dataset. Table 7: Disambiguation for the word: Washington George Washington Henry Knox Philip Schuyler Nathanael Greene Benjamin Lincoln William Howe GPE .665 PERSON NAME .656 Washington D GPE .591 PERSON NAME .624 Washington DC PERSON NAME .618 GPE .559 PERSON NAME .613 Warsaw Embassy GPE .524 GPE .516 PERSON NAME .602 PERSON NAME .591 GPE .507 Maryland Seattle Wash Table 8: Entity resolution for the term: Hillary Clinton Secretary of State Senator Senate Chief White House Congress TITLE TITLE 0.661 0.613 ORG NAME 0.564 0.555 ORG NAME 0.564 ORG NAME 0.547 TITLE 5 NEURAL DEPENDENCY PARSING To quantitatively evaluate disambiguated sense embeddings relative to the current standard, we com- pared sense2vec embeddings and wang2vec embeddings on neural syntactic dependency parsing tasks in six languages. First, we trained two sets of embeddings on the Bulgarian, German, English, French, Italian, and Swedish Wikipedia datasets from the Polyglot website4. The baseline em- beddings were trained without any Part-of-Speech disambiguation using the structured skip-gram approach of Ling et al. (2015). For each language, the sense2vec embeddings were trained by disambiguating terms using the language specific Polyglot Part-of-Speech tagger of Al-Rfou et al. (2013), and embedded in the same structured skip-gram approach. Both were trained using identical parametrization 5. 4https://sites.google.com/site/rmyeid/projects/polyglot 5command line params: -size 50 -window 5 -negative 10 -hs 0 -sample 1e-4 -iter 5 -cap 0 6 Under review as a conference paper at ICLR 2016 Each of these embeddings was used to train a dependency parse model using the parser outlined in (Chen & Manning, 2014). All were trained on the the respective language’s Universal Dependencies treebank. The standard splits were used.6 For the parser trained on the sense2vec emeddings, the POS specific embedding was used as the input. The Part-of-Speech label was determined using the gold-standard POS tags from the treebank. It should be noted that the parser of (Chen & Manning, 2014) uses trained Part-of-Speech embeddings as input which are indexed based on gold-standard POS tags. Thus, differences in quality between parsers trained on the two embedding styles are due to clarity in the word embeddings as opposed to the addition of Part-of-Speech information because both model styles train on gold standard POS information. For each language, the Unlabeled Attachment Scores are outlined in Table 7. wang sense Table 9: Unlabeled Attachment Scores and Percent Error Reductions Set Dev Test* Test Dev Test* Test Dev Test Error Margin Abs. Avg. Swedish Mean Bulgarian German English French 80.28 78.94 73.82 68.86 78.60 82.47 70.10 60.25 78.88 82.51 70.53 60.54 81.21 81.94 75.43 72.61 80.38 84.44 71.66 64.17 72.16 84.60 80.69 64.43 6.56% 3.98% 12.06% 8.52% 13.69% 10.95% 12.82% 5.50% 8.21% 12.71% 8.78% 10.93% 14.54% 5.86% 5.32% 13.58% 9.23% 12.32% 10.29% 6.03% 6.09% 12.39% 90.03 90.17 90.39 90.69 90.41 90.86 7.05% 2.47% 5.17% 4.76% 85.02 83.61 83.88 86.10 85.48 85.93 7.76% Italian 84.99 84.99 85.45 85.57 86.13 86.18 The ”Error Margin” section of table 7 describes the percentage reduction in error for each language. Disambiguating based on Part-of-Speech using sense2vec reduced the error in all six languages with an average reduction greater than 8%. 6 CONCLUSION AND FUTURE WORK In this work, we have proposed a new model for word sense disambiguation that uses supervised NLP labeling to disambiguate between word senses. Much like previous models, it leverages a form of context clustering to disambiguate the use of a term. However, instead of using unsupervised clus- tering methods, our approach clusters using supervised labels which can analyze a specific word’s context and assign a label. This significantly reduces the computational overhead of word-sense modeling and provides a natural mechanism for other NLP tasks to select the appropriate sense em- bedding. Furthermore, we show that disambiguated embeddings can increase the accuracy of syn- tactic dependency parsing in a variety of languages. Future work will explore how disambiguated embeddings perform using other varieties of supervised labels and consuming NLP tasks. REFERENCES Al-Rfou, Rami, Perozzi, Bryan, and Skiena, Steven. Polyglot: Distributed word representations for multilingual NLP. CoRR, abs/1307.1662, 2013. URL http://arxiv.org/abs/1307. 1662. Al-Rfou, Rami, Kulkarni, Vivek, Perozzi, Bryan, and Skiena, Steven. Polyglot-NER: Massive mul- tilingual named entity recognition. Proceedings of the 2015 SIAM International Conference on Data Mining, Vancouver, British Columbia, Canada, April 30 - May 2, 2015, April 2015. Bengio, Yoshua, Ducharme, R´ejean, Vincent, Pascal, and Janvin, Christian. A neural probabilistic language model. J. Mach. Learn. Res., 3:1137–1155, March 2003. ISSN 1532-4435. 6The German, French, and Italian treebanks had occasional tokens that both spanned multiple indices and overlapped with the index of the previous and following token (ex. 0, 0-1, 1,...), a property which is incompati- ble with the (Chen & Manning, 2014) parser. These tokens were removed. If their removal created a malformed tree, the sentence was removed automatically by the parser and logged accordingly. 7 Under review as a conference paper at ICLR 2016 Chen, Danqi and Manning, Christopher. A fast and accurate dependency parser using neural net- works. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Pro- cessing (EMNLP), pp. 740–750, Doha, Qatar, October 2014. Association for Computational Lin- guistics. URL http://www.aclweb.org/anthology/D14-1082. Chen, Tao, Xu, Ruifeng, He, Yulan, and Wang, Xuan. Improving distributed representation of word sense via wordnet gloss composition and context clustering. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Con- ference on Natural Language Processing (Volume 2: Short Papers), pp. 15–20, Beijing, China, July 2015. Association for Computational Linguistics. URL http://www.aclweb.org/ anthology/P15-2003. G.E. Hinton, J.L. McClelland, D.E. Rumelhart. Distributed representations. Parallel dis-tributed processing: Explorations in the microstructure of cognition, 1(3):77–109, 1986. Huang, Eric H., Socher, Richard, Manning, Christopher D., and Ng, Andrew Y. Improving word In Proceedings of the 50th representations via global context and multiple word prototypes. Annual Meeting of the Association for Computational Linguistics: Long Papers - Volume 1, ACL ’12, pp. 873–882, Stroudsburg, PA, USA, 2012. Association for Computational Linguistics. URL http://dl.acm.org/citation.cfm?id=2390524.2390645. Liang, P. and Potts, C. Bringing machine learning and compositional semantics together. Annual Reviews of Linguistics, 1(1):355–376, 2015. Ling, Wang, Dyer, Chris, Black, Alan W, and Trancoso, Isabel. Two/too simple adaptations of word2vec for syntax problems. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1299–1304, Denver, Colorado, May–June 2015. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/N15-1142. Maas, Andrew L and Ng, Andrew Y. A probabilistic model for semantic word vectors. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2010. Mikolov, Tomas, Chen, Kai, Corrado, Greg, and Dean, Jeffrey. Efficient estimation of word repre- sentations in vector space. CoRR, abs/1301.3781, 2013a. URL http://arxiv.org/abs/ 1301.3781. Mikolov, Tomas, Le, Quoc V., and Sutskever, Ilya. Exploiting similarities among languages for machine translation. CoRR, abs/1309.4168, 2013b. URL http://arxiv.org/abs/1309. 4168. Mikolov, Tomas, Sutskever, Ilya, Chen, Kai, Corrado, Greg, and Dean, Jeffrey. Distributed repre- sentations of words and phrases and their compositionality. CoRR, abs/1310.4546, 2013c. URL http://arxiv.org/abs/1310.4546. Mnih, Andriy and Hinton, Geoffrey E. A scalable hierarchical distributed language model. In Koller, D., Schuurmans, D., Bengio, Y., and Bottou, L. (eds.), Advances in Neural Information Processing Systems 21, pp. 1081–1088. Curran Associates, Inc., 2009. Morin, Frederic and Bengio, Yoshua. Hierarchical probabilistic neural network language model. In Proceedings of the international workshop on artificial intelligence and statistics, pp. 246–252. Citeseer, 2005. Neelakantan, Arvind, Shankar, Jeevan, Passos, Alexandre, and McCallum, Andrew. Efficient non- parametric estimation of multiple embeddings per word in vector space. CoRR, abs/1504.06654, 2015. URL http://arxiv.org/abs/1504.06654. Reisinger, Joseph and Mooney, Raymond J. Multi-prototype vector-space models of word meaning. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, HLT ’10, pp. 109–117, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. ISBN 1-932432-65-5. URL http://dl. acm.org/citation.cfm?id=1857999.1858012. 8 Under review as a conference paper at ICLR 2016 Trask, Andrew, Gilmore, David, and Russell, Matthew. Modeling order in neural word embeddings at scale. CoRR, abs/1506.02338, 2015. URL http://arxiv.org/abs/1506.02338. Zhang, Xiang, Zhao, Junbo, and LeCun, Yann. Character-level convolutional networks for text clas- sification. CoRR, abs/1509.01626, 2015. URL http://arxiv.org/abs/1509.01626. 9
1804.03209
1
1804
2018-04-09T19:58:17
Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition
[ "cs.CL", "cs.HC" ]
Describes an audio dataset of spoken words designed to help train and evaluate keyword spotting systems. Discusses why this task is an interesting challenge, and why it requires a specialized dataset that is different from conventional datasets used for automatic speech recognition of full sentences. Suggests a methodology for reproducible and comparable accuracy metrics for this task. Describes how the data was collected and verified, what it contains, previous versions and properties. Concludes by reporting baseline results of models trained on this dataset.
cs.CL
cs
Speech Commands: A Dataset for Limited-Vocabulary Speech Recognition Pete Warden Google Brain Mountain View, California [email protected] April 2018 1 Abstract Describes an audio dataset[1] of spoken words de- signed to help train and evaluate keyword spotting systems. Discusses why this task is an interesting challenge, and why it requires a specialized dataset that's different from conventional datasets used for automatic speech recognition of full sentences. Sug- gests a methodology for reproducible and compara- ble accuracy metrics for this task. Describes how the data was collected and verified, what it contains, previous versions[2] and properties. Concludes by reporting baseline results of models trained on this dataset. 2 Introduction Speech recognition research has traditionally required the resources of large organizations such as universi- ties or corporations to pursue. People working in those organizations usually have free access to either academic datasets through agreements with groups like the Linguistic Data Consortium[3], or to propri- etary commercial data. As speech technology has matured, the number of people who want to train and evaluate recognition models has grown beyond these traditional groups, but the availability of datasets hasn't widened. As the example of ImageNet[4] and similar collections in computer vision has shown, broadening access to datasets encourages collaborations across groups and enables apples-for-apples comparisons between differ- ent approaches, helping the whole field move forward. The Speech Commands dataset is an attempt to build a standard training and evaluation dataset for a class of simple speech recognition tasks. Its primary goal is to provide a way to build and test small mod- els that detect when a single word is spoken, from a set of ten or fewer target words, with as few false positives as possible from background noise or unre- lated speech. This task is often known as keyword spotting. To reach a wider audience of researchers and devel- opers, this dataset has been released under the Cre- ative Commons BY 4.0 license[5]. This enables it to easily be incorporated in tutorials and other scripts where it can be downloaded and used without any user intervention required (for example to register on a website or email an administrator for permission). This license is also well known in commercial set- tings, and so can usually be dealt with quickly by legal teams where approval is required. 3 Related Work Mozilla's Common Voice dataset[6] has over 500 hours from 20,000 different people, and is available under the Creative Commons Zero license (similar to public domain). This licensing makes it very easy to build on top of. It is aligned by sentence, and 1 was created by volunteers reading requested phrases through a web application. LibriSpeech[7] is a collection of 1,000 hours of read English speech, released under a Creative Commons BY 4.0 license, and stored using the open source FLAC encoder, which is widely supported. Its la- bels are aligned at the sentence level only, thus lack- ing word-level alignment information. This makes it more suitable for full automatic speech recognition than keyword spotting. TIDIGITS[8] contains 25,000 digit sequences spo- ken by 300 different speakers, recorded in a quiet room by paid contributors. The dataset is only available under a commercial license from the Lan- guage Data Consortium, and is stored in the NIST SPHERE file format, which proved hard to decode using modern software. Our initial experiments on keyword spotting were performed using this dataset. CHiME-5[9] has 50 hours of speech recorded in peo- ple's homes, stored as 16 KHz WAV files, and avail- able under a restricted license. It's aligned at the sentence level. 4 Motivations Many voice interfaces rely on keyword spotting to start interactions. For example you might say "Hey Google" or "Hey Siri"[10] to begin a query or com- mand for your phone. Once the device knows that you want to interact, it's possible to send the audio to a web service to run a model that's only limited by commercial considerations, since it can run on a server whose resources are controlled by the cloud provider. The initial detection of the start of an in- teraction is impractical to run as a cloud-based ser- vice though, since it would require sending audio data over the web from all devices all the time. This would be very costly to maintain, and would increase the privacy risks of the technology. Instead, most voice interfaces run a recognition module locally on the phone or other device. This lis- tens continuously to audio input from microphones, and rather than sending the data over the internet to a server, they run models that listen for the desired trigger phrases. Once a likely trigger is heard, the transfer of the audio to a web service begins. Because the local model is running on hardware that's not un- der the web service provider's control, there are hard resource constraints that the on-device model has to respect. The most obvious of these is that the mobile processors typically present have total compute capa- bilities that are much lower than most servers, so to run in near real-time for an interactive response, on- device models must require fewer calculations than their cloud equivalents. More subtly, mobile devices have limited battery lives and anything that is run- ning continuously needs to be very energy efficient or users will find their device is drained too quickly. This consideration doesn't apply to plugged-in home devices, but those do have thermal constraints on how much heat they can dissipate that restrict the amount of energy available to local models, and are encouraged by programs like EnergyStar to reduce their overall power usage as much as possible. A fi- nal consideration is that users expect a fast response from their devices, and network latency can be highly variable depending on the environment, so some ini- tial acknowledgement that a command was received is important for a good experience, even if the full server response is delayed. These constraints mean that the task of keyword spotting is quite different to the kind of speech recog- nition that's performed on a server once an interac- tion has been spotted: • Keyword spotting models must be smaller and involved less compute. • They need to run in a very energy-efficient way. • Most of their input will be silence or background noise, not speech, so false positives on those must be minimized. • Most of the input that is speech will be unrelated to the voice interface, so the model should be unlikely to trigger on arbitrary speech. • The important unit of recognition is a single word or short phrase, not an entire sentence. These differences mean that the training and eval- uation process between on-device keyword spotting 2 and general speech recognition models is quite dif- ferent. There are some promising datasets to sup- port general speech tasks, such as Mozilla's Common Voice, but they aren't easily adaptable to keyword spotting. This Speech Commands dataset aims to meet the special needs around building and testing on-device models, to enable model authors to demonstrate the accuracy of their architectures using metrics that are comparable to other models, and give a simple way for teams to reproduce baseline models by training on identical data. The hope is that this will speed up progress and collaboration, and improve the overall quality of models that are available. A second important audience is hardware manu- facturers. By using a publicly-available task that closely reflects product requirements, chip vendors can demonstrate the accuracy and energy usage of their offerings in a way that's easily comparable for potential purchasers. This increased transparency should result in hardware that better meets product requirements over time. The models should also pro- vide clear specifications that hardware engineers can use to optimize their chips, and potentially suggest model changes that make it easier to provide efficient implementations. This kind of co-design between ma- chine learning and hardware can be a virtuous circle, increasing the flow of useful information between the domains in a way that helps both sides. 5 Collection 5.1 Requirements I made the decision to focus on capturing audio that reflected the on-device trigger phrase task described above. This meant that the use of studio-captured samples seemed unrealistic, since that audio would lack background noise, would be captured with high- quality microphones, and in a formal setting. Suc- cessful models would need to cope with noisy environ- ments, poor quality recording equipment, and people talking in a natural, chatty way. To reflect this, all utterances were captured through phone or laptop microphones, wherever users happened to be. The one exception was that I asked them to avoid record- ing themselves whenever there were background con- versations happening for privacy reasons, so I asked them to be in a room alone with the door closed. I also decided to focus on English. This was for pragmatic reasons, to limit the scope of the gather- ing process and make it easier for native speakers to perform quality control on the gathered data. I hope that transfer learning and other techniques will still make this dataset useful for other languages though, and I open-sourced the collection application to al- low others to easily gather similar data in other lan- guages. I did want to gather as wide a variety of ac- cents as possible however, since we're familiar from experience with the bias towards American English in many voice interfaces. Another goal was to record as many different peo- ple as I could. Keyword-spotting models are much more useful if they're speaker-independent, since the process of personalizing a model to an individual re- quires an intrusive user interface experience. With this in mind, the recording process had to be quick and easy to use, to reduce the number of people who would fail to complete it. I also wanted to avoid recording any personally- identifiable information from contributors, since any such data requires handling with extreme care for pri- vacy reasons. This meant that I wouldn't ask for any attributes like gender or ethnicity, wouldn't require a sign-in through a user ID that could link to personal data, and would need users to agree to a data-usage agreement before contributing. To simplify the training and evaluation process, I decided to restrict all utterances to a standard dura- tion of one second. This excludes longer words, but the usual targets for keyword recognition are short so this didn't seem to be too restrictive. I also decided to record only single words spoken in isolation, rather than as part of a sentence, since this more closely re- sembles the trigger word task we're targeting. It also makes labeling much easier, since alignment is not as crucial. 3 5.2 Word Choice I wanted to have a limited vocabulary to make sure the capture process was lightweight, but still have enough variety for models trained on the data to potentially be useful for some applications. I also wanted the dataset to be usable in comparable ways to common proprietary collections like TIDIGITS. This led me to pick twenty common words as the core of our vocabulary. These included the digits zero to nine, and in version one, ten words that would be useful as commands in IoT or robotics applica- tions; "Yes", "No", "Up", "Down", "Left", "Right", "On", "Off", "Stop", and "Go". In version 2 of the dataset, I added four more command words; "Back- ward", "Forward", "Follow", and "Learn". One of the most challenging problems for keyword recognition is ignoring speech that doesn't contain triggers, so I also needed a set of words that could act as tests of that ability in the dataset. Some of these, such as "Tree", were picked because they sound similar to target words and would be good tests of a model's discernment. Others were chosen arbitrarily as short words that covered a lot of different phonemes. The final list was "Bed", "Bird", "Cat", "Dog", "Happy", "House", "Marvin", "Sheila", "Tree", and "Wow". 5.3 Implementation To meet all these requirements, I created an open- source web-based application that recorded utter- ances using the WebAudioAPI[11]. This API is sup- ported on desktop browsers like Firefox and Chrome, and on Android mobile devices. It's not available on iOS, which was considered to be unfortunate but there were no alternatives that were more attractive. I also looked into building native mobile applications for iOS and Android, but I found that users were reluctant to install them, for privacy and security reasons. The web experience requires users to grant permission to the website to access the microphone, but that seemed a lot more acceptable, based on the increased response rate. The initial test of the ap- plication was hosted at an appspot.com subdomain, but it was pointed out that teaching users to give mi- crophone permissions to domains that were easy for malicious actors to create was a bad idea. To address this, the final home of the application was moved to: https://aiyprojects.withgoogle.com/ ֒→ open_speech_recording This is a known domain that's controlled by Google, and so it should be much harder to create confusing spoofs of. The initial page that a new user sees when navi- gating to the application explains what the project is doing, and asks them to explicitly and formally agree to participating in the study. This process was de- signed to ensure that the resulting utterances could be freely redistributed as part of an open dataset, and that users had a clear understanding of what the ap- plication was doing. When a user clicks on "I Agree", a session cookie is added to record their agreement. The recording portion of the application will only be shown if this session cookie is found, and all upload accesses are guarded by cross-site request forgery to- kens, to ensure that only audio recorded from the application can be uploaded, and that utterances are from users who have agreed to the terms. The recording page asks users to press a "Record" button when they're ready, and then displays a ran- dom word from the list described above. The word is displayed for 1.5 seconds while audio is recorded, and then another randomly-chosen word is shown af- ter a one-second pause. Each audio clip is added to a list that's stored locally on the client's machine, and they remain there until the user has finished record- ing all words and has a chance to review them. The random ordering of words was chosen to avoid pro- nunciation changes that might be caused by repeti- tion of the same word multiple times. Core words are shown five times each in total, whereas auxiliary words only appear once. There are 135 utterances collected overall, which takes around six minutes in total to run through completely. The user can pause and restart at any point. Once the recording process is complete, the user is asked to review all of the clips, and if they're happy with them, upload them. This then invokes a web API which uploads the audio to the server applica- tion, which saves them into a cloud storage bucket. 4 The WebAudioAPI returns the audio data in OGG- compressed format, and this is what gets stored in the resulting files. The session ID is used as the prefix of each file name, and then the requested word is fol- lowed by a unique instance ID for the recording. This session ID has been randomly generated, and is not tied to an account or any other demographic informa- tion, since none has been generated. It does serve as a speaker identifier for utterances however. To ensure there's a good distribution of different speakers, once a user has gone through this process once a cookie is added to the application that ensures they can't access the recording page again. To gather volunteers for this process, I used ap- peals on social media to share the link and the aims of the project. I also experimented with using paid crowdsourcing for some of the utterances, though the majority of the dataset comes from the open site. 5.4 Quality Control The gathered audio utterances were of variable qual- ity, and so I needed criteria to accept or reject sub- missions. The informal guideline I used was that if a human listener couldn't tell what word was being spoken, or it sounded like an incorrect word, then the clip should be rejected. To accomplish this, I used several layers of review. To remove clips that were extremely short or quiet, I took advantage of the nature of the OGG compres- sion format. Compressed clips that contained very little audio would be very small in size, so a good heuristic was that any files that were smaller than 5 KB were unlikely to be correct. To implement this rule, I used the following Linux shell command: find ${BASEDIR}/oggs -iname "*.ogg" -size ֒→ -5k -delete With that complete, I then converted the OGG files into uncompressed WAV files containing PCM sample data at 16KHz, since this is any easier format for further processing: find ${BASEDIR}/oggs -iname "*.ogg" -print0 ֒→ xargs -0 basename -s .ogg xargs ֒→ -I {} ffmpeg -i ${BASEDIR}/oggs/{}. ֒→ ogg -ar 16000 ${BASEDIR}/wavs/{}.wav Samples from other sources came as varying sample-rate WAV files, so they were also resampled to 16 KHz WAV files using a similar ffmpeg command. 5.5 Extract Loudest Section From manual inspection of the results, there were still large numbers of utterances that were too quiet or completely silent. The alignment of the spoken words within the 1.5 second file was quite arbitrary too, depending on the speed of the user's response to the word displayed. To solve both these problems, I created a simple audio processing tool called Ex- tract Loudest Section to examine the overall volume of the clips. As a first stage, I summed the absolute differences of all the samples from zero (using a scale where -32768 in the 16-bit sample data was -1.0 as a floating-point number, and +32767 was 1.0), and looked at the mean average of that value to estimate the overall volume of the utterance. From experi- mentation, anything below 0.004 on this metric was likely to be to quiet to be intelligible, and so all of those clips were removed. To approximate the correct alignment, the tool then extracted the one-second clip that contained the highest overall volume. This tended to center the spoken word in the middle of the trimmed clip, as- suming that the utterance was the loudest part of the recording. To run these processes, the following commands were called: git clone https://github.com/petewarden/ ֒→ extract_loudest_section tmp/ ֒→ extract_loudest_section cd tmp/extract_loudest_section make cd ../.. mkdir -p ${BASEDIR}/trimmed_wavs /tmp/extract_loudest_section/gen/bin/ ֒→ extract_loudest_section ${BASEDIR}'/ ֒→ wavs/*.wav' ${BASEDIR}/trimmed_wavs/ 5 5.6 Manual Review These automatic processes caught technical problems with quiet or silent recordings, but there were still some utterances that were of incorrect words or were unintelligible for other reasons. To filter these out I turned to commercial crowdsourcing. The task asked workers to type in the word they heard from each clip, and gave a list of the expected words as examples. Each clip was only evaluated by a single worker, and any clips that had responses that didn't match their expected labels were removed from the dataset. 5.7 Release Process The recorded utterances were moved into folders, with one for each word. The original 16-digit hex- adecimal speaker ID numbers from the web applica- tion's file names were hashed into 8-digit hexadecimal IDs. Speaker IDs from other sources (like the paid crowdsourcing sites) were also hashed into the same format. This was to ensure that any connection to worker IDs or other personally-identifiable informa- tion was removed. The hash function used is stable though, so in future releases the IDs for existing files should remain the same, even as more speakers are added. 5.8 Background Noise A key requirement for keyword spotting in real prod- ucts is distinguishing between audio that contains speech, and clips that contain none. To help train and test this capability, I added several minute-long 16 KHz WAV files of various kinds of background noise. Several of these were recorded directly from noisy environments, for example near running water or machinery. Others were generated mathematically using these commands in Python: scipy.io.wavfile.write('/tmp/white_noise. ֒→ wav', 16000, np.array(((acoustics. ֒→ generator.noise(16000*60, color=' ֒→ white'))/3) * 32767).astype(np.int16 ֒→ )) scipy.io.wavfile.write('/tmp/pink_noise.wav ֒→ ', 16000, np.array(((acoustics. ֒→ generator.noise(16000*60, color=' ֒→ pink'))/3) * 32767).astype(np.int16) ֒→ ) To distinguish these files from word utter- they were placed in a specially-named in the root of the ances, "_background_noise_" folder, archive. 6 Properties The final dataset consisted of 105,829 utterances of 35 words, broken into the categories and frequencies shown in Table 1. Each utterance is stored as a one-second (or less) WAVE format file, with the sample data encoded as linear 16-bit single-channel PCM values, at a 16 KHz rate. There are 2,618 speakers recorded, each with a unique eight-digit hexadecimal identifier assigned as described above. The uncompressed files take up approximately 3.8 GB on disk, and can be stored as a 2.7GB gzip-compressed tar archive. 7 Evaluation One of this dataset's primary goals is to enable mean- ingful comparisons between different models' results, so it's important to suggest some precise testing pro- tocols. As a starting point, it's useful to specify ex- actly which utterances can be used for training, and which must be reserved for testing, to avoid over- fitting. The dataset download includes a text file called validation_list.txt, which contains a list of files that are expected to be used for validating re- sults during training, and so can be used frequently to help adjust hyperparameters and make other model changes. The testing_list.txt file contains the names of audio clips that should only be used for mea- suring the results of trained models, not for training or validation. The set that a file belongs to is chosen using a hash function on its name. This is to en- sure that files remain in the same set across releases, even as the total number changes, so avoid set cross- contamination when trying old models on the more recent test data. The Python implementation of the 6 Word Number of Utterances 7.1 Top-One Error Backward Bed Bird Cat Dog Down Eight Five Follow Forward Four Go Happy House Learn Left Marvin Nine No Off On One Right Seven Sheila Six Stop Three Tree Two Up Visual Wow Yes Zero 1,664 2,014 2,064 2,031 2,128 3,917 3,787 4,052 1,579 1,557 3,728 3,880 2,054 2,113 1,575 3,801 2,100 3,934 3,941 3,745 3,845 3,890 3,778 3,998 2,022 3,860 3,872 3,727 1,759 3,880 3,723 1,592 2,123 4,044 4,052 Figure 1: How many recordings of each word are present in the dataset set assignment algorithm is given in the TensorFlow tutorial code[12] that is a companion to the dataset. 7 The simplest metric to judge a trained model against is how many utterances it can correctly identify. In principle this can be calculated by running the model against all the files in the testing set, and comparing the reported against the expected label for each. Un- like image classification tasks like ImageNet, it's not obvious how to weight all of the different categories. For example, I want a model to indicate when no speech is present, and separately to indicate when it thinks a word has been spoken that's not one it rec- ognizes. These "open world" categories need to be weighted according to their expected occurrence in a real application to produce a realistic metric that reflects the perceived quality of the results in a prod- uct. The standard chosen for the TensorFlow speech commands example code is to look for the ten words "Yes", "No", "Up", "Down", "Left", "Right", "On", "Off", "Stop", and "Go", and have one additional special label for "Unknown Word", and another for "Silence" (no speech detected). The testing is then done by providing equal numbers of examples for each of the twelve categories, which means each class accounts for approximately 8.3% of the total. The "Unknown Word" category contains words randomly sampled from classes that are part of the target set. The "Silence" category has one-second clips ex- tracted randomly from the background noise audio files. I've uploaded a standard set of test files[13] to make it easier to reproduce this metric. If you want to cal- culate the canonical Top-One error for a model, run inference on each audio clip, and compare the top pre- dicted class against the ground truth label encoded in its containing subfolder name. The proportion of correct predictions will give you the Top-One error. There's also a similar collection of test files[14] avail- able for version one of the dataset. The example training code that accompanies the dataset[15] provides results of 88.2% on this met- ric for the highest-quality model when fully trained. This translates into a model that qualitatively gives a reasonable, but far from perfect response, so it's expected that this will serve as a baseline to be ex- ceeded by more sophisticated architectures. 7.2 Streaming Error Metrics Top-One captures a single dimension of the perceived quality of the results, but doesn't reveal much about other aspects of its performance in a real application. For example, models in products receive a continuous stream of audio data and don't know when words start and end, whereas the inputs to Top One eval- uations are aligned to the beginning of utterances. The equal weighting of each category in the overall score also doesn't reflect the distribution of trigger words and silence in typical environments. To measure some of these more complex properties of models, I test them against continuous streams of audio and score them on multiple metrics. Here's what the baseline model trained with V2 data pro- duces: 49.0% matched, 46.0% correctly, 3.0% ֒→ wrongly, 0.0% false positives To produce this result, I ran the following bash script against the 10 minute streaming test audio clip and ground truth labels: bazel run tensorflow/examples/ ֒→ speech_commands:freeze -- -- ֒→ start_checkpoint=/tmp/ ֒→ speech_commands_train/conv.ckpt ֒→ -18000 --output_file=/tmp/ ֒→ v2_frozen_graph.pb bazel run tensorflow/examples/ ֒→ speech_commands: ֒→ test_streaming_accuracy -- --graph=/ ֒→ tmp/v2_frozen_graph.pb --wav=/tmp/ ֒→ speech_commands_train/streaming_test ֒→ .wav --labels=/tmp/ ֒→ speech_commands_train/conv_labels. ֒→ txt --ground_truth=/tmp/ ֒→ speech_commands_train/ ֒→ streaming_test_labels.txt • Matched-percentage represents how many words were correctly identified, within a given time tol- erance. • Wrong-percentage shows how many words were correctly distinguished as speech rather than background noise, but were given the wrong class label. • False-positive percentage is the number of words detected that were in parts of the audio where no speech was actually present. An algorithm for calculating these values given listing ground implemented in TensorFlow as an audio file and a text file truth labels test_streaming_accuracy.cc[16]. is Performing successfully on these metrics requires more than basic template recognition of audio clips. There has to be at least a very crude set of rules to suppress repeated recognitions of the same word in short time frames, so default logic for this is imple- mented in recognize_commands.cc[17]. This allows a simple template-style recognition model to be used directly to generate these statis- tics. One of the other configurable features of the accuracy test is the time tolerance for how close to the ground truth's time a recognition result must be to count as a match. The default for this is set to 750ms, since that seems to match with requirements for some of the applications that are supported. To make reproducing and comparing results easier, I've made available a one-hour audio file[18] contain- ing a mix of utterances at random times and noise, to- gether with a text file marking the times and ground truth labels of each utterance. This was generated using the script included in the TensorFlow tutorial, and can be used to compare different models perfor- mance on streaming applications. 7.3 Historical Evaluations Version 1 of the dataset[2] was released August 3rd 2017, and contained 64,727 utterances from 1,881 speakers. Training the default convolution model from the TensorFlow tutorial (based on Convolu- tional Neural Networks for Small-footprint Keyword Spotting[19]) using the V1 training data gave a Top- One score of 85.4%, when evaluated against the test set from V1. Training the same model against ver- sion 2 of the dataset[1], documented in this paper, 8 produces a model that scores 88.2% Top-One on the training set extracted from the V2 data. A model trained on V2 data, but evaluated against the V1 test set gives 89.7% Top-One, which indicates that the V2 training data is responsible for a substantial improvement in accuracy over V1. The full set of results are shown in Table 2. Data V1 Training V2 Training V1 Test V2 Test 85.4% 82.7% 89.7% 88.2% Figure 2: Top-One accuracy evaluations using differ- ent training data These figures were produced using the checkpoints produced by the following training commands: python tensorflow/examples/speech_commands/ ֒→ train.py --data_url=\protect\vrule ֒→ width0pt\protect\href{http:// ֒→ download.tensorflow.org/data/ ֒→ speech_commands_v0.01.tar.gz}{http ֒→ ://download.tensorflow.org/data/ ֒→ speech_commands_v0.01.tar.gz} python tensorflow/examples/speech_commands/ ֒→ train.py --data_url=\protect\vrule ֒→ width0pt\protect\href{http:// ֒→ download.tensorflow.org/data/ ֒→ speech_commands_v0.02.tar.gz}{http ֒→ ://download.tensorflow.org/data/ ֒→ speech_commands_v0.02.tar.gz} The results of these commands are available as pre- trained checkpoints[20]. The evaluations were per- formed by running variations on the following com- mand line (with the v1/v2's substituted as appropri- ate): ֒→ start_checkpoint=${HOME}/ ֒→ speech_commands_checkpoints/conv-v ֒→ {1,2}.ckpt-18000 7.4 Applications The TensorFlow tutorial gives a variety of baseline models, but one of the goals of the dataset is to en- able the creation and comparison of a wide range of models on a lot of different platforms, and version one of has enabled some interesting applications. CMSIS- NN[21] covers a new optimized implementation of neural network operations for ARM microcontrollers, and uses Speech Commands to train and evaluate the results. Listening to the World[22] demonstrates how combining the dataset and UrbanSounds[23] can im- prove the noise tolerance of recognition models. Did you Hear That[24] uses the dataset to test adversar- ial attacks on voice interfaces. Deep Residual Learn- ing for Small Footprint Keyword Spotting[25] shows how approaches learned from ResNet can produce more efficient and accurate models. Raw Waveform- based Audio Classification[26] investigates alterna- tives to traditional feature extraction for speech and music models. Keyword Spotting Through Image Recognition[27] looks at the effect virtual adversarial training on the keyword task. 8 Conclusion The Speech Commands dataset has shown to be use- ful for training and evaluating a variety of models, and the second version shows improved results on equivalent test data, compared to the original. 9 Acknowledgements python tensorflow/examples/speech_commands/ ֒→ train.py --data_url=\protect\vrule ֒→ width0pt\protect\href{http:// ֒→ download.tensorflow.org/data/ ֒→ speech_commands_v0.01}{http:// ֒→ download.tensorflow.org/data/ ֒→ speech_commands_v0.0{1},1}.tar.gz -- Massive thanks are due to everyone who donated recordings to this data set, I'm very grateful. I also couldn't have put this together without the help and support of Billy Rutledge, Rajat Monga, Raziel Al- varez, Brad Krueger, Barbara Petit, Gursheesh Kour, Robert Munro, Kirsten Gokay, David Klein, Lukas Biewald, and all the AIY and TensorFlow teams. 9 References [1] (2018) Speech commands dataset version 2. [Online]. Available: http://download.tensorflow.org/data/speech_commands_v0.02.tar.gz [2] (2017) Speech commands dataset version 1. [Online]. Available: http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz [3] (2018) Linguistic data consortium. [Online]. Available: https://www.ldc.upenn.edu/ [4] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "ImageNet: A Large-Scale Hierarchical Image Database," in CVPR09, 2009. [5] (2018) Creative commons international attribution international 4.0 license. [Online]. Available: https://creativecommons.org/licenses/by/4.0/ [6] (2017) Mozilla common voice. [Online]. Available: https://voice.mozilla.org/en [7] V. Panayotov, G. Chen, D. Povey, and S. Khudanpur, "Librispeech: an ASR corpus based on public domain audio books," in Proceedings of the International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2015. [8] R. G. Leonard and G. R. Doddington. (1992) A speaker-independent connected-digit database. [Online]. Available: https://catalog.ldc.upenn.edu/docs/LDC93S10/tidigits.readme.html [9] (2018) The 5th chime speech separation and recognition challenge. [Online]. Available: http://spandh.dcs.shef.ac.uk/chime_challenge/data.html [10] (2017) Hey siri: An on-device dnn-powered voice trigger for apple's personal assistant. [Online]. Available: https://machinelearning.apple.com/2017/10/01/hey-siri.html [11] (2015) Web audio api. [Online]. Available: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API [12] (2018) Implementation of set assignment algorithm. [Online]. Available: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/speech_commands/input_data.py#L61 [13] (2018) Speech commands dataset test set version 2. [Online]. Available: http://download.tensorflow.org/data/speech_commands_test_set_v0.02.tar.gz [14] (2017) Speech commands dataset test set version 1. [Online]. Available: http://download.tensorflow.org/data/speech_commands_test_set_v0.01.tar.gz [15] (2017) Tensorflow audio recognition tutorial. [Online]. Available: https://www.tensorflow.org/tutorials/audio_recognition [16] (2018) test_streaming_accuracy.cc source file. [Online]. Available: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/speech_commands/test_streaming_accuracy.cc [17] (2018) recognize_commands.cc source file. [Online]. Available: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/speech_commands/recognize_commands.cc 10 [18] (2018) Speech commands dataset streaming test version 2. [Online]. Available: http://download.tensorflow.org/data/speech_commands_streaming_test_v0.02.tar.gz [19] T. N. Sainath and C. Parada, "Convolutional Neural Networks for Small-Footprint Keyword Spotting," in Sixteenth Annual Conference of the International Speech Communication Association, 2015. [Online]. Available: https://www.isca-speech.org/archive/interspeech_2015/papers/i15_1478.pdf [20] (2018) Speech commands tutorial checkpoints. [Online]. Available: https://storage.googleapis.com/download.tensorflow.org/models/speech_commands_checkpoints.tar.gz [21] L. Lai, N. Suda, and V. Chandra, "CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUs," ArXiv e-prints, Jan. 2018. [22] B. McMahan and D. Rao, "Listening to the World Improves Speech Command Recognition," ArXiv e-prints, Oct. 2017. [23] J. Salamon, C. Jacoby, and J. P. Bello, "A dataset and taxonomy for urban sound research," in Proceedings of the 22Nd ACM International Conference on Multimedia, ser. MM '14. New York, NY, USA: ACM, 2014, pp. 1041–1044. [Online]. Available: http://doi.acm.org/10.1145/2647868.2655045 [24] M. Alzantot, B. Balaji, and M. Srivastava, "Did you hear that? Adversarial Examples Against Auto- matic Speech Recognition," ArXiv e-prints, Jan. 2018. [25] R. Tang and J. Lin, "Deep Residual Learning for Small-Footprint Keyword Spotting," ArXiv e-prints, Oct. 2017. [26] J. Lee, T. Kim, J. Park, and J. Nam, "Raw Waveform-based Audio Classification Using Sample-level CNN Architectures," ArXiv e-prints, Dec. 2017. [27] S. Krishna Gouda, S. Kanetkar, D. Harrison, and M. K. Warmuth, "Speech Recognition: Keyword Spotting Through Image Recognition," ArXiv e-prints, Mar. 2018. 11
1811.04670
1
1811
2018-11-12T11:40:09
A Deep Ensemble Framework for Fake News Detection and Classification
[ "cs.CL" ]
Fake news, rumor, incorrect information, and misinformation detection are nowadays crucial issues as these might have serious consequences for our social fabrics. The rate of such information is increasing rapidly due to the availability of enormous web information sources including social media feeds, news blogs, online newspapers etc. In this paper, we develop various deep learning models for detecting fake news and classifying them into the pre-defined fine-grained categories. At first, we develop models based on Convolutional Neural Network (CNN) and Bi-directional Long Short Term Memory (Bi-LSTM) networks. The representations obtained from these two models are fed into a Multi-layer Perceptron Model (MLP) for the final classification. Our experiments on a benchmark dataset show promising results with an overall accuracy of 44.87\%, which outperforms the current state of the art.
cs.CL
cs
A Deep Ensemble Framework for Fake News Detection and Classification *Fake News Detection using Deep Learning Arjun Roy, Kingshuk Basak, Asif Ekbal, Pushpak Bhattacharyya Department of Computer Science and Engineering Indian Institute of Technology Patna, India (arjun.mtmc17, kingshuk.mtcs16, asif, pb) @iitp.ac.in 8 1 0 2 v o N 2 1 ] L C . s c [ 1 v 0 7 6 4 0 . 1 1 8 1 : v i X r a Abstract -- Fake news, rumor, incorrect information, and mis- information detection are nowadays crucial issues as these might have serious consequences for our social fabrics. The rate of such information is increasing rapidly due to the availability of enormous web information sources including social media feeds, news blogs, online newspapers etc. In this paper, we develop various deep learning models for detecting fake news and classifying them into the pre-defined fine-grained categories. At first, we develop models based on Convolutional Neural Network (CNN) and Bi-directional Long Short Term Memory (Bi-LSTM) networks. The representations obtained from these two models are fed into a Multi-layer Perceptron Model (MLP) for the final classification. Our experiments on a benchmark dataset show promising results with an overall accuracy of 44.87%, which outperforms the current state of the art. Index Terms -- Fake news, Ensemble, Deep learning I. INTRODUCTION "We live in a time of fake news- things that are made up incorrect and manufactured."-by Neil Portnow. Fake news, rumors, information, misinformation have grown tremendously due to the phenomenal growth in web information. During the last few years, there has been a year-on-year growth in information emerging from various social media networks, blogs, twitter, facebook etc. Detecting fake news, rumor in proper time is very important as otherwise, it might cause damage to social fabrics. This has gained a lot of interest worldwide due to its impact on recent politics and its negative effects. In fact, Fake News has been named as 2017's word of the year by Collins dictionary1. Many recent studies have claimed that US election 2016 was heavily impacted by the spread of Fake News. False news stories have become a part of everyday life, exacerbating weather crises, political violence, intolerance between people of different ethnics and culture, and even affecting matters of public health. All the governments around the world are trying to track and address these problems. On 1st Jan, 2018, bbc.com published that "Germany is set to start enforcing a law that demands social media sites move quickly to remove hate speech, fake news, and illegal material." Thus it is very 1 http://www.thehindu.com/books/fake-news-named-word-of-the-year- 2017/article19969519.ece that evident detection of Fake News is very important and urgent. the development of automated techniques for A. Problem Definition and Motivation Fake News can be defined as completely misleading or made up information that is being intentionally circulated claiming as true information. In this paper, we develop a deep learning based system for detecting fake news. Deception detection is a well-studied problem in Natural Language Processing (NLP) and researchers have addressed this problem quite extensively. The problem of detecting fake news in our everyday life, although very much related to deception detection, but in practice is much more challenging and hard, as the news body often contains a very few and short statements. Even for a human reader, it is difficult to accurately distinguish true from false information by just look- ing at these short pieces of information. Developing suitable hand engineered features (for a classical supervised machine learning model) to identify fakeness of such statements is also a technically challenging task. In contrast to classical feature-based model, deep learning has the advantage in the sense that it does not require any handcrafting of rules and/or features, rather it identifies the best feature set on its own for a specific problem. For a given news statement, our proposed technique classifies the short statement into the following fine- grained classes: true, mostly-true, half-true, barely-true, false and pants-fire. Example of an instance of each class is given in Table I. B. Contributions Most of the existing studies on fake news detection are based on classical supervised model. In recent times there has been an interest towards developing deep learning based fake news detection system, but these are mostly concerned with binary classification. In this paper, we attempt to develop an ensemble based architecture for fake news detection. The individual models are based on Convolutional Neural Network (CNN) and Bi-directional Long Short Term Memory (LSTM). The representations obtained from these two models are fed Label Statement Statement Type Speaker Speaker's Job State Party Pants-fire False Barely True Half True Mostly True Context TRUE McCain opposed a requirement that the government buy American-made motorcycles. And he said all buy-American provisions were quote 'disgraceful.' mostly-true Almost 100,000 people left Puerto Rico last year. half-true Rick Perry has never lost an election and remains the only person to have won the Texas governorship three times in landslide elections. barely-true Says Mitt Romney wants to get rid of Planned Parenthood. I dont know who (Jonathan Gruber) is. FALSE pants-fire abortion, federal-budget, health-care planned-parenthood -action-fund health-care nancy-pelosi Transgender individuals in the U.S. have a 1-in-12 chance of being murdered. corrections-and-updates, crime,criminal-justice, sexuality garnet-coleman Advocacy group Washington, D.C. none House Minority Leader president, ceo of Apartments for America, Inc. TABLE I California democrat Texas democrat EXAMPLE OF INSTANCES OF EACH CLASS. federal-budget barack-obama President Illinois democrat 70 71 160 163 bankruptcy, economy, population jack-lew Treasury secretary Washington, D.C. democrat candidates-biography ted-nugent musician Texas republican 9 0 2 0 3 1 a radio ad an interview with Bloomberg News an oped column. a radio ad a news conference a committee hearing 0 0 1 3 1 1 0 0 7 0 0 2 0 11 1 1 0 0 2 0 into a Multi-layer Perceptron (MLP) for multi-class classifi- cation. C. Related Work The concept of fake news is often linked with rumor, deception, hoax, spam etc. Some of the related work can be found in [7] for rumour, [11] for deception detection, [16] for hoax, and [17] for spam. Problems related to these topics have mostly been viewed with respect to binary classification. Likewise, most of the published works also has viewed fake news detection as a binary classification problem (i.e fake or true). Bajaj [2] in his work applied various deep learning strategies on dataset composed of fake news articles available in Kaggle2 and authentic news articles extracted from Signal Media News3 dataset and observed that classifiers based on Gated Recurrent Unit (GRU), Long Short Term Memory (LSTM), Bi-directional Long Short Term Memory (Bi-LSTM) performed better than the classifiers based on CNN. Natali Ruchansky et al. [1] used social media dataset (which is also used in [6] for Rumor Detection) and developed a hybrid deep learning model which showed the accuracies of 0.892 on Twitter data and 0.953 on Weibo data. They showed that both, capturing the temporal behavior of the articles as well as learning source characteristics about the behavior of the users, are important for fake news detection. Further integrating these two elements improves the performance of the classifier. By observing very closely it can be seen that fake news articles can be classified into multiple classes depending on the fakeness of the news. For instance, there can be certain exaggerated or misleading information attached to a true statement or news. Thus, the entire news or statement can neither be accepted as completely true nor can be discarded as entirely false. This problem was addressed by William Y Yang in his paper [8] where he introduced Liar dataset comprising 2https://www.kaggle.com/mrisdal/fake-news 3http://research.signalmedia.co/newsir16/signal-dataset.html of a substantial volume of short political statements having six different class annotations determining the amount of fake content of each statement. In his work, he showed comparative studies of several statistical and deep learning based models for the classification task and found that the CNN model performed best with an accuracy of 0.27. Y. Long et al. [9] in their work used the Liar [9] dataset, and proposed a hybrid attention-based LSTM model for this task, which outperformed W.Yang's hybrid CNN model by 14.5% in accuracy, establishing a new state of the art. In our current work we propose an ensemble architecture based on CNN [14] and Bi-LSTM [12], and this has been evaluated on Liar [8] dataset. Our proposed model tries to capture the pattern of information from the short statements and learn the characteristic behavior of the source speaker from the different attributes provided in the dataset, and finally integrate all the knowledge learned to produce fine-grained multi-class classification. II. METHODOLOGY We propose a deep multi-label classifier for classifying a statement into six fine-grained classes of fake news. Our approach is based on an ensemble model that makes use of Convolutional Neural Network (CNN) [14] and Bi-directional Long Short Term Memory (Bi-LSTM) [12]. The information presented in a statement is essentially sequential in nature. In order to capture such sequential information we use Bi- LSTM architecture. Bi-LSTM is known to capture information in both the directions: forward and backward. Identifying good features manually to separate true from fake even for binary classification, is itself, a technically complex task as human expert even finds it difficult to differentiate true from the fake news. Convolutional Neural Network (CNN) is known to capture the hidden features efficiently. We hypothesize that CNN will be able to detect hidden features of the given statement and the information related to the statements to eventually judge the authenticity of each statement. We make an intuition that both- capturing temporal sequence and identi- fying hidden features, will be necessary to solve the problem. As described in data section, each short statement is associated with 11 attributes that depict different informations regarding the speaker and the statement. After our thorough study we identify the following relations among the various attributes which contribute towards labeling of the given statements. 1) Relation between Statement and Statement type 2) Relation between Statement and Context 3) Relation between Speaker and Party. 4) Relation between Party and Speaker's job. 5) Relation between Statement type and Context. 6) Relation between Statement and State. 7) Relation between Statement and Party. 8) Relation between State and Party. 9) Relation between Context and Party. 10) Relation between Context and Speaker. To ensure that deep networks understand these relations we propose to feed each of these relations into separate network layers and eventually after extracting all the relations we group them together along with the five-column attributes containing information regarding speaker's total credit history count. In addition to that, we also feed in a special feature vector that is proposed by us and is to be formed using the count history information. This vector is a five digit number signifying the five count history columns, with only one of the digit being set to '1' (depending on which column has the highest count) and the rest of the four digits are set to '0'. A. Bi-LSTM Bidirectional LSTMs are the networks with LSTM units that process word sequences in both the directions (i.e. from left to right as well as from right to left). In our model we consider the maximum input length of each statement to be 50 (average length of statements is 17 and the maximum length is 66, and only 15 instances of the training data of length greater than 50) with post padding by zeros. For attributes like statement type, speaker's job, context we consider the maximum length of the input sequence to be 5, 20, 25, respectively. Each input sequence is embedded into 300-dimensional vectors using pre-trained Google News vectors [13] (Google News Vectors 300dim is also used in [8] for embedding). Each of the embedded inputs are then fed into separate Bi-LSTM networks, each having 50 neural units at each direction. The output of each of these Bi-LSTM network is then passed into a dense network of 128 neurons with activation function as 'ReLU'. B. CNN Over the last few years many experimenters has shown that the convolution and pooling functions of CNN can be successfully used to find out hidden features of not only images but also texts. A convolution layer of n × m kernel Fig. 1. Ensemble based architecture size will be used (where m-size of word embedding) to look at n-grams of words at a time and then a MaxPooling layer will select the largest from the convoluted inputs, as shown in Figure ??. The attributes, namely speaker, party, state are embedded using pre-trained 300-dimensional Google News Vectors [13] and then the embedded inputs are fed into separate Conv layers.The different credit history counts the fake statements of a speaker and a feature proposed by us formed using the credit history counts are directly passed into separate Conv layers. C. Combined CNN and Bi-LSTM Model The representations obtained from CNN and Bi-LSTM are combined together to obtain better performance. The individual dense networks following the Bi-LSTM net- works carrying information about the statement, the speaker's job, context are reshaped and then passed into different Conv layers. Each convolution layer is followed by a Maxpooling layer, which is then flattened and passed into separate dense layers. Each of the dense layers of different networks carrying different attribute information are merged, two at a time-to capture the relations among the various attributes as mentioned at the beginning of II. Finally, all the individual networks are merged together and are passed through a dense layer of six neurons with softmax as activation function as depicted in. The classifier is optimized using Adadelta as optimization technique with categorical cross-entropy as the loss function. III. DATA We use the dataset, named LIAR (Wang 2017), for our experiments. The dataset is annotated with six fine-grained classes and comprises of about 12.8K annotated short state- ments along with various information about the speaker. The statements which were mostly reported during the time interval [2007 to 2016], are considered for labeling by the editors of Politifact.com. Each row of the data contains a short statement, a label of the statement and 11 other columns correspond to various information about the speaker of the statement. Descriptions of these attributes are given below: 6) State information: This specifies in which state the 7) Party affiliation: This denotes the name of the party of speaker in the party. statement was delivered. the speaker belongs to. 1) Label: Each row of data is classified into six different types, namely a) Pants-fire: Means the speaker has delivered a blatant lie . information. b) False: Means the speaker has given totally false c) Barely-true: Chances of the statement depending on the context is hardly true. Most of the contents in the statements are false. d) Half-true: Chances of the content in the statement is approximately half. e) Mostly-true: Most of the contents in the statement are true. f) True: Content is true. 2) Statement by the politician: This statement is a short 3) Subjects: This corresponds to the content of the text. For examples, foreign policy, education, elections etc. 4) Speaker: This contains the name of the speaker of the statement. statement. 5) Speaker's job title: This specifies the position of the 8) The next five columns are the counts of the speaker's statement history. They are: a) Pants fire count; b) False count; c) Barely true count; d) Half false count; e) Mostly true count. 9) Context: This corresponds to the venue or location of the speech or statement. The dataset consists of three sets, namely a training set of 10,269 statements, a validation set of 1,284 statements and a test set of 1,266 statements. IV. EXPERIMENTS AND RESULTS In this section, we report on the experimental setup, evalu- ation results, and the necessary analysis. A. Experimental Setup All the experiments are conducted in a python environment. The libraries of python are required for carrying out the experiments are Keras, NLTK, Numpy, Pandas, Sklearn. We evaluate the performance of the system in terms of accuracy, precision, recall, and F-score metrics. B. Results and Analysis We report the evaluation results in Table II that also show the comparison with the system as proposed in [8] and [9]. We depict the overall evaluation results in Table II along with the other existing models. This shows that our model performs Model William Yang Wang [8] Y. Long et al. [9] Bi-LSTM Model CNN Model Our Proposed Model Network Hybrid CNN Hybrid LSTM Bi-LSTM CNN Attributes taken Accuracy All All All All All 0.274 0.415 0.4265 0.4289 0.4487 RNN-CNN combined TABLE II OVERALL EVALUATION RESULTS PANTS-FIRE FALSE BARELY-TRUE HALF-TRUE MOSTLY-TRUE TRUE Avg/Total precision 0.73 0.47 0.58 0.39 0.33 0.88 0.53 recall 0.35 0.53 0.32 0.46 0.66 0.14 0.43 F1-score 0.47 0.50 0.41 0.42 0.44 0.23 0.41 No. of instances 92 249 212 265 241 207 1266 TABLE III EVALUATION OF BI-LSTM MODEL: PRECISION, RECALL, AND F1 SCORE better than the existing state-of-the-art model as proposed in [9]. This state-of-the-art model was a hybrid LSTM, with an accuracy of 0.415. On the other hand, our proposed model shows 0.4265, 0.4289 and 0.4487 accuracies for Bi-LSTM, CNN and the combined CNN+Bi-LSTM model, respectively. This clearly supports our assumption that capturing temporal patterns using Bi-LSTM and hidden features using CNN are useful, channelizing each profile attribute through a different neural layer is important, and the meaningful combination of these separate attribute layers to capture relations between attributes, is effective. We also report the precision, recall and F-score measures for all the models. TableIII, Table IV and Table VI depict the evaluation results of CNN, Bi-LSTM and the combined model of CNN and Bi-LSTM, respectively. The evaluation shows that on the precision measure the combined model performs best with an average precision of 0.55 while that of Bi-LSTM model is 0.53 and CNN model is 0.48. The combined model of CNN and Bi-LSTM even performs better with respect to recall and F1-Score measures. The combined model yields the average recall of 0.45 and average F1-score of 0.43 while that of Bi-LSTM model is 0.43 and 0.41, respectively and of the CNN model is 0.43 and 0.42, respectively. On further analysis, we observe that although the performance (based on precision, recall, PANTS-FIRE FALSE BARELY-TRUE HALF-TRUE MOSTLY-TRUE TRUE Avg/Total precision 0.67 0.36 0.50 0.42 0.41 0.70 0.48 recall 0.39 0.63 0.36 0.46 0.49 0.16 0.43 F1-score 0.49 0.46 0.42 0.44 0.45 0.26 0.42 No. of instances 92 249 212 265 241 207 1266 EVALUATION OF CNN MODEL: PRECISION, RECALL, F1 SCORE TABLE IV Label Statement barely-true We know there are more Democrats in Georgia than Republicans. We know that for a fact. Statement Type Speaker Speaker's Job State Party Context Pants-fire False Barely True Half True Mostly True Predicted Label elections mike-berlon none Georgia democrat an article 1 0 0 0 0 False SAMPLE TEXT WITH WRONGLY PREDICTED LABEL AND ORIGINAL LABEL. TABLE V and F1-score) of each of the models for every individual class is close to the average performance, but in case of the prediction of the class label TRUE the performance of each model varies a lot from the respective average value. The precisions of TRUE is promising (Bi-LSTM model:0.88, CNN model: 0.7, Combined model:0.85), but the recall (Bi- LSTM model:0.14, CNN model: 0.16, Combined model:0.14) and the F1-score (Bi-LSTM model:0.23, CNN model: 0.26, Combined model:0.24) are very poor. This entails the fact that our proposed model predicts comparatively less number of instances as TRUE, but when it does the prediction is very accurate. Thus it can be claimed that if a statement is predicted as True by our proposed model then one can rely on that with high confidence. Although our model performs superior compared to the existing state-of-the-art, still the results were not error free. We closely analyze the models' outputs to understand their behavior and perform both quantitative as well as qualitative error analysis. For quantitative analysis, we create the confusion matrix for each of our models. Confusion matrix corresponding to the experiment 1 i.e with Bi-LSTM model is given in TableVII, corresponding to experiment 2 i.e with CNN model is given in TableVIII and corresponding to our final experiment i.e with RNN-CNN combined model is given in Table IX. From these quantitative analysis it is seen that in majority of the cases the test data statements originally labeled with Pants-Fire class gets confused with the False class, statements originally labeled as False gets confused with Barely true and half true classes, statements originally labeled as Half true gets confused with Mostly True and False class, statements originally labeled as Mostly true gets confused with Half True, statements originally labeled with True gets confused with Mostly True class. It is quite clear that errors were mostly concerned with the classes, overlapping in nature. Confusion is caused as the contents of the statements belonging to these classes are quite similar. For example, the difference between 'Pants-Fire' and 'False' class is that only the former class corresponds to the false information with more intensity. Likewise 'Half True' has high similarity to 'False', and 'True' with 'Mostly True'. The difference between 'True' and 'Mostly True' is that the later class has some marginal amount of false information, while the former does not. For qualitative analysis, we closely look at the actual state- PANTS-FIRE FALSE BARELY-TRUE HALF-TRUE MOSTLY-TRUE TRUE Avg/Total precision 0.70 0.45 0.61 0.35 0.50 0.85 0.55 recall 0.43 0.61 0.32 0.73 0.36 0.14 0.45 F1-score 0.54 0.52 0.42 0.47 0.42 0.24 0.43 No. of instances 92 249 212 265 241 207 1266 EVALUATION OF BI-LSTM, CNN COMBINED MODEL: PRECISION, TABLE VI RECALL, F1 SCORE ments and try to understand the causes of misclassifications. We come up with some interesting facts. There are some speakers whose statements are not present in the training set, but are present in the test set. For few of these statements, our model tends to produce wrong answers. Let us consider the example given in TableV. For this speaker, there is no training data available and also the count history of the speaker is very less. So our models assign an incorrect class. But it is to be noted that even if there is no information about the speaker in the training data and the count history of the speaker is almost empty, still we are able to generate a prediction of a class that is close to the original class in terms of meaning. It is also true that classifiers often make mistakes in making the fine distinction between the classes due to the insufficient number of training instances. Thus, classifiers tend to mis- classify the instances into one of the nearby (and overlapped) classes. Actual\Predicted Pants-Fire False Barely-True Half-True Mostly-True True Pants-Fire 32 4 5 0 1 2 False 35 131 31 38 20 25 Barely-True Half-True Mostly-True True 8 36 48 123 54 47 14 59 60 95 158 90 0 3 0 1 0 28 CONFUSION MATRIX OF THE BI-LSTM MODEL TABLE VII 3 16 68 8 8 15 6 21 76 14 17 18 Actual\Predicted Pants-Fire False Barely-True Half-True Mostly-True True Pants-Fire 36 7 5 2 1 3 False 35 156 66 75 53 44 Barely-True Half-True Mostly-True True 11 30 34 123 51 44 2 28 29 48 119 65 2 7 2 3 0 33 TABLE VIII CONFUSION MATRIX OF THE CNN MODEL V. CONCLUSION AND FUTURE WORKS In this paper, we have tried to address the problem of fake News detection by looking into short political statements made Actual\Predicted Pants-Fire False Barely-True Half-True Mostly-True True Pants-Fire 40 7 4 0 2 4 False 34 152 48 43 31 31 4 10 68 7 9 13 TABLE IX CONFUSION MATRIX OF THE BI-LSTM+CNN COMBINED MODEL Barely-True Half-True Mostly-True True 10 67 83 193 112 89 4 11 9 20 86 41 0 2 0 2 1 29 by the speakers in different types of daily access media. The task was to classify any statement into one of the fine-grained classes of fakeness. We have built several deep learning models, based on CNN, Bi-LSTM and the combined CNN and Bi-LSTM model. Our proposed approaches mainly differ from previously mentioned models in system architecture, and each model performs better than the state of the art as proposed in [9], where the statements were passed through one LSTM and all the other details about speaker's profile through another LSTM. On the other hand, we have passed every different attribute of speaker's profile through a different layer, captured the relations between the different pairs of attributes by concatenating them. Thus, producing a meaningful vector representation of relations between speaker's attributes, with the help of which we obtain the overall accuracy of 44.87%. By further exploring the confusion matrices we found out that classes which are closely related in terms of meaning are getting overlapped during prediction. We have made a thorough analysis of the actual statements, and derive some interesting facts. There are some speakers whose statements are not present in the training set but present in the test set. For some of those statements, our model tends to produce the wrong answers. This shows the importance of speakers' profile information for the task. Also as the classes and the meaning of the classes are very near, they tend to overlap due to less number of examples in training data. We would like like to highlight some of the possible solutions to solve the problems that we encountered while attempted to solve fake news detection problem in a more fine-grained way. • More labeled data sets are needed to train the model more accurately. Some semi-supervised or active learning models might be useful for this task. • Along with the information of a speaker's count history of lies, the actual statements are also needed in order to get a better understanding of the patterns of the speaker's behavior while making a statement. Fake news detection into finely grained classes that too from short statements is a challenging but interesting and practical problem. Hypothetically the problem can be related to Sarcasm detection [15] problem. Thus it will also be interesting to see the effect of implementing the existing methods that are effective in sarcasm detection domain in Fake News detection domain. REFERENCES [1] Natali Ruchansky, Sungyong Seo, Yan Liu. CSI: A Hybrid Deep Model for Fake News Detection. Sep 2017.In Proceedings of the 26th ACM International Conference on Information and Knowledge Management (CIKM) 2017. a New Bajaj. News Baby!" [2] Samir Fake Learning. https://web.stanford.edu/class/cs224n/reports/2710385.pdf. CS 224N - Winter 2017. "The Detection Has Using Deep Pope [3] Vikram Singh, Sunny Narayan, Md Shad Akhtar, Asif Ekbal, Pushpak Bhattacharyya. IITP at SemEval-2017 Task 8 : A Supervised Approach for Rumour Evaluation. Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017). Pages 497-501. [4] Fan Yang, Arjun Mukherjee, Eduard Dragut. Satirical News Detec- tion and Analysis using Attention Mechanism and Linguistic Features. EMNLP 2017, 11 pages. arXiv:1709.01189 . [5] Veronica Prez-Rosas, Bennett Kleinberg, Alexandra Lefevre, Rada Mi- halcea. Automatic Detection of Fake News. 2017. [6] Jing Ma, Wei Gao, Prasenjit Mitra, Sejeong Kwon, Bernard J Jansen, Kam-Fai Wong, and Meeyoung Cha. 2016. Detecting rumors from microblogs with recurrent neural networks. In Proceedings of IJCAI . [7] Chen, T. Li. X.Wu L., Wang Y. Yin, H., & Zhang, J. (2017). Call Attention to Rumors: Deep Attention Based Recurrent Neural Networks for Early Rumor Detection. CoRR, abs/1704.05973. [8] William Yang Wang. "Liar, Liar Pants on Fire": A New Benchmark Dataset for Fake News Detection. ACL 2017. arXiv:1705.00648 [9] Yunfei Long, Qin Lu, Rong Xiang, Minglei Li and Chu-Ren Huang. Fake News Detection Through Multi-Perspective Speaker Profiles. Pro- ceedings of the Eighth International Joint Conference on Natural Lan- guage Processing (Volume 2: Short Papers) IJCNLP (2017), pages- 252256 2017. [10] Quan Zhou, Qi Stance ral News http://web.stanford.edu/class/cs224n/reports/2761936.pdf, 2017. Detectors Zeng, for Shanshan Fake Xu. Neu- Challenge. Cs224n [11] Duppada, Venkatesh. "Attention" for Detecting Unreliable News in the Information Age. (2017). [12] Sepp Hochreiter and Jrgen Schmidhuber. Long short-term memory. Neural computation, 9(8):17351780, 1997. [13] Mikolov, Tomas; Sutskever, Ilya; Chen, Kai; Corrado, Greg S.; Dean, Jeff. Distributed representations of words and phrases and their compo- sitionality. Advances in Neural Information Processing Systems(2013). arXiv:1310.4546Freely accessible. [14] Yoon Kim Convolutional Neural Networks for Sentence Classification. Computation and Language (cs.CL); Neural and Evolutionary Comput- ing (cs.NE) (2014). EMNLP. [15] Aditya Joshi, Pushpak Bhattacharyya, Mark J. Carman Automatic Sar- casm Detection: A Survey. ACM Computing Surveys (CSUR). Article No. 73. Volume 50 Issue 5, November 2017. [16] Eugenio Tacchini, Gabriele Ballarin, Marco L. Della Vedova, Stefano Moret, Luca de Alfaro. Some Like it Hoax: Automated Fake News Detection in Social Networks. Proceedings of the Second Workshop on Data Science for Social Good (SoGood), Skopje, Macedonia, 2017. CEUR Workshop Proceedings Volume 1960, 2017 [17] Nasim Eshraqi, Mehrdad Jalali, Mohammad Hossein Moattar. Spam Detection In Social Networks: A Review. Second International Congress on Technology, Communication and Knowledge (ICTCK 2015) Novem- ber, 11-12, 2015 - Mashhad Branch, Islamic Azad University, Mashhad, Iran [18] Radu Florian, Abe Ittycheriah, Hongyan Jing, and Tong Zhang. Named Entity Recognition through Classifier Combination. In Proceedings of CoNLL-2003. [19] D. Ghosal, S. Bhatnagar, M.S. Akhtar, A. Ekbal, P. Bhattacharyya. IITP at SemEval-2017 task 5: an ensemble of deep learning and feature based models for financial sentiment analysis. Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pp. 899-903, 2017.
1309.6722
1
1309
2013-09-26T05:18:12
Domain-Specific Sentiment Word Extraction by Seed Expansion and Pattern Generation
[ "cs.CL" ]
This paper focuses on the automatic extraction of domain-specific sentiment word (DSSW), which is a fundamental subtask of sentiment analysis. Most previous work utilizes manual patterns for this task. However, the performance of those methods highly relies on the labelled patterns or selected seeds. In order to overcome the above problem, this paper presents an automatic framework to detect large-scale domain-specific patterns for DSSW extraction. To this end, sentiment seeds are extracted from massive dataset of user comments. Subsequently, these sentiment seeds are expanded by synonyms using a bootstrapping mechanism. Simultaneously, a synonymy graph is built and the graph propagation algorithm is applied on the built synonymy graph. Afterwards, syntactic and sequential relations between target words and high-ranked sentiment words are extracted automatically to construct large-scale patterns, which are further used to extracte DSSWs. The experimental results in three domains reveal the effectiveness of our method.
cs.CL
cs
Domain-Specific Sentiment Word Extraction by Seed Expansion and Pattern Generation {dytang, qinb, zyy, tliu}@ir.hit.edu.cn, {ljzhou, kfwong}@se.cuhk.edu.hk TAN G DuY u1 QI N Bing 1 Z HOU LanJ un2 W ON G KamFai2 Z HAO YanYan1 L I U T ing 1 ] L (1) Research Center for Social Computing and Information Retrieval, Harbin Institute of Technology C (2) Dept. of Systems Engineering & Engineering Management, The Chinese University of Hong Kong . s c [ ABSTRACT 1 This paper focuses on the automatic extraction of domain-specific sentiment word (DSSW), v which is a fundamental subtask of sentiment analysis. Most previous work utilizes manual 2 patterns for this task. However, the performance of those methods highly relies on the labelled 2 patterns or selected seeds. In order to overcome the above problem, this paper presents an 7 6 automatic framework to detect large-scale domain-specific patterns for DSSW extraction. To . this end, sentiment seeds are extracted from massive dataset of user comments. Subsequently, 9 these sentiment seeds are expanded by synonyms using a bootstrapping mechanism. Simulta- 0 3 neously, a synonymy graph is built and the graph propagation algorithm is applied on the built 1 synonymy graph. Afterwards, syntactic and sequential relations between target words and : v high-ranked sentiment words are extracted automatically to construct large-scale patterns, i which are further used to extracte DSSWs. The experimental results in three domains reveal X the effectiveness of our method. r a KEYWORDS: sentiment lexicon, patten generation, unsupervised framework, graph propaga- tion 1 Introduction In recent years, sentiment analysis (or opinion mining) has attracted a lot of attention in natu- ral language processing and information retrieval (Pang and Lee, 2008). An important subtask in sentiment analysis is building sentiment lexicons, which is fundamental for many sentiment analysis tasks, such as document-level (Turney, 2002) and sentence-level (Zhou et al., 2011) sentiment classification, collocation polarity disambiguation (Zhao et al., 2012) and opinion retrieval (Li et al., 2010). Sentiment words, such as good, bad, excellent and awful, can in- dicate the sentiment polarity of text directly. However, sentiment words are domain-specific, because opinion expressions vary greatly in different domains (Liu, 2012). A positive word in one domain may be neutral or negative in another domain. For example, "low" in "low cost" is positive but negative in "low salary". Therefore, it's necessary to extract domain-specific sentiment word (DSSWs) in different domains based on domain-specific text. Recently, some methods are proposed for sentiment word extraction, including thesaurus- based (Baccianella et al., 2010) and corpus-based (Qiu et al., 2011) method. The performance of their algorithms more or less depends on the quality of labelled resources, selected seeds or manual patterns. Moreover, annotating each domain of interest is costly and time consuming. Thus, it's appealing to extract DSSWs utilizing the corpora without expensive labelling. This paper presents an automatic framework for DSSW extraction. The advantage of our framework is to leverage domain-independent knowledge to detect large-scale syntactic and sequential patterns, which can be used to extract DSSWs. In the first step, high-quality senti- ment seeds are selected from massive dataset of user comments. Then, sentiment seeds are expanded by synonyms in a bootstrapping schema, and a synonymy graph is built simulta- neously. After that, graph propagation algorithm is applied on the synonymy graph to select general sentiment words. Finally, the syntactic and sequential relations between general senti- ment words and target words are utilized to extract hundreds of patterns, which are used to extract DSSWs. Our approach differs from existing approaches in that it requires no labelled information except for the massive dataset of user comments. Thus, our proposed method can be viewed as an semi-supervised method. We test our method in three different domains, and our approach can extract accurate DSSWs from the target domain without annotated data. We also compare our method with two solid baseline methods, the experimental results demon- strate that our method outperforms them substantially. Specifically, the contributions of this paper are as follows: • This paper presents an automatic method to generate hundreds of domain-specific pat- terns for sentiment word extraction. • A simple and effective framework is proposed to extract DSSWs without any labelling. • This paper presents the first work on combining syntactic and sequential patterns for sentiment lexicon extraction. • The experimental results illustrate that our proposed method works effectively and out- performs two baselines largely. 2 Method Overview This section presents the brief idea behind our framework. Figure 1 shows two examples in digital domain after POS tagging and dependency parsing. In Figure 1(a), excellent[精致] is a sentiment seed due to its stable polarity in different domains. Our goal is to extract new sentiment word (generous[大方]) as DSSW by its structured similarity with general sentiment word (excellent) when they are used to modify target words (such as phone and camera). HED QUN ADV DE ATT Root 一个 非常 精致 的 相机 postag: m d a u n a very excellent of camera (a) example 1 HED QUN ADV DE ATT Root 一款 很 大方 的 手机 postag: m d a u n a very generous of phone (b) example 2 Figure 1: Example of dependency structure in digital domain. In our framework, the first step is to select sentiment seeds, such as excellent. The assumption is that sentiment seeds are used to modify diverse products with consistent polarity. Thus, we utilize massive dataset of user comments to extract high-confidence sentiment seeds. After- wards, in order to get more general sentiment words, a bootstrapping mechanism is used to expand the sentiment seeds. At the same time, a synonymy graph is built and propagation algorithm is then utilized to calculate the sentiment of each word in the synonymy graph. As a result, high ranked words are selected as general sentiment words. Then, general sentiment words are leveraged to extract DSSWs. In Figure 1(a) and 1(b), it's obvious that there are some shared structures between sentiment words (e.g. excellent, generous) and target words (e.g. phone, camera). Thus, general sentiment words and these common structures can be used to extract new sentiment words. This paper extracts large-scale patterns to describe these structures, namely syntactic and sequential patterns. The detail of the method is described in Section 3. 3 Methodology 3.1 Framework Architecture The architecture of out framework is illustrated in Figure 2. According to the framework, three components are carried out to extract DSSW: 1. Seed Extraction: Massive dataset of user comments is used to extract high-confidence sentiment seeds. Web user Comments Sentences Domain Corpus Pre-processing . . . Seed Extraction Synonymy Thesaurus Graph Construction Pattern Library Extract Pattern Candidate Extraction Candidates Sentiment Seeds DSSW Extraction Synonymy Graph Seed Expansion General Sentiment Words DSSWs Figure 2: The architecture of proposed framework 2. Seed Expansion: First, a synonymy graph is build based on synonyms. Then, graph propa- gation algorithm is used to get general sentiment words. 3. DSSW Extraction: Two kinds of patterns are generated automatically, which are further used to extract new sentiment words from corpus. It's worth noting that the three-step framework is flexible and we can try different strategies for each component. The following sections give the details algorithms for each component to show its effectiveness and scalability. 3.2 Seed Extraction Sentiment seeds are the foundations of the proposed framework, as shown in Figure 2. Most previous work (Turney et al., 2003; Qiu et al., 2009) manually list a small amount of words as seeds. In this paper, we select sentiment words automatically from ComtData1. ComtData includes massive dataset of user comments crawled from a famous Chinese shopping website. It contains 1.65 million user comments on 18K products from 310K users. Each comment includes rating score, overall comments, pros and cons, as illustrated in Table 1. Pros and cons are used in this paper. Rating Score Overall comments 4.0 The bag is just what I want! However, the logistics disappointed me. Pros Cons An excellent bag! Disappointing logistics. 1ComtData is available at http://www.datatang.com/data/15516 Table 1: Statistics for domain-specific corpora Firstly, word segmentation and POS tagging are preprocessed to the pros and cons. All adjec- tives and idioms are treated as candidates for sentiment seeds. Then, two simple schemes are designed to calculate positive and negative score for each seed candidate, namely seed positive score (SPS) and seed negative score (SNS). In Equation 1 and 2, cpw and cnw denote the frequency of seed candidate w in pros and cons. After that, all candidates are ranked by SPS and SNS respectively. S PS(w) = cpw/(cpw + cnw) SN S(w) = cnw /(cpw + cnw ) (1) (2) Finally, sentiment seeds are selected based on the following rules. • Word length constraints. Since most of the Chinese single words are ambiguous, we only retain words whose length is greater than 1. • Frequency constraints. Seed candidates with frequency smaller than 30 are removed empirically. • Sentiment score constraints. After generating the SPS and SNS rankings, the candidates with SPS larger than λp or SNS larger than λn are chosen as sentiment seeds, as listed in Table 2 Positive Seeds Negative Seeds Word_CH/Word_EN 古朴/quaint 毋庸置疑/no doubt 简捷/simple 素雅/elegant 敏捷/agile 香喷喷/fragrant 霸气/intrepid 俱佳/superb 精湛/exquisite 简练/concise 动听/sweet 工细/delicate 浪漫/romantic 优美/beautiful 一应俱全/complete cp/cn 32/0 63/1 51/1 84/2 82/2 40/1 39/1 38/1 75/2 37/1 37/1 144/4 35/1 266/9 50/2 Word_CH/Word_EN 臃肿/bloated 陈旧/obsolete 土气/tacky 欠佳/poor 脆弱/fragile SPS 1.000 0.984 凹凸不平/accidented 0.981 0.977 0.976 0.976 0.975 画蛇添足/superfluous 0.974 0.974 0.974 0.974 0.973 0.972 0.967 0.962 迟钝/obtuse 大意/careless 单薄/flimsy 累赘/burdensome 落后/fall behind 粗糙/rough 费心/exhausting 简陋/simple cp/cn 6/47 4/30 26/186 6/41 38/228 91/539 5/29 17/96 915/5060 6/33 52/285 5/27 531/2797 19/100 446/2322 SNS 0.887 0.882 0.877 0.872 0.857 0.856 0.853 0.850 0.847 0.846 0.846 0.844 0.840 0.840 0.839 Table 2: Top 15 sentiment seeds based on SPS and SNS rankings 3.3 Seed Expansion In order to get more domain-independent sentiment words, graph propagation is used to ex- pand sentiment seeds. Firstly, synonymy graph is built with a bootstrapping schema. Then, graph propagation algorithm is utilized on the synonymy graph to expand the sentiment seeds. After the graph propagation converged, top K words are selected as general sentiment words. 3.3.1 Graph Construction On the basis of sentiment seeds and Synonymy Thesaurus2, we use bootstrapping method to construct synonymy graph. Firstly, all candidates after seed extraction are saved as an origin set. Then, synonyms of the words in the original set will be extracted and added into the set. The bootstrapping process runs iteratively until no more new words can be extracted. In this way, a synonymy graph G =< V, E > is constructed with V nodes and E edges. Each node indicates a word, and there exists a edge between two nodes if they are synonymies. The adjacency matrix W indicates the relationship between nodes in G. Wi j is calculated by the cosine similarity between the synonyms vectors of vi and vj, as shown in Equation 3. svik is a boolean value to indicate whether the k-th word in the vocabulary is the synonym of word vi . Wi j = svi · svj ksvi k × ksvjk = Pn k=1 sv2 k=1 svik × svjk ik × Pn Pn k=1 sv2 jk (3) 3.3.2 Graph Propagation After graph construction, words in the synonymy graph are connected with their synonymies. In this subsection, we use Multi Topic-Sensitive PageRank algorithm for seed expansion. It's widely accepted that sentiment seeds are good indicators for sentiment expression. What's more, from our observation, words with some specific POS tags are more likely to possess sentiment information, such as adjective and idiom. Thus, we utilize Multi Topic-Sensitive PageRank algorithm on the synonymy graph to calculate the sentiment of each word, in which sentiment seeds and POS tagging information are two relevant topics. PageRank algorithm (Brin and Page, 1998) is first proposed to measure the authority of each web page for search result ranking. The idea behind PageRank is that, a page that is linked to by many pages with high rank receives a high rank itself. In this work, the synonymy graph is built based on the sentiment consistency assumption, namely a word that has many positive synonyms receives higher positive score. Thus, PageRank is intuitively reasonable for sentiment seed expansion. The original PageRank values are iteratively calculated based on Equation 4, where ei = 1/N . In Equation 4, αWxk−1 corresponds to the random walk operation, and (1 − α)e refers to the teleport operation (Manning et al., 2008), α is a damping factor to tradeoff between the two parts, x k p is the pagerank value of webpage p in the k-th iteration. In order to derive PageRank values tailored to particular interests, (Haveliwala, 2003) proposed Topic-Sensitive PageRank, whose main difference from original PageRank is the value of e. In original PageRank, each web page has equal probability to be visited in teleport operation. However, in Topic-Sensitive PageRank algorithm, the random surfer will teleport to a random web page on the topic instead. xk = αWxk−1 + (1 − α)e (4) With regard to the situation that a user has a mixture of interests, for example 60% sports and 40% politics, (Manning et al., 2008) points that individual's interests can be well- 2Synonymy Thesaurus is available at http://www.datatang.com/data/13282. Each token in Synonymy Thesaurus has a list of synonyms. approximated as a linear combination, as shown in Equation 5. xt = β xt1 + (1 − β )xt2 (5) In this work, sentiment seeds and certain POS tags are treated as two topics due to their close contact with sentiment. Multi Topic-Sensitive PageRank in Equation 5 is used to calculate the sentiment for each word. As for sentiment seeds, we use the parameter λp and λn in Section 3.2 to control the seed list. As for POS tags, we try different POS tags to observe its influence on Topic-Sensitive PageRank. Finally, β is tuned to tradeoff between these two topics. After graph propagation converges, top K words are selected as general sentiment words. 3.4 DSSW Extraction This subsection details the algorithm to extract DSSW based on general sentiment words and domain-specific corpora. Syntactic and sequential patterns are used to represent the relation- ship between sentiment words and target words. Syntactic pattern is the shortest path from sentiment word to target word in the dependency tree, which indicates the hierarchical infor- mation. Sequential pattern is the sequential POS tagging string between sentiment word and target word from left to right, which indicates the plain information. For example, excellent is sentiment word and camera is target word in Figure 1(a). The syn- tactic pattern of this example is (S) DE+ ATT+ (T), in which (S) stands for sentiment word, (T) stands for target word, DE and ATT are the dependency relations along the path on the dependency tree from (S) to (T), + means the latter word is the father of the former in the dependency structure. The sequential pattern of this example is (S) a u n (T), in which a u n is the POS tagging sequence from left to right. Based on the above observation, DSSW extraction algorithm is summarized in Algorithm 1. Algorithm 1 DSSW Extraction Input: General sentiment Domain corpus Output: Domain-specific sentiment words (DSSWs) 1: Preprocessing. Word segmentation, POS tagging and dependency parsing are proprocessed on the domain corpus. 2: Target words extraction. Nouns will be treated as target words if their frequency is larger than γd . 3: Pattern extraction. Syntactic patterns and sequential patterns between target words and general sentiment words are extracted automatically. Top τs y n and τseq are selected as pattern library based on frequency. 4: Candidate sentiment words extraction. Adjectives and idioms are treated as candidate sentiment words. 5: DSSW extraction. Candidate word w will be extracted as DSSW if its syntactic pattern or sequential pattern with target words matches the pattern library. After preprocessing (Line 1), target words are selected based on word frequency (Line 2). Then, pattern library is constructed based on the syntactic and sequential relations between target words and general sentiment words (Line 3). Subsequently, new candidate sentiment words are extracted by matching pattern library. Finally, satisfied words will be treated as DSSWs (Line 5). 4 Experiment In this section, three experiments are conducted to verify the effectiveness of our method. Firstly, we evaluate the general sentiment words as a result of seed extraction and seed expan- sion. Then, based on general sentiment words, DSSWs are extracted in three domain. Finally, the extracted DSSW are applied for sentiment classification application to check its usefulness. 4.1 Results on General Sentiment Words 4.1.1 Dataset and Evaluation Metrics General sentiment words are selected by seed extraction and seed expansion, as shown in Figure 2 . The synonymy graph includes 40,680 nodes and 656K edges. Two annotators are asked to label all these words into positive, negative and neutral. The overall inter annotator agreement is 81.05%. The distribution of annotated lexicon is shown in Table 3. We can observe that adjectives and idioms have larger possibility to contain subjective information. SENT adj 1,230 pos 785 neg neu 918 sum 2,933 POS tagging information noun verb 266 734 904 165 12,668 7,569 9,207 13,099 idiom 1,026 746 2,016 3,788 other 642 797 10,214 11,653 Table 3: Statistics for Chinese lexicon annotation. In this paper, P@N metric is used to evaluate the performance of graph propagation (Manning et al., 2008). P@N means the Precision from results within top N rankings. 4.1.2 Parameter Learning In this subsection, we conduct experiments to study the influence of different parameter set- tings in Multi Topic-Sensitive PageRank. Specifically, damping factor α is used to tradeoff between the teleport and random walk operation; λp and λn are used to control the size of positive and negative seeds; β is used to tradeoff between the answers from two topic-specific PageRank. It's worth noting that each parameter is learned by two runs of PageRank, for positive and negative rankings respectively. Figure 3 shows the results on varying the value of λp and λn. The first value origin on the horizontal axis means that all nodes are uniformly chosen in teleport operation, which corre- sponds to the origin PageRank. Then, λp and λn are increased by 0.05 to control the size of sentiment seeds in Topic-Sensitive PageRank. From Figure 3(a) and 3(b), we can observe that Topic-Sensitive PageRank algorithm performs better than the origin PageRank. The best positive and negative PageRank results achieve at λp=0.75 and λn=0.7 respectively. In Figure 3(b), the value at 0.90 and 0.95 are equal to original PageRank value because there are no negative seeds whose SNS value is larger than 0.90. Setting λp=0.75 and λN =0.7, the results on varying values of α from 0.05 to 0.95 by 0.05 are N @ P 1.000 0.900 0.800 0.700 0.600 0.500 0.400 0.300 0.200 0.100 0.000 N @ P 1.000 0.900 0.800 0.700 0.600 0.500 0.400 0.300 0.200 0.100 0.000 P@50 P@100 P@500 P@1000 P@50 P@100 P@500 P@1000 i n g i r o 0 2 . 0 5 2 . 0 0 3 . 0 5 3 . 0 0 4 . 0 5 4 . 0 0 5 . 0 5 5 . 0 0 6 . 0 5 6 . 0 0 7 . 0 5 7 . 0 0 8 . 0 5 8 . 0 0 9 . 0 5 9 . 0 i n g i r o 0 2 0 . 5 2 0 . 0 3 0 . 5 3 0 . 0 4 0 . 5 4 0 . 0 5 0 . 5 5 0 . 0 6 0 . 5 6 0 . 0 7 0 . 5 7 0 . 0 8 0 . 5 8 0 . 0 9 0 . 5 9 0 . Value of γp Value of γn (a) Positive PageRank (b) Negative PageRank Figure 3: Results on varying values of λpos and λne g shown in Figure 4. It's shown that the results change slightly when the value of α is small, where teleport operation plays an dominant role in PageRank. However, when α is larger than 0.9, performance drops obviously because the propagation has great probability to conduct random walk operation and the effect of sentiment seeds is weaken. 1.000 0.900 0.800 N @ P 0.700 0.600 0.500 0.400 0.300 1.000 0.900 0.800 N @ P 0.700 0.600 0.500 0.400 0.300 P@50 P@100 P@500 P@1000 P@50 P@100 P@500 P@1000 Value of α Value of α (a) Positive PageRank (b) Negative PageRank Figure 4: Results on varying values of α Table 4 shows the effect of adjective, verb and idioms in Topic-Sensitive PageRank. In negative pagerank result, idioms gets the best result. After checking the final ranking result, we find that idioms have more synonymies with other idioms and they have higher probability to act as sentiment word. In addition, the performance in positive PageRank is poor. Finally, β is set from 0.0 to 1.0 increased by 0.05 to tradeoff between the results of two Topic-Sensitive PageRank methods. Due to the poor performance of positive postag-sensitive PageRank, the best result is given at β =0.0 in Figure 5(a). In Figure 5(b), the best result is given around β =0.75, in which the postag-topic plays a dominant role. 4.2 Evaluation for DSSW Extraction 4.2.1 Experiment Setting We conduct DSSW extraction on the dataset from Chinese Opinion Analysis Evaluation (COAE 2011) (Zhao et al., 2008). The dataset contains text from three domains, namely digital, en- tertainment and finance. The detailed information of the corpora is shown in Table 5. Note (a) Positive PageRank postag i a v P@50 0.000 0.240 0.020 P@100 0.000 0.280 0.010 P@500 0.016 0.370 0.028 P@1000 0.018 0.385 0.044 (b) Negative PageRank postag i a v P@50 0.980 0.260 0.020 P@100 0.960 0.200 0.040 P@500 0.808 0.240 0.032 P@1000 0.649 0.231 0.048 Table 4: Results on varying combinations of POS tagging N @ P 1.000 0.900 0.800 0.700 0.600 0.500 0.400 0.300 0.200 N @ P 1.000 0.900 0.800 0.700 0.600 0.500 0.400 0.300 0.200 P@50 P@100 P@500 P@1000 P@50 P@100 P@500 P@1000 Value of β Value of β (a) Positive PageRank (b) Negative PageRank Figure 5: Results on varying values of β that the last column means the number of sentiment words (SW) in each domain given by COAE. These sentiment words are considered as gold set in the following experiments. The evaluation metrics are Precision, Recall and F1-score (Manning et al., 2008). domain finance entertainment digital # of docs # of sents/doc # of SW 14,542 14,904 14,799 8 7 24 1,844 3,034 2,998 Table 5: Statistics for domain-specific corpora 4.2.2 Experimental Results We re-implement two baselines, Hu04 (Hu and Liu, 2004) and Qiu11 (Qiu et al., 2011) 3. LTP (Che et al., 2010) is used for word segmentation, POS tagging and dependency parsing. In order to compared with the two baselines in the comparable setting, in Algorithm 1, γd is set to 100 (Line 2), τs y n and τseq are both set to 200 (Line 3). Comparison results on DSSW extraction are given in Table 6. From Table 6, we observe that our method outperforms two solid baselines in three domains. Our precision(P) improves significantly, especially in finance domain with 9.4% improvement. 3The detail of the methods used in baselines will be mentioned in Section 5. finance entertainment digital Hu04 0.5423 0.2956 0.3826 0.5626 0.2769 0.3711 0.5534 0.3043 0.3927 Qiu11 0.5404 0.3118 0.3955 0.5878 0.3022 0.3992 0.5649 0.3253 0.4129 Our 0.6347 0.3411 0.4437 0.6449 0.3256 0.4328 0.5923 0.3457 0.4366 P R F1 P R F1 P R F1 Table 6: Experimental results on DSSW extraction Our recall(R) improves slightly because there are still some sentiment words don't co-occur with target words. Problem with hidden target words will be studied in future work. To evaluate the contribution of pattern library and general sentiment words in DSSW extrac- tion, different settings are given. In Figure6(a), F-value improves obviously with the increasing size of pattern library within 200. With the expansion of pattern library, new added patterns are not general enough to match mass sentiment words as before. Thus, the trend became sta- ble after 200. In Figure6(b), general sentiment words can be treated as sentiment seeds when its size is tiny. With more general sentiment words added, statistical information of patterns can be learned better. Thus, the performance rises apparently, which indicates the effective- ness of seed expansion. Finally, the trend is stable when the size of general sentiment words is larger than 200. l e u a v - F 0.45 0.445 0.44 0.435 0.43 0.425 0.42 0.415 0.41 0.405 0.4 l e u a v - F 0.45 0.445 0.44 0.435 0.43 0.425 0.42 0.415 0.41 0.405 0.4 finance entertainment digital finance entertainment digital 5 5 1 5 2 0 5 0 0 1 0 5 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0 0 1 # of patterns 5 0 1 0 2 0 5 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 0 1 # of gsw (a) Results on varying number of patterns (b) Results on varying number of general sentiment words Figure 6: Parameter learning on domain lexicon extraction 4.3 Evaluation for Sentiment Classification In order to verify the usefulness of DSSWs extracted by the proposed framework, we apply the DSSWs for sentiment classification task. Motivated by (Pang et al., 2002), machine learning method is used to classify the polarity of text. The objective is to compare the effectiveness of our DSSWs with general sentiment lexicon (HownetSent) and the baseline DSSWs (Hu04, Qiu11) for sentiment classification. We use the dataset from Task2 in COAE2011, which also contains text from three domains. Each sentence in this dataset is labelled with positive or negative. We balance them manually. finance entertainment digital Hownet 0.5714 0.5078 0.6800 Hu04 0.5543 0.5596 0.6813 Qiu11 0.5657 0.5777 0.7007 Our 0.6029 0.5962 0.7242 Table 7: Results on sentiment classification As shown in Table 7, our approach outperforms general sentiment lexicon(HownetSent) and baseline DSSW (Hu04 and Qiu11) in all three domains, which indicates the effectiveness of the extracted DSSWs. 5 Related Work The objective of sentiment word extraction is to identify sentiment words from text. Recently, three main approaches have been investigated: thesaurus-based method, corpus-based method and manual method (Liu and Zhang, 2012). Because the manual method is time-consuming, it's mainly combined with automatic methods as the final check. As follows, we will discuss the thesaurus-based and corpus-based method in detail. 5.1 Thesaurus-based Method Thesaurus-based method mainly utilizes the semantic relation, such as synonyms, antonyms and hypernyms, between tokens in thesaurus (e.g. WordNet) to build general lexicon. Major- ity of the existing work treat sentiment word as a basic unit(Hu and Liu, 2004), yet some researchers focus on the synset in WordNet (Esuli and Sebastiani, 2006) and word sense (Wiebe and Mihalcea, 2006; Su and Markert, 2009). (Kim and Hovy, 2004) propose a simple and effective approach to build lexicon taking advan- tage of synonym and antonym relations in WordNet. Their hypothesis is that the synonyms of a positive word have positive polarity, and vice versa for antonym relation. In their method, some adjective and verb words are manually labelled as seeds. Then, a bootstrapping method is proposed to expand the seed list. (Kamps et al., 2004) utilized synonyms in WordNet to con- struct a network. The polarity of a word is decided by its shortest path to seed word good and bad. (Esuli and Sebastiani, 2005) use gloss information to identify the polarity of a word. Their basic assumption is that terms with similar polarity tend to have same glosses. They first col- lect some seeds manually. Then, a semi-supervised framework is used to classify orientations. Similarly, the work of (Takamura et al., 2005) exploit the gloss information to extract polarity of words with spin model. Inspired by (Zhu and Ghahramani, 2002), (Rao and Ravichandran, 2009) use label propagation algorithm to detect the polarity of words in the graph. Besides the above-mentioned work, some researchers try to identify the polarity of Word- Net synset. (Esuli and Sebastiani, 2006; Baccianella et al., 2010) release SentiWordNet, in which each synset is associated with three numerical scores, describing how objective, positive and negative the terms contained in the synset are. Each score in SentiWordNet is in range [0.0, 1.0] and the summation is 1.0. Similar to (Esuli and Sebastiani, 2005), their method is also based on quantitative analysis of the glosses associated to synsets. (Esuli and Sebastiani, 2007) utilize pagerank to rank WordNet synsets of how strong they possess positive or negative meaning. Inspired by (Blum and Chawla, 2001) and (Pang and Lee, 2004), (Su and Markert, 2009) propose a semi-supervised mincut framework to recognize the subjectivity of word sense in WordNet. However, the thesaurus-based method can't exploit domain-specific words be- cause most entries in thesaurus (e.g. WordNet) are domain-independent. In addition, the thesaurus-based method doesn't consider the word's behaviour in corpora. 5.2 Corpus-based Method (Hatzivassiloglou and McKeown, 1997) propose the first corpus-based method to extract the polarity of adjective. Their underlying intuition is sentiment consistency, namely, words con- joined with AND have the same polarity and words connected by BUT have opposite polarity. Their method starts with a list of sentiment seeds, then some pre-defined conjunction (or con- junction patterns) are used to identify more subjective adjectives together with their polarity. However, this method highly relies on the conjunctions, and it's unable to extract adjectives that are not conjoined. (Turney et al., 2003) calculate PMI (point mutual information) and LSA (latent semantic analysis) between candidate words and sentiment seeds to measure their semantic similarity. However, their method is time consuming due to the need for web search result (or huge web-scale corpus). (Hu and Liu, 2004) treat frequency nouns and noun phrases as product feature. In their work, adjectives are extracted as sentiment words if they co-occur with product feature. However, they don't consider the relation between sentiment words and product features. (Kanayama and Nasukawa, 2006) introduced clause-level sentiment consistency to obtain can- didates, and a statistical estimation approach is used to pick up appropriate sentiment words. However, the statistical estimation will be unreliable if the corpus is small. Further, (Ding and Liu, 2010) explore intra- and inter- sentence sentiment consistency to find domain- specific sentiment words. They show that the same word could even indicate different polar- ities in the same domain. (Qiu et al., 2009, 2011) propose a semi-supervised method named double propagation for opinion word expansion and target extraction. They only need an ini- tial opinion lexicon to start the bootstrapping process. The key technique is based on syntactic relations that link opinion words and target words. However, their method requires some pre- defined general syntactic rules between sentiment and target words. (Li et al., 2012) combine cross-domain classifier and syntactic relation between sentiment words and target words. But labelled data from source domain is essential to transfer knowledge cross different domains. Our method automatically explore hundreds of syntactic and sequential patterns without any manual work. 6 Conclusion This paper presents an automatic framework to construct hundreds of syntactic and sequential patterns for domain-specific sentiment word extraction. Firstly, sentiment seeds are extracted from massive dataset of user comments. Then, general sentiment words are selected by graph propagation. Afterwards, syntactic and sequential patterns are detected automatically with the help of general sentiment words and target words from domain-specific corpora. Finally, new sentiment words will extracted as DSSWs if their structures with target words match the patterns. Experimental results on three domains show that our method outperforms two solid baselines substantially, especially in precision, which means that our large-scale patterns are precise for sentiment word extraction. With the increasing number of patterns and general sentiment words, the F-value increases obviously. Moreover, the extracted DSSWs outperforms general sentiment lexicon and baseline DSSWs in sentiment classification task, which indicates the usefulness of our method. In future work, we intend to explore hidden targets to improve the recall of our method. Besides, we plan to rank the extracted patterns to increase the accuracy. References Baccianella, S., Esuli, A., and Sebastiani, F. (2010). Sentiwordnet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining. In Proceedings of the Seventh conference on International Language Resources and Evaluation LREC10, pages 2200 -- 2204. European Language Resources Association (ELRA). Blum, A. and Chawla, S. (2001). Learning from labeled and unlabeled data using graph min- cuts. In ICML 01 Proceedings of the Eighteenth International Conference on Machine Learning, pages 19 -- 26. Morgan Kaufmann Publishers Inc. Brin, S. and Page, L. (1998). The anatomy of a large-scale hypertextual web search engine. Computer networks and ISDN systems, 30(1-7):107 -- 117. Che, W., Li, Z., and Liu, T. (2010). Ltp: A chinese language technology platform. In Proceed- ings of the 23rd International Conference on Computational Linguistics: Demonstrations, pages 13 -- 16. Association for Computational Linguistics. Ding, X. and Liu, B. (2010). Resolving object and attribute coreference in opinion mining. In Proceedings of the 23rd International Conference on Computational Linguistics, pages 268 -- 276. Association for Computational Linguistics. Esuli, A. and Sebastiani, F. (2005). Determining the semantic orientation of terms through gloss classification. In Proceedings of the 14th ACM international conference on Information and knowledge management, pages 617 -- 624. ACM. Esuli, A. and Sebastiani, F. (2006). Sentiwordnet: A publicly available lexical resource for opinion mining. In Proceedings of LREC, volume 6, pages 417 -- 422. Citeseer. Esuli, A. and Sebastiani, F. (2007). Pageranking wordnet synsets: An application to opinion mining. In Annual meeting-association for computational linguistics, volume 45, page 424. Hatzivassiloglou, V. and McKeown, K. (1997). Predicting the semantic orientation of ad- jectives. In Proceedings of the eighth conference on European chapter of the Association for Computational Linguistics, pages 174 -- 181. Association for Computational Linguistics. Haveliwala, T. (2003). Topic-sensitive pagerank: A context-sensitive ranking algorithm for web search. Knowledge and Data Engineering, IEEE Transactions on, 15(4):784 -- 796. Hu, M. and Liu, B. (2004). Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 168 -- 177. ACM. Kamps, J., Marx, M., Mokken, R., and De Rijke, M. (2004). Using wordnet to measure semantic orientations of adjectives. Kanayama, H. and Nasukawa, T. (2006). Fully automatic lexicon expansion for domain- oriented sentiment analysis. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, pages 355 -- 363. Association for Computational Linguistics. Kim, S. and Hovy, E. (2004). Determining the sentiment of opinions. In Proceedings of the 20th international conference on Computational Linguistics, page 1367. Association for Computational Linguistics. Li, B., Zhou, L., Feng, S., and Wong, K.-F. (2010). A unified graph model for sentence-based opinion retrieval. In Proceedings of the 48th Annual Meeting of the Association for Compu- tational Linguistics, pages 1367 -- 1375, Uppsala, Sweden. Association for Computational Lin- guistics. Li, F., Pan, S. J., Jin, O., Yang, Q., and Zhu, X. (2012). Cross-domain co-extraction of sentiment and topic lexicons. In Proceedings of the 50th ACL, pages 410 -- 419. ACL. Liu, B. (2012). Sentiment analysis and opinion mining. Synthesis Lectures on Human Language Technologies, 5(1):1 -- 167. Liu, B. and Zhang, L. (2012). A survey of opinion mining and sentiment analysis. Mining Text Data, pages 415 -- 463. Manning, C., Raghavan, P., and Schutze, H. (2008). volume 1. Cambridge University Press Cambridge. Introduction to information retrieval, Pang, B. and Lee, L. (2004). A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting on Associ- ation for Computational Linguistics, page 271. Association for Computational Linguistics. Pang, B. and Lee, L. (2008). Opinion mining and sentiment analysis. Foundations and Trends in Information Retrieval, 2(1-2):1 -- 135. Pang, B., Lee, L., and Vaithyanathan, S. (2002). Thumbs up?: sentiment classification using machine learning techniques. In Proceedings of the conference on EMNLP, pages 79 -- 86. ACL. Qiu, G., Liu, B., Bu, J., and Chen, C. (2009). Expanding domain sentiment lexicon through double propagation. In Proceedings of the 21st international jont conference on Artifical intelli- gence, pages 1199 -- 1204. Morgan Kaufmann Publishers Inc. Qiu, G., Liu, B., Bu, J., and Chen, C. (2011). Opinion word expansion and target extraction through double propagation. Computational Linguistics, 37(1):9 -- 27. Rao, D. and Ravichandran, D. (2009). Semi-supervised polarity lexicon induction. In Pro- ceedings of the 12th Conference of the European Chapter of the Association for Computational Linguistics, pages 675 -- 682. Association for Computational Linguistics. Su, F. and Markert, K. (2009). Subjectivity recognition on word senses via semi-supervised mincuts. In Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 1 -- 9. Associa- tion for Computational Linguistics. Takamura, H., Inui, T., and Okumura, M. (2005). Extracting semantic orientations of words using spin model. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, pages 133 -- 140. Association for Computational Linguistics. Turney, P. (2002). Thumbs up or thumbs down?: semantic orientation applied to unsupervised classification of reviews. In Proceedings of the 40th ACL, pages 417 -- 424. ACL. Turney, P., Littman, M., et al. (2003). Measuring praise and criticism: Inference of semantic orientation from association. In ACM Transactions on Information Systems (TOIS). Wiebe, J. and Mihalcea, R. (2006). Word sense and subjectivity. In Proceedings of the 21st International Conference on Computational Linguistics and the 44th annual meeting of the As- sociation for Computational Linguistics, pages 1065 -- 1072. Association for Computational Lin- guistics. Zhao, J., Xu, H., Huang, X., Tan, S., Liu, K., and Zhang, Q. (2008). Overview of chinese opinion analysis evaluation 2008. Proceedings of the First Chinese Opinion Analysis Evaluation. Zhao, Y., Qin, B., and Liu, T. (2012). Collocation polarity disambiguation using web-based pseudo contexts. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natu- ral Language Processing and Computational Natural Language Learning, pages 160 -- 170, Jeju Island, Korea. Association for Computational Linguistics. Zhou, L., Li, B., Gao, W., Wei, Z., and Wong, K.-F. (2011). Unsupervised discovery of dis- course relations for eliminating intra-sentence polarity ambiguities. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 162 -- 171, Edinburgh, Scotland, UK. Association for Computational Linguistics. Zhu, X. and Ghahramani, Z. (2002). Learning from labeled and unlabeled data with label propagation. Technical report, Technical Report CMU-CALD-02-107, Carnegie Mellon Univer- sity.
1901.11196
2
1901
2019-08-25T23:11:07
EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks
[ "cs.CL" ]
We present EDA: easy data augmentation techniques for boosting performance on text classification tasks. EDA consists of four simple but powerful operations: synonym replacement, random insertion, random swap, and random deletion. On five text classification tasks, we show that EDA improves performance for both convolutional and recurrent neural networks. EDA demonstrates particularly strong results for smaller datasets; on average, across five datasets, training with EDA while using only 50% of the available training set achieved the same accuracy as normal training with all available data. We also performed extensive ablation studies and suggest parameters for practical use.
cs.CL
cs
EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks Jason Wei1,2 Kai Zou3 1Protago Labs Research, Tysons Corner, Virginia, USA 2Department of Computer Science, Dartmouth College 3Department of Mathematics and Statistics, Georgetown University 9 1 0 2 g u A 5 2 ] L C . s c [ 2 v 6 9 1 1 1 . 1 0 9 1 : v i X r a [email protected] [email protected] Abstract We present EDA: easy data augmentation techniques for boosting performance on text classification tasks. EDA consists of four sim- ple but powerful operations: synonym replace- ment, random insertion, random swap, and random deletion. On five text classification tasks, we show that EDA improves perfor- mance for both convolutional and recurrent neural networks. EDA demonstrates particu- larly strong results for smaller datasets; on av- erage, across five datasets, training with EDA while using only 50% of the available train- ing set achieved the same accuracy as normal training with all available data. We also per- formed extensive ablation studies and suggest parameters for practical use. Introduction 1 Text classification is a fundamental task in natu- ral language processing (NLP). Machine learning and deep learning have achieved high accuracy on tasks ranging from sentiment analysis (Tang et al., 2015) to topic classification (Tong and Koller, 2002), but high performance often depends on the size and quality of training data, which is often te- dious to collect. Automatic data augmentation is commonly used in computer vision (Simard et al., 1998; Szegedy et al., 2014; Krizhevsky et al., 2017) and speech (Cui et al., 2015; Ko et al., 2015) and can help train more robust models, particu- larly when using smaller datasets. However, be- cause it is challenging to come up with generalized rules for language transformation, universal data augmentation techniques in NLP have not been thoroughly explored. Previous work has proposed some techniques for data augmentation in NLP. One popular study generated new data by translating sentences into French and back into English (Yu et al., 2018). Other work has used data noising as smoothing Operation None SR RI RS RD Sentence A sad, superior human comedy played out on the back roads of life. A lamentable, superior human comedy played out on the backward road of life. A sad, superior human comedy played out on funniness the back roads of life. A sad, superior human comedy played out on roads back the of life. A sad, superior human out on the roads of life. Table 1: Sentences generated using EDA. SR: synonym replacement. RI: random insertion. RS: random swap. RD: random deletion. (Xie et al., 2017) and predictive language models for synonym replacement (Kobayashi, 2018). Al- though these techniques are valid, they are not of- ten used in practice because they have a high cost of implementation relative to performance gain. In this paper, we present a simple set of univer- sal data augmentation techniques for NLP called EDA (easy data augmentation). To the best of our knowledge, we are the first to comprehensively explore text editing techniques for data augmen- tation. We systematically evaluate EDA on five benchmark classification tasks, showing that EDA provides substantial improvements on all five tasks and is particularly helpful for smaller datasets. Code is publicly available at http://github. com/jasonwei20/eda_nlp. 2 EDA Frustrated by the measly performance of text clas- sifiers trained on small datasets, we tested a num- ber of augmentation operations loosely inspired by those used in computer vision and found that they helped train more robust models. Here, we present the full details of EDA. For a given sentence in the training set, we randomly choose and perform one of the following operations: 1. Synonym Replacement (SR): Randomly choose n words from the sentence that are not stop words. Replace each of these words with one of its synonyms chosen at random. 2. Random Insertion (RI): Find a random syn- onym of a random word in the sentence that is not a stop word. Insert that synonym into a ran- dom position in the sentence. Do this n times. 3. Random Swap (RS): Randomly choose two words in the sentence and swap their positions. Do this n times. 4. Random Deletion (RD): Randomly remove each word in the sentence with probability p. Since long sentences have more words than short ones, they can absorb more noise while maintain- ing their original class label. To compensate, we vary the number of words changed, n, for SR, RI, and RS based on the sentence length l with the for- mula n=α l, where α is a parameter that indicates the percent of the words in a sentence are changed (we use p=α for RD). Furthermore, for each orig- inal sentence, we generate naug augmented sen- tences. Examples of augmented sentences are shown in Table 1. We note that synonym replace- ment has been used previously (Kolomiyets et al., 2011; Zhang et al., 2015; Wang and Yang, 2015), but to our knowledge, random insertions, swaps, and deletions have not been extensively studied. 3 Experimental Setup We choose five benchmark text classification tasks and two network architectures to evaluate EDA. 3.1 Benchmark Datasets We conduct experiments on five benchmark text (1) SST-2: Stanford Senti- classification tasks: ment Treebank (Socher et al., 2013), (2) CR: cus- tomer reviews (Hu and Liu, 2004; Liu et al., 2015), (3) SUBJ: subjectivity/objectivity dataset (Pang and Lee, 2004), (4) TREC: question type dataset (Li and Roth, 2002), and (5) PC: Pro-Con dataset (Ganapathibhotla and Liu, 2008). Summary statis- tics are shown in Table 5 in Supplemental Mate- rials. Furthermore, we hypothesize that EDA is more helpful for smaller datasets, so we delegate the following sized datasets by selecting a random subset of the full training set with Ntrain={500, 2,000, 5,000, all available data}. 3.2 Text Classification Models We run experiments for two popular models in text classification. (1) Recurrent neural networks (RNNs) are suitable for sequential data. We use a LSTM-RNN (Liu et al., 2016). (2) Convolutional neural networks (CNNs) have also achieved high performance for text classification. We implement them as described in (Kim, 2014). Details are in Section 9.1 in Supplementary Materials. 4 Results In this section, we test EDA on five NLP tasks with CNNs and RNNs. For all experiments, we average results from five different random seeds. 4.1 EDA Makes Gains We run both CNN and RNN models with and without EDA across all five datasets for varying training set sizes. Average performances (%) are shown in Table 2. Of note, average improve- ment was 0.8% for full datasets and 3.0% for Ntrain=500. Model RNN +EDA CNN +EDA Average +EDA 500 75.3 79.1 78.6 80.7 76.9 79.9 Training Set Size 2,000 83.7 84.4 85.6 86.4 84.6 85.4 5,000 86.1 87.3 87.7 88.3 86.9 87.8 full set 87.4 88.3 88.3 88.8 87.8 88.6 Table 2: Average performances (%) across five text classification tasks for models with and without EDA on different training set sizes. 4.2 Training Set Sizing Overfitting tends to be more severe when training on smaller datasets. By conducting experiments using a restricted fraction of the available train- ing data, we show that EDA has more significant improvements for smaller training sets. We run both normal training and EDA training for the fol- lowing training set fractions (%): {1, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}. Figure 1(a)- (e) shows performance with and without EDA for each dataset, and 1(f) shows the averaged perfor- mance across all datasets. The best average accu- racy without augmentation, 88.3%, was achieved using 100% of the training data. Models trained using EDA surpassed this number by achieving an SST-2 (N=7,447) CR (N=4,082) SUBJ (N=9,000) 1 0.8 0.6 y c a r u c c A 1 0.8 0.6 y c a r u c c A Normal EDA 1 0.8 0.6 y c a r u c c A Normal EDA Normal EDA (a) 0.4 0 20 40 60 80 100 Percent of Dataset (%) 0.4 0 20 40 60 80 100 Percent of Dataset (%) (c) (b) TREC (N=5,452) PC (N=39,418) 0.4 0 20 40 60 80 100 Percent of Dataset (%) All Datasets 1 0.8 0.6 y c a r u c c A 1 0.8 0.6 y c a r u c c A Normal EDA Normal EDA 0.4 0 20 40 60 80 100 Percent of Dataset (%) 0.4 0 20 40 60 80 100 Percent of Dataset (%) (f) (e) (d) y c a r u c c A e g a r e v A 1 0.8 0.6 Normal EDA 0.4 0 20 40 60 80 100 Percent of Dataset (%) Figure 1: Performance on benchmark text classification tasks with and without EDA, for various dataset sizes used for training. For reference, the dotted grey line indicates best performances from Kim (2014) for SST-2, CR, SUBJ, and TREC, and Ganapathibhotla (2008) for PC. average accuracy of 88.6% while only using 50% of the available training data. 4.3 Does EDA conserve true labels? In data augmentation, input data is altered while class labels are maintained. If sentences are sig- nificantly changed, however, then original class labels may no longer be valid. We take a visu- alization approach to examine whether EDA oper- ations significantly change the meanings of aug- mented sentences. First, we train an RNN on the pro-con classification task (PC) without aug- mentation. Then, we apply EDA to the test set by generating nine augmented sentences per orig- inal sentence. These are fed into the RNN along with the original sentences, and we extract the out- puts from the last dense layer. We apply t-SNE (Van Der Maaten, 2014) to these vectors and plot their 2-D representations (Figure 2). We found that the resulting latent space representations for augmented sentences closely surrounded those of the original sentences, which suggests that for the most part, sentences augmented with EDA con- served the labels of their original sentences. 4.4 Ablation Study: EDA Decomposed So far, we have seen encouraging empirical re- sults. In this section, we perform an ablation study Pro (original) Pro (EDA) Con (original) Con (EDA) Figure 2: Latent space visualization of original and augmented sentences in the Pro-Con dataset. Aug- mented sentences (small triangles and circles) closely surround original sentences (big triangles and circles) of the same color, suggesting that augmented sentences maintianed their true class labels. to explore the effects of each operation in EDA. Synonym replacement has been previously used (Kolomiyets et al., 2011; Zhang et al., 2015; Wang and Yang, 2015), but the other three EDA opera- tions have not yet been explored. One could hy- pothesize that the bulk of EDA's performance gain is from synonym replacement, so we isolate each of the EDA operations to determine their indi- vidual ability to boost performance. For all four operations, we ran models using a single oper- ) % ( n i a G e c n a m r o f r e P 3 2 1 0 −1 −2 −3 SR 0 0.1 0.2 0.3 0.4 0.5 α parameter 3 2 1 0 −1 −2 −3 RI 0 0.1 0.2 0.3 0.4 0.5 α parameter 3 2 1 0 −1 −2 −3 RS 0 0.1 0.2 0.3 0.4 0.5 α parameter 3 2 1 0 −1 −2 −3 RD N =500 N =2,000 N =5,000 Full Data 0 0.1 0.2 0.3 0.4 0.5 α parameter Figure 3: Average performance gain of EDA operations over five text classification tasks for different training set sizes. The α parameter roughly means "percent of words in sentence changed by each augmentation." SR: synonym replacement. RI: random insertion. RS: random swap. RD: random deletion. ation while varying the augmentation parameter α={0.05, 0.1, 0.2, 0.3, 0.4, 0.5} (Figure 3). It turns out that all four EDA operations con- tribute to performance gain. For SR, improvement was good for small α, but high α hurt perfor- mance, likely because replacing too many words in a sentence changed the identity of the sentence. For RI, performance gains were more stable for different α values, possibly because the original words in the sentence and their relative order were maintained in this operation. RS yielded high per- formance gains at α≤0.2, but declined at α≥0.3 since performing too many swaps is equivalent to shuffling the entire order of the sentence. RD had the highest gains for low α but severely hurt per- formance at high α, as sentences are likely un- intelligible if up to half the words are removed. Improvements were more substantial on smaller datasets for all operations, and α=0.1 appeared to be a "sweet spot" across the board. 4.5 How much augmentation? The natural next step is to determine how the num- ber of generated augmented sentences per original sentence, naug, affects performance. In Figure 4, we show average performances over all datasets for naug={1, 2, 4, 8, 16, 32}. For smaller train- ) % ( n i a G e c n a m r o f r e P 3 2 1 0 0 2 4 8 16 naug 32 N =500 N =2,000 N =5,000 Full Data Figure 4: Average performance gain of EDA across five text classification tasks for various training set sizes. naug is the number of generated augmented sentences per original sentence. ing sets, overfitting was more likely, so generat- ing many augmented sentences yielded large per- formance boosts. For larger training sets, adding more than four augmented sentences per original sentence was unhelpful since models tend to gen- eralize properly when large quantities of real data are available. Based on these results, we recom- mend usage parameters in Table 3. Ntrain 500 2,000 5,000 More α 0.05 0.05 0.1 0.1 naug 16 8 4 4 Table 3: Recommended usage parameters. 5 Comparison with Related Work Related work is creative but often complex. Back- translation (Sennrich et al., 2016), translational data augmentation (Fadaee et al., 2017), and nois- ing (Xie et al., 2017) have shown improvements in BLEU measure for machine translation. For other tasks, previous approaches include task-specific heuristics (Kafle et al., 2017) and back-translation (Silfverberg et al., 2017; Yu et al., 2018). Regard- ing synonym replacement (SR), one study showed a 1.4% F1-score boost for tweet classification by finding synonyms with k-nearest neighbors us- ing word embeddings (Wang and Yang, 2015). Another study found no improvement in tempo- ral analysis when replacing headwords with syn- onyms (Kolomiyets et al., 2011), and mixed re- sults were reported for using SR in character-level text classification (Zhang et al., 2015); however, neither work conducted extensive ablation studies. Most studies explore data augmentation as a complementary result for translation or in a task- specific context, so it is hard to directly compare EDA with previous literature. But there are two studies similar to ours that evaluate augmentation techniques on multiple datasets. Hu (2017) pro- posed a generative model that combines a varia- tional auto-encoder (VAE) and attribute discrim- inator to generate fake data, demonstrating a 3% gain in accuracy on two datasets. Kobayashi (2018) showed that replacing words with other words that were predicted from the sentence con- text using a bi-directional language model yielded a 0.5% gain on five datasets. However, training a variational auto-encoder or bidirectional LSTM language model is a lot of work. EDA yields re- sults on the same order of magnitude but is much easier to use because it does not require training a language model and does not use external datasets. In Table 4, we show EDA's ease of use compared with other techniques. Technique (#datasets) LM Ex Dat Trans. data aug.1 (1) Back-translation2 (1) VAE + discrim.3 (2) Noising4 (1) Back-translation5 (2) LM + SR6 (2) Contextual aug.7 (5) SR - kNN8 (1) EDA (5) yes yes yes yes yes yes yes no no yes yes yes no no no no no no Table 4: Related work in data augmentation. #datasets: number of datasets used for evaluation. Gain: reported performance gain on all evaluation datasets. LM: re- quires training a language model or deep learning. Ex Dat: requires an external dataset.9 6 Discussion and Limitations Our paper aimed to address the lack of standard- ized data augmentation in NLP (compared to vi- sion) by introducing a set of simple operations that might serve as a baseline for future investigation. With the rate that NLP research has progressed in 1(Fadaee et al., 2017) for translation 2(Yu et al., 2018) for comprehension 3(Hu et al., 2017) for text classification 4(Xie et al., 2017) for translation 5(Sennrich et al., 2016) for translation 6(Kolomiyets et al., 2011) for temporal analysis 7(Kobayashi, 2018) for text classification 8(Wang and Yang, 2015) for tweet classification 9EDA does use a synonym dictionary, WordNet, but the cost of downloading it is far less than training a model on an external dataset, so we don't count it as an "external dataset." recent years, we suspect that researchers will soon find higher-performing augmentation techniques that will also be easy to use. Notably, much of the recent work in NLP fo- cuses on making neural models larger or more complex. Our work, however, takes the opposite approach. We introduce simple operations, the re- sult of asking the fundamental question, how can we generate sentences for augmentation without changing their true labels? We do not expect EDA to be the go-to augmentation method for NLP, ei- ther now or in the future. Rather, we hope that our line of thought might inspire new approaches for universal or task-specific data augmentation. Now, let's note many of EDA's limitations. Foremost, performance gain can be marginal when data is sufficient; for our five classification tasks, the average performance gain for was less than 1% when training with full datasets. And while perfor- mance gains seem clear for small datasets, EDA might not yield substantial improvements when using pre-trained models. One study found that EDA's improvement was negligible when using ULMFit (Shleifer, 2019), and we expect similar results for ELMo (Peters et al., 2018) and BERT (Devlin et al., 2018). Finally, although we evalu- ate on five benchmark datasets, other studies on data augmentation in NLP use different models and datasets, and so fair comparison with related work is highly non-trivial. 7 Conclusions We have shown that simple data augmentation op- erations can boost performance on text classifi- cation tasks. Although improvement is at times marginal, EDA substantially boosts performance and reduces overfitting when training on smaller datasets. Continued work on this topic could ex- plore the theoretical underpinning of the EDA op- erations. We hope that EDA's simplicity makes a compelling case for further thought. 8 Acknowledgements We thank Chengyu Huang, Fei Xing, and Yifang Wei for help with study design and paper revi- sions, and Chunxiao Zhou for insightful feedback. Jason Wei thanks Eugene Santos for inspiration. References Xiaodong Cui, Vaibhava Goel, and Brian Kingsbury. 2015. Data augmentation for deep neural net- work acoustic modeling. IEEE/ACM Trans. Audio, Speech and Lang. Proc., 23(9):1469 -- 1477. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language under- standing. CoRR, abs/1810.04805. Marzieh Fadaee, Arianna Bisazza, and Christof Monz. 2017. Data augmentation for low-resource neural machine translation. In Proceedings of the 55th An- nual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 567 -- 573. Association for Computational Linguistics. Murthy Ganapathibhotla and Bing Liu. 2008. Mining opinions in comparative sentences. In Proceedings of the 22Nd International Conference on Computa- tional Linguistics - Volume 1, COLING '08, pages 241 -- 248, Stroudsburg, PA, USA. Association for Computational Linguistics. Minqing Hu and Bing Liu. 2004. Mining and summa- rizing customer reviews. In Proceedings of the Tenth ACM SIGKDD International Conference on Knowl- edge Discovery and Data Mining, KDD '04, pages 168 -- 177, New York, NY, USA. ACM. Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P. Xing. 2017. Toward con- trolled generation of text. In ICML. Kushal Kafle, Mohammed Yousefhussien, and Christo- pher Kanan. 2017. Data augmentation for visual question answering. In Proceedings of the 10th In- ternational Conference on Natural Language Gen- eration, pages 198 -- 202. Association for Computa- tional Linguistics. Yoon Kim. 2014. Convolutional neural networks for sentence classification. CoRR, abs/1408.5882. Tom Ko, Vijayaditya Peddinti, Daniel Povey, and San- jeev Khudanpur. 2015. Audio augmentation for speech recognition. In INTERSPEECH. Sosuke Kobayashi. 2018. Contextual augmentation: Data augmentation by words with paradigmatic re- lations. In NAACL-HLT. Oleksandr Kolomiyets, Steven Bethard, and Marie- Francine Moens. 2011. Model-portability experi- In Proceed- ments for textual temporal analysis. ings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies: Short Papers - Volume 2, HLT '11, pages 271 -- 276, Stroudsburg, PA, USA. Association for Computational Linguistics. Xin Li and Dan Roth. 2002. Learning question classi- fiers. In Proceedings of the 19th International Con- ference on Computational Linguistics - Volume 1, COLING '02, pages 1 -- 7, Stroudsburg, PA, USA. Association for Computational Linguistics. Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. 2016. Recurrent neural network for text classification with multi-task learning. In Proceedings of the Twenty- Fifth International Joint Conference on Artificial Intelligence, IJCAI'16, pages 2873 -- 2879. AAAI Press. Qian Liu, Zhiqiang Gao, Bing Liu, and Yuanlin Zhang. 2015. Automated rule selection for aspect extrac- tion in opinion mining. In Proceedings of the 24th International Conference on Artificial Intelligence, IJCAI'15, pages 1291 -- 1297. AAAI Press. George A. Miller. 1995. Wordnet: A lexical database for english. Commun. ACM, 38(11):39 -- 41. Bo Pang and Lillian Lee. 2004. A sentimental educa- tion: Sentiment analysis using subjectivity summa- rization based on minimum cuts. In Proceedings of the 42Nd Annual Meeting on Association for Com- putational Linguistics, ACL '04, Stroudsburg, PA, USA. Association for Computational Linguistics. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Nat- ural Language Processing (EMNLP), pages 1532 -- 1543. Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word rep- resentations. CoRR, abs/1802.05365. David Rolnick, Andreas Veit, Serge J. Belongie, and Nir Shavit. 2017. Deep learning is robust to massive label noise. CoRR, abs/1705.10694. Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation mod- 2016. In Proceedings of the els with monolingual data. 54th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), pages 86 -- 96. Association for Computational Linguistics. Sam Shleifer. 2019. cation with ulmfit and backtranslation. abs/1903.09244. Low resource text classifi- CoRR, Miikka Silfverberg, Adam Wiemerslage, Ling Liu, and Lingshuang Jack Mao. 2017. Data augmentation for In Proceedings of the morphological reinflection. CoNLL SIGMORPHON 2017 Shared Task: Univer- sal Morphological Reinflection, pages 90 -- 99. Asso- ciation for Computational Linguistics. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hin- ton. 2017. Imagenet classification with deep convo- lutional neural networks. Commun. ACM, 60(6):84 -- 90. Patrice Simard, Yann LeCun, John S. Denker, and Bernard Victorri. 1998. Transformation invari- ance in pattern recognition-tangent distance and tan- In Neural Networks: Tricks of gent propagation. the Trade, This Book is an Outgrowth of a 1996 NIPS Workshop, pages 239 -- 27, London, UK, UK. Springer-Verlag. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher Manning, Andrew Ng, and Christopher Potts. 2013. Parsing With Composi- tional Vector Grammars. In EMNLP. Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Ser- manet, Scott E. Reed, Dragomir Anguelov, Du- mitru Erhan, Vincent Vanhoucke, and Andrew Ra- binovich. 2014. Going deeper with convolutions. CoRR, abs/1409.4842. Duyu Tang, Bing Qin, and Ting Liu. 2015. Document modeling with gated recurrent neural network for sentiment classification. pages 1422 -- 1432. Simon Tong and Daphne Koller. 2002. Support vec- tor machine active learning with applications to text classification. J. Mach. Learn. Res., 2:45 -- 66. Laurens Van Der Maaten. 2014. Accelerating t-sne using tree-based algorithms. J. Mach. Learn. Res., 15(1):3221 -- 3245. William Yang Wang and Diyi Yang. 2015. That's so annoying!!!: A lexical and frame-semantic em- bedding based data augmentation approach to au- tomatic categorization of annoying behaviors using #petpeeve tweets. In Proceedings of the 2015 Con- ference on Empirical Methods in Natural Language Processing, pages 2557 -- 2563. Association for Com- putational Linguistics. Ziang Xie, Sida I. Wang, Jiwei Li, Daniel Levy, Aim- ing Nie, Dan Jurafsky, and Andrew Y. Ng. 2017. Data noising as smoothing in neural network lan- guage models. Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V. Le. 2018. Qanet: Combining local convolution with global self-attention for reading comprehen- sion. CoRR, abs/1804.09541. Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text clas- sification. In Proceedings of the 28th International Conference on Neural Information Processing Sys- tems - Volume 1, NIPS'15, pages 649 -- 657, Cam- bridge, MA, USA. MIT Press. Implementation Details 9 Supplementary Material 9.1 All code for EDA and the experiments in this paper can be downloaded for any use or purpose: http://github.com/jasonwei20/eda_ nlp. The following implementation details were omitted from the main text: Synonym thesaurus. All synonyms for syn- onym replacements and random insertions were generated using WordNet (Miller, 1995). Word embeddings. We use 300 dimensional word embeddings trained using GloVe (Penning- ton et al., 2014). CNN. We use the following architecture: in- put layer, 1D convolutional layer of 128 filters of size 5, global 1D max pool layer, dense layer of 20 hidden units with ReLU activation function, softmax output layer. We initialize this network with random normal weights and train against the categorical cross-entropy loss function with the adam optimizer. We use early stopping with a patience of 3 epochs. RNN. The architecture used in this paper is as follows: input layer, bi-directional hidden layer with 64 LSTM cells, dropout layer with p=0.5, bi-directional layer of 32 LSTM cells, dropout layer with p=0.5, dense layer of 20 hidden units with ReLU activation, layer. We initialize this network with random normal weights and train against the categorical cross- entropy loss function with the adam optimizer.We use early stopping with a patience of 3 epochs. softmax output 9.2 Benchmark Datasets Summary statistics for the five datasets used are shown in Table 5. Dataset SST-2 CR SUBJ TREC PC c 2 2 2 6 2 l 17 18 21 9 7 Ntrain Ntest 7,447 1,752 452 4,082 1,000 9,000 500 5,452 39,418 4,508 V 15,708 6,386 22,329 8,263 11,518 Table 5: Summary statistics for five text classification datasets. c: number of classes. l: average sentence length (number of words). Ntrain: number of training samples. Ntest: number of testing samples. V : size of vocabulary. 10 Frequently Asked Questions FAQ on implementation, usage, and theory. Implementation 10.1 Where can I find code? http://github. com/jasonwei20/eda_nlp How do you find synonyms for synonym replacement? We use WordNet (Miller, 1995) as a synonym dictionary. It is easy to download. Is there an EDA implementation for Chi- nese or other languages? Not yet, but the implementation is simple and we encourage you to write your own and share it. 10.2 Usage Should I use EDA for large datasets? Similar to how in vision, adding color jittering might not help when you're training a classifier with a large number of images, EDA might not help much if you're using a large enough dataset. Should I use EDA if I'm using a pre-trained model such as BERT or ELMo? Models that have been pre-trained on massive datasets probably don't need EDA. Why should I use EDA instead of other techniques such as contextual augmentation, noising, GAN, or back-translation? All of the above are valid techniques for data augmentation, and we encourage you to try them, as they may actually work better than EDA, depending on the dataset. But because these techniques require the use of a deep learning model in itself to generate augmented sentences, there is often a high cost of implementing these techniques relative to the expected performance gain. With EDA, we aim to provide a set of simple techniques that are generalizable to a range of NLP tasks. Is there a chance that using EDA will ac- tually hurt my performance? Considering our results across five classification tasks, it's unlikely but there's always a chance. It's possible that one of the EDA operations can change the class of some augmented sentences and create mislabeled data. But even so, "deep learning is robust to massive label noise" (Rolnick et al., 2017). 10.3 Theory How does using EDA improve text classification performance? Although it is hard to identify exactly how EDA improves the performance of classifiers, we believe there are two main reasons. The first is that generating augmented data similar to original data introduces some degree of noise that helps prevent overfitting. The second is that using EDA can introduce new vocabulary through the synonym replacement and random insertion operations, allowing models to generalize to words in the test set that were not in the training set. Both these effects are more pronounced for smaller datasets. intuitively make sense to make It doesn't random swaps, insertions, or deletions. How can this possibly make sense? Swapping two words in a sentence will probably generate an augmented sentence that doesn't make sense to humans, but it will retain most of its original words and their positions with some added noise, which can be useful for preventing overfitting. For random insertions, why do you only insert words that are synonyms, as opposed to inserting any random words? Data augmenta- tion operations should not change the true label of a sentence, as that would introduce unnecessary noise into the data. Inserting a synonym of a word in a sentence, opposed to a random word, is more likely to be relevant to the context and retain the original label of the sentence.
1808.09178
1
1808
2018-08-28T09:00:37
Analysing the potential of seq-to-seq models for incremental interpretation in task-oriented dialogue
[ "cs.CL" ]
We investigate how encoder-decoder models trained on a synthetic dataset of task-oriented dialogues process disfluencies, such as hesitations and self-corrections. We find that, contrary to earlier results, disfluencies have very little impact on the task success of seq-to-seq models with attention. Using visualisation and diagnostic classifiers, we analyse the representations that are incrementally built by the model, and discover that models develop little to no awareness of the structure of disfluencies. However, adding disfluencies to the data appears to help the model create clearer representations overall, as evidenced by the attention patterns the different models exhibit.
cs.CL
cs
Analysing the potential of seq-to-seq models for incremental interpretation in task-oriented dialogue Dieuwke Hupkes, Sanne Bouwmeester, and Raquel Fern´andez Institute for Logic Language and Computation {d.hupkes,raquel.fernandez}@uva.nl [email protected] University of Amsterdam 8 1 0 2 g u A 8 2 ] L C . s c [ 1 v 8 7 1 9 0 . 8 0 8 1 : v i X r a Abstract We investigate how encoder-decoder models trained on a synthetic dataset of task-oriented dialogues process disfluencies, such as hesita- tions and self-corrections. We find that, con- trary to earlier results, disfluencies have very little impact on the task success of seq-to-seq models with attention. Using visualisations and diagnostic classifiers, we analyse the rep- resentations that are incrementally built by the model, and discover that models develop little to no awareness of the structure of disfluen- cies. However, adding disfluencies to the data appears to help the model create clearer repre- sentations overall, as evidenced by the atten- tion patterns the different models exhibit. 1 Introduction The use of Recurrent Neural Networks (RNNs) to tackle sequential language tasks has become stan- dard in natural language processing, after impres- sive accomplishments in speech recognition, ma- chine translation, and entailment (e.g., Sutskever et al., 2014; Bahdanau et al., 2015; Kalchbren- ner et al., 2014). Recently, RNNs have also been exploited as tools to model dialogue sys- tems. Inspired by neural machine translation, re- searchers such as Ritter et al. (2011) and Vinyals and Le (2015) pioneered an approach to open- domain chit-chat conversation based on sequence- to-sequence models (Sutskever et al., 2014). In this paper, we focus on task-oriented dialogue, where the conversation serves to fulfil an inde- pendent goal in a given domain. Current neural dialogue models for task-oriented dialogue tend to equip systems with external memory compo- nents (Bordes et al., 2017), since key information needs to be stored for potentially long time spans. One of our goals here is to analyse to what ex- tent sequence-to-sequence models without exter- nal memory can deal with this challenge. In addition, we consider language realisations that include disfluencies common in dialogue in- teraction, such as repetitions and self-corrections (e.g., I'd like to make a reservation for six, I mean, for eight people). Disfluencies have been investigated extensively in psycholinguistics, with a range of studies showing that they affect sen- tence processing in intricate ways (Levelt, 1983; Fox Tree, 1995; Bailey and Ferreira, 2003; Fer- reira and Bailey, 2004; Lau and Ferreira, 2005; Brennan and Schober, 2001). Most computational work on disfluencies, however, has focused on de- tection rather than on disfluency processing and interpretation (e.g., Stolcke and Shriberg, 1996; Heeman and Allen, 1999; Zwarts et al., 2010; Qian and Liu, 2013; Hough and Purver, 2014; Hough and Schlangen, 2017). In contrast, our aim is to get a better understanding of how RNNs process disfluent utterances and to analyse the impact of such disfluencies on a downstream task -- in this case, issuing an API request reflecting the prefer- ences of the user in a task-oriented dialogue. For our experiments, we use the synthetic dataset bAbI (Bordes et al., 2017) and a modified version of it called bAbI+ which includes disflu- encies (Shalyminov et al., 2017). The dataset con- tains simple dialogues between a user and a sys- tem in the restaurant reservation domain, which terminate with the system issuing an API call that encodes the user's request. In bAbI+, disfluencies are probabilistically inserted into user turns, fol- lowing distributions in human data. Thus, while the data is artificial and certainly simplistic, its goal-oriented nature offers a rare opportunity: by assessing whether the system issues the right API call, we can study, in a controlled way, whether and how the model builds up a relevant seman- tic/pragmatic interpretation when processing a dis- fluent utterance -- a key aspect that would not be available with unannotated natural data. 2 Data In this section, we discuss the two datasets we use for our experiments: bAbI (Bordes et al., 2017) and bAbI+ (Shalyminov et al., 2017). 2.1 bAbI The bAbI dataset consists of a series of syn- thetic dialogues in English, representing human- computer interactions in the context of restaurant reservations. The data is broken down into six sub- tasks that individuate different abilities that dia- logue systems should have to conduct a successful conversation with a human. We focus on Task 1, which tests the capacity of a system to ask the right questions and integrate the answers of the user to issue an API call that matches the user's prefer- ences regarding four semantic slots: cuisine, loca- tion, price range, and party size. A sample dia- logue can be found in example (4), Section 4.1. Data The training data for Task 1 is delibera- tively kept simple and small, consisting of 1000 dialogues with on average 5 user and 7 system ut- terances. An additional 1000 dialogues based on different user queries are available for validation and testing, respectively. The overall vocabulary contains 86 distinct words. There are 7 distinct system utterances and 300 possible API calls. Baselines Together with the dataset, Bordes et al. (2017) present several baseline models for the task. All the methods proposed are retrieval based, i.e., the models are trained to select the best system response from a set of candidate re- sponses (in contrast to the models we investigate in the present work, which are generative -- see Section 3). The baseline models include classi- cal information retrieval (IR) methods such as TF- IDF and nearest neighbour approaches, as well as an end-to-end recurrent neural network. Bor- des et al. demonstrate that the end-to-end recur- rent architecture -- a memory network (Sukhbaatar et al., 2015) -- outperforms the classical IR meth- ods as well as supervised embeddings, obtaining a 100% accuracy on retrieving the correct API calls. 2.2 bAbI+ Shalyminov et al. (2017) observe that the original bAbI data lack naturalness and variation common in actual dialogue interaction. To introduce such variation while keeping lexical variation constant, they insert speech disfluencies, using a fixed set of templates that are probabilistically applied to the user turns of the original bAbI Task 1 dataset. In particular, three types of disfluencies are in- troduced: hesitations (1), restarts (2), and self- corrections (3), in around 21%, 40% and 5% of the user's turns, respectively.1 (1) We will be uhm eight (2) Good morning uhm yeah good morning (3) I would like a French uhm sorry a Vietnamese restaurant Eshghi et al. (2017) use the bAbI+ dataset to show that a grammar-based semantic parser specifically designed to process incremental dialogue phenom- ena is able to handle the bAbI+ data without hav- ing been directly exposed to it, achieving 100% accuracy on API-call prediction. They then in- vestigate whether the memory network approach by Bordes et al. (2017) is able to generalise to the disfluent data, finding that the model obtains very poor accuracy (28%) on API-call prediction when trained on the original bAbI dataset and tested on bAbI+. Shalyminov et al. (2017) further show that, even when the model is explicitly trained on bAbI+, its performance decreases significantly, achieving only 53% accuracy. This result, together with the high level of con- trol on types and frequency of disfluencies offered by the bAbI+ scripts, makes the bAbI+ data an ex- cellent testbed for studying the processing of dis- fluencies by recurrent neural networks. 3 Generative bAbI+ Modelling We start with replicating the results of Shalyminov et al. (2017) and Eshghi et al. (2017) using a gen- erative rather than retrieval based model. For this replication, we use a vanilla one-layer encoder- decoder model (Sutskever et al., 2014) without any external memory. We train models with and without an attention mechanism (Bahdanau et al., 2015) and compare their results. We perform a modest grid search over hidden layer and embed- ding sizes and find that an embedding size of 128 and a hidden layer size of 500 appear to be mini- mally required to achieve a good performance on the task. We therefore fix the embedding and hid- den layer size to 128 and 500, respectively, for all further experiments. 1The inserted material is in italics in the examples. train / test bAbI / bAbI bAbI+ / bAbI+ bAbI / bAbI+ bAbI+ / bAbI seq2seq attentive seq2seq utterances 100 (100) 100 (100) 81.4 (83.3) 100 (100) API calls 0.02 (66.4) 0.2 (80.6) 0.00 (58.2) 0.2 (81.4) utterances 100 (100) 100 (100) 91.5 (92.8) 100 (100) API calls 100 (100) 98.7 (99.7) 50.4 (90.1) 99.2 (100) MemN2N API calls 100 53 28 99 Table 1: Sequence accuracy (word accuracy in brackets) on the test set for utterances (non-API call responses) and API calls only. The last column shows accuracy on the test set for the retrieval-based memory-network system, as reported by Shalyminov et al. (2017) . 3.1 Training All models are trained to predict the system ut- terances of all of the 1000 training dialogues of the bAbI and bAbI+ dataset, respectively, includ- ing the final API call. After each user turn, mod- els are asked to generate the next system utterance in the dialogue, given the dialogue history up to that point, which consists of all human and sys- tem utterances that previously occurred in that di- alogue. The model's parameters are updated using stochastic gradient descent on a cross-entropy loss (using mini-batch size 32), with Adam (Kingma and Ba, 2014) as optimiser (learning rate 0.001). All models are trained until convergence, which was reached after ∼20 epochs. 3.2 Evaluation Following Shalyminov et al. (2017), we use a 2×2 paradigm in which we train models either on bAbI or bAbI+ data and evaluate their performance on the test set of the same dataset, as well as across datasets. We report both the percentage of cor- rect words in the generated responses (word accu- racy) and the percentage of responses that were entirely correct (sequence accuracy). Addition- ally, we separately report the word and sequence accuracy of the API calls generated at the end of each dialogue. Note that these metrics are more challenging than the retrieval-based ones used by Bordes et al. (2017) and Eshghi et al. (2017), as the correct response has to be generated word by word, rather than merely being selected from a set of already available candidate utterances. 3.3 Results Our results can be found in Table 1. The results obtained with the bAbI/bAbI and bAbI+/bAbI+ conditions indicate that an encoder-decoder model with attention can achieve near-perfect accuracy on Task 1 (predicting the right API call), whereas a model without attention cannot (sequence accu- racy for API calls is only 0.02% on bAbI/bAbI and 0.2% on bAbI+/bAbI+). This suggests that, in line with what was posed by Bordes et al. (2017), the bAbI Task 1 requires some form of memory that goes beyond what is available in a vanilla sequence-to-sequence model. To solve the task, however, using an attention mechanism suffices -- a more complicated memory such as present in memory networks is not necessary. Furthermore, our results confirm that models trained on data without disfluencies struggle to generalise when these are introduced at testing time (bAbI/bAbI+): While the overall accuracy of the dialogue is still high (91.5% of utterances are correct), API call accuracy falls back to 50.4%. Models trained on data containing disfluencies, however, show near-perfect accuracy on disfluent test data (98.7% on bAbI+/bAbI+) -- a result that stands in stark contrast with the findings of Eshghi et al. (2017) and Shalyminov et al. (2017). 4 Generalisation to Disfluent Data In this section, we analyse the potential for gen- eralisation of the encoder-decoder model with at- tention by focusing on the bAbI/bAbI+ condition, where the model trained on bAbI data is tested on bAbI+. As shown in Table 1, while the model performs perfectly on the bAbI corpus, it achieves only ∼50% accuracy on API call prediction when it is asked to generalised to bAbI+ data. Here we aim to shed light on these results by studying the errors made by the model and visualising the pat- terns of the attention component of the network. 4.1 Qualitative error analysis We start by observing that the model faced with the bAbI/bAbI+ condition encounters new lexical items at test time, such as filled pauses (uh) or editing terms (no sorry). These items are all Figure 1: Visualisation of the decoder attention when generating the API call (vertical axis) for the dis- fluent dialogue in example (4) (horizontal axis). Darker colours indicate higher attention values. mapped to a single token <unk> for 'unknown'. In addition, the presence of disfluencies increases the length of user utterances: The average utter- ance length in bAbI is 4.8 tokens, while user utter- ances in bAbI+ have an average length of 7.6. Since the inventory of system utterances is very limited (there are 7 types of system outputs), the model has no difficulty learning their surface form. The errors we find, therefore, do not concern the grammaticality of the utterances, but rather when in the course of a dialogue a particular system ut- terance is offered. We find that utterance errors always involve a jump ahead in the expected se- quence of system utterances. For example, around 83% of the utterance errors occur at the beginning of the dialogue. If the first user utterance is dis- fluent (e.g., Good morning <unk> <unk> good morning) and hence longer than ex- pected, the model tends to skip the system's greet- ing and initial prompt (Hello, what can I help you with today) and instead outputs the second system prompt (I'm on it), which only makes sense once the user has already pro- vided some task-related information. Utterance errors of this kind, where the model generates an utterance that would be appropriate later on in the dialogue, occur after all disfluency types present in bAbI+: hesitations, restarts, and self-repairs. The current evaluation setup does not allow us to test whether utterance errors by the system lead to errors in the final API call, since the input se- quence given to the encoder is the gold dialogue history and not the dialogue history with system utterances generated by the model. This, however, allows us to conclude that the errors made by the model on around 50% of all API calls are a di- rect consequence of the disfluencies present in the user utterances. Not surprisingly, API call errors are triggered by self-corrections, which in bAbI+ always involve the mention of two different val- ues for a single semantic slot (see example (4) be- low). Indeed, the model trained on bAbI achieves near-perfect accuracy when tested on a corpus that does not contain self-correction but only hesita- tions and restarts. This indicates that the lower accuracy is specifically caused by the presence of multiple potential values for the same API slot in self-corrections. Manual error inspection shows that the model does not follow a systematic strategy whereby the first mention of a semantic slot is selected, which would lead to all self-corrections being processed incorrectly. As illustrated in (4), the model seems to randomly select between the first and the sec- ond mention of a slot in a self-correction struc- ture, which leads to some self-corrections being processed correctly: (4) U:good morning S:hello what can I help you with today U:can you make a reservation for six oh no eight in a uhm yeah can you make a reservation for eight in a moderate price range no in a cheap price range in madrid S:i'm on it U:<silence> S:any preference on a type of cuisine U:I love british food S:ok let me look into some options for you U:<silence> S:<API call british madrid six cheap> In Figure 1, we visualise the decoder attention of the bAbI model when it generates the (partly in- correct) API call for the dialogue in (4). The plot shows that while generating the different compo- nents of the API call, the model strongly relies on its attention mechanism to select the right slot. Furthermore, it confirms the observation that the model is not consistent in its strategy to select a slot after a disfluency: While it incorrectly attends to six (rather than eight), it correctly selects cheap (a repair of moderate). In the next sec- tion, we will have a closer look at the attention pat- Figure 2: Alignment of in- and output words via the attention for different models tested on bAbI+ data. Left: model trained on bAbI. Right: model trained on bAbI+. terns of both the bAbI and bAbI+ trained model. 5 Disfluency Processing 4.2 Comparing attention patterns To evaluate the network's attention patterns in a more quantitative way, we store all attention weights that the model computes while generat- ing the API calls in the test corpus, and we com- pute their average for each API-call word. That is, for all words in an API-call, we compute to which words in the dialogue history the decoder was on average attending while it generated that word. We plot the results in Figure 2, removing for each API-call word (on the vertical axis in the plot) the input words (horizontal axis) whose aver- age attention score was lower 0.2. We observe that the model trained on bAbI (left) not infrequently attends to <unk> while generating API calls, in- dicating that it did not attend to the correct content word. A striking difference appears comparing the results for the bAbI model with the bAbI+ trained model (Figure 2, right), whose attention scores are much less diffuse. While the bAbI model fre- quently attends to irrelevant words such as "hello", "a" or "in" (first columns in the plot), these words are not attended at all by the bAbI+ trained model. This difference suggests that the bAbI+ model de- veloped a more clear distinction between different types of words in the input and benefits from the presence of disfluencies in the training data rather than being hindered by it. In the next section, we investigate the rep- resentations developed by the bAbI+ model (bAbI+/bAbI+ condition), focussing in particular on how it incrementally processes disfluencies. In contrast to previous work (Eshghi et al., 2017; Shalyminov et al., 2017), our seq2seq model with attention trained on bAbI+ data learns to process disfluent user utterances remarkably well, achiev- ing over 98% sequence accuracy on API calls (see bAbI+/bAbI+ condition in Table 1). In this sec- tion, we investigate how the model deals with dis- fluencies, in particular self-corrections, by draw- ing inspiration from human disfluency processing. 5.1 The structure of disfluencies It has been often noted that disfluencies follow regular patterns (Levelt, 1983; Shriberg, 1994). Example (5) shows the structure of a prototypical self-correction, where the reparandum (RM) con- tains the problematic material to be repaired; the utterance is then interrupted, which can optionally be signalled with a filled paused and/or an editing term (ET); the final part is the repair (R) proper, after which the utterance may continue: (5) a reservation for six {I mean} eight in a. . . RM ET R The presence or relationship between these ele- ments serves to classify disfluencies into different types. For example, restarts such as those inserted in the bAbI+ corpus, are characterised by the fact that the reparandum and the repair components are identical (see example (2) in Section 2.2); in con- trast to self-corrections, where the repair differs from and is intended to overwrite the material in the reparandum. In hesitations such as (1), there is only a filled pause and no reparandum nor repair. to all 5.2 Editing terms The algorithm used to generate the bAbI+ data systematically adds editing expressions (such as oh no or sorry) restarts and self- corrections inserted in the data. However, edit- ing expressions (e.g., I mean, rather, that is, sorry, oops) are in fact rare in naturally occurring hu- man conversation. For example, Hough (2015) finds that only 18.52% of self-corrections in the Switchboard corpus contain an explicit editing term. Thus, while psycholinguistic research has shown that the presence of an explicit editing term followed by a correction makes the disfluency eas- ier to handle (Brennan and Schober, 2001), hu- mans are able to process disfluencies without the clues offered by such expressions. Here we test whether the model relies on the systematic presence of editing expressions in the bAbI+ data. To this end, we created two new ver- sions of the dataset using the code by Shalyminov et al. (2017):2 One with no editing term in any of the self-corrections or restarts, dubbed "noET"; and one where there is an editing term in 20% of self-corrections and restarts, dubbed "realET" as it reflects a more realistic presence of such ex- pressions. We refer to the original bAbI+ data, which has editing terms in all self-corrections and restarts, as "fullET". We test to what extent a model trained on ful- lET, which could rely on the systematic presence of an editing term to detect the presence of a self- correction or restart, is able to process disfluen- cies in a more natural scenario where editing ex- pressions are only sparsely available (realET). The result indicates that the editing term has very lit- tle effect on the model's performance: as shown in Table 2, accuracy goes down slightly, but is still extremely high (98%). This finding persists when the editing terms are left out of the test data entirely (97% accuracy when testing on noET). When models are trained on data containing fewer editing terms (realET and noET) and tested on data with a comparable or smaller percentage of editing terms, we observe a slightly larger drop in accuracy (see Table 2). We conclude that, al- though editing terms may help the model to de- velop better representations during training, their presence is not required to correctly process dis- fluencies at test time. 2https://github.com/ishalyminov/babi_ tools Tested on noET realET fullET 100 98 95 Trained on fullET realET noET 97 94 94 Table 2: Sequence accuracies of all sequences with and without editing term, averaged over 5 runs. Identification of structural components 5.3 Disfluencies have regular patterns. However, iden- tifying their components online is not trivial. The comprehender faces what Levelt (1983) calls the continuation problem: the need to identify (the beginning and end of the reparandum and the re- pair onset. Evidence shows that there are no clues (prosodic or otherwise) present during the reparandum. Thus the identification of the disflu- ency takes place at or after the moment of interrup- tion (typically during the repair). Here there may be prosodic changes, but such clues are usually absent (Levelt and Cutler, 1983). Ferreira et al. (2004) point out that "the language comprehen- sion system is able to identify a disfluency, likely through the use of a combination of cues (in some manner that is as yet not understood)." We test to what extent our trained encoder- decoder model distinguishes reparanda and edit- ing terms and can identify the boundaries of a repair using diagnostic classifiers (Hupkes et al., 2018). Diagnostic classifiers were proposed as a method to qualitatively evaluate whether spe- cific information is encoded in high-dimensional representations -- typically the hidden states that a trained neural network goes through while pro- cessing a sentence. The technique relies on train- ing simple neural meta-models to predict the infor- mation of interest from these representations and then uses the accuracy of the resulting classifiers as a proxy for the extent to which this information is encoded in the representations. In our case, we aim to identify whether the hid- den layer activations reflect if the model is cur- rently processing a reparandum, an editing term, or the repair. To test his, we label each word in the bAbI+ validation corpus according to which of the 3 categories it belongs to and train 3 binary clas- sifiers to classify from the hidden layer activation of the encoder whether the word it just processed belongs to either one of these 3 classes. For an example of such a labelling we refer to Figure 3. 1 with uhm yeah with british cuisine in a moderate no sorry a cheap price range 0 1 2 2 3 2 2 3 3 0 0 0 0 1 Figure 3: A labelled example sentence to evaluate whether models have distinct representations for reparanda, repairs, and editing terms. For each label, we train a separate binary classifier to predict whether or not a word belongs to the corresponding class. We hypothesise that while reparanda will not be detectable in the hidden layer activations, as they can only be identified as such a posteriori (Levelt, 1983; Ferreira et al., 2004), editing terms should be easy to detect, since they belong to a class of distinct words. The most interesting classifier we consider is the one identifying repairs, which re- quires a more structural understanding of the dis- fluency and the sentence as a whole. self-corrections Reparandum 15.0 / 89.4 Editing term 37.3 / 99.4 Repair 21.3 / 93.5 restarts 27.4 / 92.6 55.7 / 99.2 35.2 / 94.9 Table 3: Precision / recall of diagnostic classifiers to identify reparanda, editing terms and repairs. The general trends in our results (see Table 3 above) are as expected: Editing terms are more easily recoverable than both reparanda and repairs, and the reparandum has the lowest scores with a precision and recall of 0.15 and 0.89, respec- tively. However, results for editing terms and re- pairs are lower than expected. The presence of editing terms is not reliably identifiable given the hidden layer activations of a model (37.3% and 55.7% precision for self-corrections and restarts, respectively), which is surprising given the fact that there is no overlap between editing terms and the rest of the model's vocabulary. Taken together with the results of our previous experiments in Section 5.2 regarding the effect of editing terms on the final sequence accuracy, this indicates that the presence of an editing term causes only minimal changes in the hidden layer activations, and thus leaves only a small trace in the hidden state of the network. The performance of the repair classifier is also low: 21.3% precision on self-correction and 35.2% on restarts. These results suggest that the model has no explicit representations of the struc- ture of disfluencies and instead relies on other cues to infer the right API call. Incremental interpretation 5.4 Next we analyse how the model processes disflu- encies by looking into the interpretation -- in terms of task-related predictions -- that the model builds incrementally, word by word and utterance by ut- terance. Word by word First, we probe the representa- tions of the encoder part of the model while it processes incoming sentences, for which we use again diagnostic classifiers. In particular, we test if information that is given at a particular point in the dialogue (for instance, the user expresses she would like to eat Indian food) is remembered by the encoder throughout the rest of the conversa- tion. We label the words in a dialogue according to what slot information was already provided pre- viously in the dialogue, and test if this information can be predicted by a diagnostic classifier at later points in the dialogue. Note that while in the bAbI data the prediction for a slot changes only once when the user expresses her preference, due to the possibilities of corrections, slot information may change multiple times in the bAbI+ corpus. We train separate diagnostic classifiers for the differ- ent slots in the API call: cuisine (10 options), loca- tion (10 options), party size (4 options), and price range (3 options). Our experiments show that the semantic infor- mation needed to issue an API call is not accu- rately predictable from the hidden representations that the encoder builds of the dialogue -- see Ta- ble 4, where accuracy scores are all relatively low. Cuisine Location Price range Party size 31.3 25.9 57.3 43.0 Table 4: Accuracy per slot type in the word-by- word experiment. In Figure 4, we plot the accuracy of the diagnos- tic classifiers over time, relative to the position at which information appears in the dialogue (that is, the accuracy at position 4 represents the accuracy 100 bAbI / bAbI 100 bAbI+ / bAbI bAbI / bAbI+ 66.6 bAbI+ / bAbI+ 99.8 Table 5: Accuracy on triggered API calls utterance by utterance. was less successful for models trained on bAbI+, where API calls were evoked only in 86% of the time (when testing on bAbI+ data) and 54% of the time (when testing on bAbI data). For our analy- sis, we consider only cases in which the API call was prompted and ignore cases in which other sen- tences were generated As shown in Table 5, we find that the de- coders of both the bAbI and bAbI+ models are able to generate appropriate API calls immedi- ately after slots are mentioned in the user utterance (∼100% accuracy in the bAbI/bAbI, bAbI+/bAbI, and bAbI+/bAbI+ conditions). However, when confronted with disfluencies, the model trained on the disfluency-free bAbI data is not able to do so reliably (66.6% accuracy with bAbI/bAbI+), fol- lowing the trend we also observed in Table 1. 6 Conclusions We have investigated how recurrent neural net- works trained in a synthetic dataset of task- oriented English dialogues process disfluencies. Our first conclusion is that, contrary to earlier find- ings, recurrent networks with attention can learn to correctly process disfluencies, provided they were presented to them at training time. In the current data, they do so without strongly relying on the presence of editing terms or identifying the repair component of disfluent structures. When compar- ing models trained on data with and without dis- fluencies, we observe that the attention patterns of the former models are more clear-cut, suggesting that the disfluencies contribute to a better under- standing of the input, rather than hindering it. Furthermore, we find that in an encoder-decoder model with attention, at least for the current task- oriented setting, a large burden of the process- ing falls on the generative part of the model: the decoder aided by the attention mechanism. The encoder, on the other hand, does not incremen- tally develop complex representations of the dia- logue history, limiting its usefulness as a cognitive model of language interpretation. We preliminary conclude that different learning biases are neces- Figure 4: Accuracy at position relative to mention in the dialogue of each type of slot. 4 words after the slot information occurred). The plot illustrates that the encoder keeps traces of se- mantic slot information for a few time steps after this information appears in the dialogue, but then rapidly 'forgets' it when the dialogue continues.3 These results confirm our earlier findings that most of the burden for correctly issuing API calls falls on the model's attention mechanism, which needs to select the correct hidden states at the moment an API call should be generated. Utterance by utterance In a second experi- ment, we study the incremental development of the API call made by the model's generative com- ponent (the decoder) by prompting it to generate an API call after every user utterance. To trigger the API calls, we append the utterances normally preceding an API call (let me look some options for you <silence>) to the dia- logue history that is fed to the decoder. We ap- ply this trick to elicit an API call after every user utterance in the dialogue. We evaluate the gener- ated API calls by considering only the slots that can already be filled given the current dialogue history. That is, in a dialogue in which the user has requested to eat Italian food in London but has not talked about party size, we exclude the party size slot from the evaluation, and evaluate only whether the generated API call correctly predicts "Italian" and "London". For models trained on bAbI data, the described method reliably prompted an API call, while it 3To exclude the possibility that the low accuracy is a con- sequence of relocation of information instead of it being for- gotten, we also trained diagnostic classifiers to only start pre- dicting a few words after slot information appears, but this did not result in an increase in accuracy. sary to obtain a more balanced division of labour between encoder and decoder. Here we have exploited synthetic data, taking advantage of the control this affords regarding types and frequency of disfluency patterns, as well as the direct connection between language pro- cessing and task success present in the dataset. In the future, we aim at investigating neural models of disfluency processing applied to more natural- istic data, possibly leveraging eye-tracking infor- mation to ground language comprehension (Heller et al., 2015; Lowder and Ferreira, 2016). References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly In Proceedings of learning to align and translate. the 3rd International Conference on Learning Rep- resentations (ICLR). Karl GD Bailey and Fernanda Ferreira. 2003. Disflu- encies affect the parsing of garden-path sentences. Journal of Memory and Language, 49(2):183 -- 200. Antoine Bordes, Y-Lan Boureau, and Jason Weston. 2017. Learning end-to-end goal-oriented dialog. In Proceedings of the 5th International Conference on Learning Representations (ICLR). Susan E Brennan and Michael F Schober. 2001. How listeners compensate for disfluencies in sponta- neous speech. Journal of Memory and Language, 44(2):274 -- 296. Arash Eshghi, Igor Shalyminov, and Oliver Lemon. 2017. Bootstrapping incremental dialogue systems from minimal data: the generalisation power of di- alogue grammars. In Proceedings of the 2017 Con- ference on Empirical Methods in Natural Language Processing (EMNLP), pages 2220 -- 2230. Associa- tion for Computational Linguistics. Fernanda Ferreira and Karl G. D. Bailey. 2004. Disflu- encies and human language comprehension. Trends in Cognitive Sciences, 8(5). Fernanda Ferreira, Ellen F. Lau, and Karl G. D. Bai- ley. 2004. Disfluencies, language comprehension, and tree adjoining grammars. Cognitive Science, 28:721 -- 749. Jean E. Fox Tree. 1995. The effects of false starts and repetitions on the processing of subsequent words in spontaneous speech. Journal of memory and lan- guage, 34(6):709 -- 738. Peter A. Heeman and James F. Allen. 1999. Speech repairs, intonational phrases, and discourse markers: modeling speakers' utterances in spoken dialogue. Computational Linguistics, 25(4):527 -- 571. Daphna Heller, Jennifer E Arnold, Natalie Klein, and Michael K Tanenhaus. 2015. Inferring difficulty: Flexibility in the real-time processing of disfluency. Language and Speech, 58(2):190 -- 203. Julian Hough. 2015. Modelling Incremental Self- Repair Processing in Dialogue. Ph.D. thesis, Queen Mary University of London. Julian Hough and Matthew Purver. 2014. Strongly in- In Proceedings of the cremental repair detection. 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 78 -- 89. Julian Hough and David Schlangen. 2017. Joint, Incre- mental Disfluency Detection and Utterance Segmen- In Proceedings of the Annual tation from Speech. Meeting of the European Chapter of the Association for Computational Linguistics (EACL), pages 326 -- 336. Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. 2018. Visualisation and 'diagnostic classi- fiers' reveal how recurrent and recursive neural net- works process hierarchical structure. Journal of Ar- tificial Intelligence Research, 61:907 -- 926. Nal Kalchbrenner, Edward Grefenstette, and Phil Blun- som. 2014. A convolutional neural network for In Proceedings of the 52nd modelling sentences. Annual Meeting of the Association for Computa- tional Linguistics, pages 655 -- 665. Diederik Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. In Proceedings of ICLR 2014, pages 1 -- 13. Ellen F. Lau and Fernanda Ferreira. 2005. Linger- ing effects of disfluent material on comprehension of garden path sentences. Language and Cognitive Processes, 20:633 -- 666. Willem J. M. Levelt. 1983. Monitoring and self-repair in speech. Cognition, 14(1):41 -- 104. Willem JM Levelt and Anne Cutler. 1983. Prosodic Journal of semantics, marking in speech repair. 2(2):205 -- 218. Matthew W Lowder and Fernanda Ferreira. 2016. Pre- diction in the processing of repair disfluencies: Ev- idence from the visual-world paradigm. Journal of Experimental Psychology: Learning, Memory, and Cognition, 42(9):1400 -- 1416. Xian Qian and Yang Liu. 2013. Disfluency detection using multi-step stacked learning. In Proceedings of the 2013 Conference of the North American Chap- ter of the Association for Computational Linguistics: Human Language Technologies, pages 820 -- 825. Alan Ritter, Colin Cherry, and William B. Dolan. 2011. Data-driven response generation in social media. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 583 -- 593. Association for Computational Linguis- tics. Igor Shalyminov, Arash Eshghi, and Oliver Lemon. 2017. Challenging neural dialogue models with nat- ural data: Memory networks fail on incremental In Proceedings of the 21st Workshop phenomena. on the Semantics and Pragmatics of Dialogue (SEM- DIAL), pages 125 -- 133. Elizabeth E. Shriberg. 1994. Preliminaries to a Theory of Speech Disfluencies. Ph.D. thesis, University of California at Berkeley, Berkeley, CA. Andreas Stolcke and Elizabeth Shriberg. 1996. Statis- tical language modeling for speech disfluencies. In Conference Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Pro- cessing (ICASSP-96), volume 1, pages 405 -- 408. Sainbayar Sukhbaatar, arthur szlam, Jason Weston, and Rob Fergus. 2015. End-to-end memory net- works. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2440 -- 2448. Curran Associates, Inc. Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural net- works. In Advances in neural information process- ing systems (NIPS), pages 3104 -- 3112. Oriol Vinyals and Quoc V. Le. 2015. A neural conver- sational model. In Proceedings of the 31 st Interna- tional Conference on Machine Learning (ICML) -- Deep Learning Workshop. Simon Zwarts, Mark Johnson, and Robert Dale. 2010. Detecting speech repairs incrementally using a noisy In Proceedings of the 23rd in- channel approach. ternational conference on computational linguistics, pages 1371 -- 1378. Association for Computational Linguistics.
1911.00811
1
1911
2019-11-03T02:47:51
Posing Fair Generalization Tasks for Natural Language Inference
[ "cs.CL" ]
Deep learning models for semantics are generally evaluated using naturalistic corpora. Adversarial methods, in which models are evaluated on new examples with known semantic properties, have begun to reveal that good performance at these naturalistic tasks can hide serious shortcomings. However, we should insist that these evaluations be fair -that the models are given data sufficient to support the requisite kinds of generalization. In this paper, we define and motivate a formal notion of fairness in this sense. We then apply these ideas to natural language inference by constructing very challenging but provably fair artificial datasets and showing that standard neural models fail to generalize in the required ways; only task-specific models that jointly compose the premise and hypothesis are able to achieve high performance, and even these models do not solve the task perfectly.
cs.CL
cs
Posing Fair Generalization Tasks for Natural Language Inference Atticus Geiger Stanford Symbolic Systems Program Ignacio Cases Stanford Linguistics [email protected] [email protected] Lauri Karttunen Stanford Linguistics Christopher Potts Stanford Linguistics [email protected] [email protected] 9 1 0 2 v o N 3 ] L C . s c [ 1 v 1 1 8 0 0 . 1 1 9 1 : v i X r a Abstract Deep learning models for semantics are gener- ally evaluated using naturalistic corpora. Ad- versarial methods, in which models are eval- uated on new examples with known semantic properties, have begun to reveal that good per- formance at these naturalistic tasks can hide serious shortcomings. However, we should in- sist that these evaluations be fair -- that the models are given data sufficient to support the requisite kinds of generalization. In this pa- per, we define and motivate a formal notion of fairness in this sense. We then apply these ideas to natural language inference by con- structing very challenging but provably fair ar- tificial datasets and showing that standard neu- ral models fail to generalize in the required ways; only task-specific models that jointly compose the premise and hypothesis are able to achieve high performance, and even these models do not solve the task perfectly. 1 Introduction Evaluations of deep learning approaches to seman- tics generally rely on corpora of naturalistic exam- ples, with quantitative metrics serving as a proxy for the underlying capacity of the models to learn rich meaning representations and find generalized solutions. From this perspective, when a model achieves human-level performance on a task ac- cording to a chosen metric, one might be tempted to say that the task is "solved". However, recent adversarial testing methods, in which models are evaluated on new examples with known semantic properties, have begun to reveal that even these state-of-the-art models often rely on brittle, local solutions that fail to generalize even to examples that are similar to those they saw in training. These findings indicate that we need a broad and deep range of evaluation methods to fully characterize the capacities of our models. However, for any evaluation method, we should ask whether it is fair. Has the model been shown data sufficient to support the kind of generaliza- tion we are asking of it? Unless we can say "yes" with complete certainty, we can't be sure whether a failed evaluation traces to a model limitation or a data limitation that no model could overcome. In this paper, we seek to address this issue by defining a formal notion of fairness for these eval- uations. The definition is quite general and can be used to create fair evaluations for a wide range of tasks. We apply it to Natural Language Infer- ence (NLI) by constructing very challenging but provably fair artificial datasets1. We evaluate a number of different standard architectures (vari- ants of LSTM sequence models with attention and tree-structured neural networks) as well as NLI- specific tree-structured neural networks that pro- cess aligned examples. Our central finding is that only task-specific models are able to achieve high performance, and even these models do not solve the task perfectly, calling into question the viabil- ity of the standard models for semantics. 2 Related Work There is a growing literature that uses targeted generalization tasks to probe the capacity of learn- ing models. We seek to build on this work by de- veloping a formal framework in which one can ask whether one of these tasks is even possible. In adversarial testing, In computer vision, training examples are systematically perturbed and then used for test- ing. it is common to ad- versarially train on artificially noisy examples to create a more robust model (Goodfellow et al., 2015; Szegedy et al., 2014). However, in the case of question answering, Jia and Liang (2017) show that training on one perturbation does not 1 https://github.com/atticusg/MultiplyQuantifiedData result in generalization to similar perturbations, revealing a need for models with stronger gen- eralization capabilities. Similarly, adversarial testing has shown that strong models for the SNLI dataset (Bowman et al., 2015a) have sig- nificant holes in their knowledge of lexical and compositional semantics (Glockner et al., 2018; Naik et al., 2018; Nie et al., 2018; Yanaka et al., 2019; Dasgupta et al., 2018). In addition, a num- ber of recent papers suggest that even top models exploit dataset artifacts to achieve good quantita- tive results (Poliak et al., 2018; Gururangan et al., 2018; Tsuchiya, 2018), which further emphasizes the need to go beyond naturalistic evaluations. Artificially generated datasets have also been used extensively to gain analytic insights into what models are learning. These methods have the ad- vantage that the complexity of individual exam- ples can be precisely characterized without refer- ence to the models being evaluated. Evans et al. (2018) assess the ability of neural models to learn logic entailment. Bowman et al. propositional (2015b) conduct similar experiments using natu- ral logic, and Veldhoen and Zuidema (2018) ana- lyze models trained on those same tasks, arguing that they fail to discover the kind of global solu- tion we would expect if they had truly learned nat- ural logic. Lake and Baroni (2017) apply similar methods to instruction following with an artificial language describing a simple domain. These methods can provide powerful insights, but the issue of fairness looms large. For in- stance, Bowman (2013) poses generalization tasks in which entire reasoning patterns are held out for testing. Similarly, Veldhoen and Zuidema (2018) assess a model's ability to recognize De Morgan's laws without any exposure to this reasoning in training. These extremely difficult tasks break from standard evaluations in an attempt to expose model limitations. However, these tasks are not fair by our standards; brief formal arguments for these claims are given in Appendix A. 3 Compositionality and Generalization Many problems can be solved by recursively com- posing intermediate representations with functions along a tree structure. In the case of arithmetic, the intermediate representations are numbers and the functions are operators such a plus or minus. In the case of evaluating the truth of propositional logic sentences, the intermediate representation Data: A composition tree C = (T, Dom, Func), a node a ∈ N T , and an input x ∈ IC Result: An output from Dom(a) function compose(C, a, x) if a ∈ N T leaf then i ← index(a, T ) return xi else end c1, . . . cm ← children(a, T ) return Func(a)( compose(C, c1, x), . . . , compose(C, cm, x)) This algorithm uses helper Algorithm 1: Recursive composition up a tree. functions children(a, T ), which returns the left-to-right ordered children of node a, and index(a, T ), which returns the index of a leaf according to left-to-right ordering. are truth values and the functions are logical op- erators such as disjunction, negation, or the ma- terial conditional. We will soon see that, in the case of NLI, the intermediate representations are semantic relations between phrases and the func- tions are semantic operators such as quantifiers or negation. When tasked with learning some com- positional problem, we intuitively would expect to be shown how every function operates on ev- ery intermediate value. Otherwise, some functions would be underdetermined. We now formalize the idea of recursive tree-structured composition and this intuitive notion of fairness. We first define composition trees (Section 3.1) and show how these naturally determine baseline learning models (Section 3.2). These models im- plicitly define a property of fairness: a train/test split is fair if the baseline model learns the task perfectly (Section 3.3). This enables us to create provably fair NLI tasks in Section 4. 3.1 Composition Trees A composition tree describes how to recursively compose elements from an input space up a tree structure to produce an element in an output space. Our baseline learning model will construct a com- position tree using training data. leaf ∪ N T leaf is the set of leaf nodes and N T Definition 1. (Composition Tree) Let T be an or- dered tree with nodes N T = N T non-leaf, where N T non-leaf is the set of non-leaf nodes for T . Let Dom be a map on N T that assigns a set to each node, called Data: An ordered tree T and a set of training data D containing pairs (x, Y ) where x is an input and Y is a function defined on N T labels at every node of T . non-leaf providing Result: A composition tree (T, Dom, Func) function learn (T, D) Dom, Func ← initialize(T ) for (x, Y ) ∈ D do Dom, Func ← memorize(x, Y, T, Dom, Func, r) end return (T, Dom, Func) function memorize (x,Y,T,Dom,Func,a) if a ∈ N T leaf then i ← index(a, T ) Dom[a] ← Dom[a] ∪ {xi} return Dom, Func else Dom[a] ← Dom[a] ∪ {Y (a)} c1, . . . , cm ← children(a, T ) Func[a][(Y (c1), . . . , Y (cm))] ← Y (a) for k ← 1 . . . m do Dom, Func ← memorize(x, Y, T, Dom, Func, ck) end return Dom, Func end Algorithm 2: Given a tree and training data with labels for every node of the tree, this learning model constructs a composition tree. This al- gorithm uses helper functions children(a, T ) and index(a, T ), as in Algorithm 1, as well as initialize(T ), which returns Dom, a dictio- nary mapping N T to empty sets, and Func, a dic- tionary mapping N T non-leaf to empty dictionaries. the domain of the node. Let Func be a map on N T non-leaf that assigns a function to each non-leaf node satisfying the following property: For any a ∈ N T non-leaf with left-to-right ordered children c1, . . . , cm, we have that Func(a) : Dom(c1) × · · · × Dom(cm) → Dom(a). We refer to the tuple C = (T, Dom, Func) as a composition tree. The input space of this composition tree is the carte- sian product IC = Dom(l1) × · · · × Dom(lk), where l1, . . . , lk are the leaf nodes in left-to-right order, and the output space is OC = Dom(r) where r is the root node. A composition tree C = (T, Dom, Func) re- alizes a function F : IC → OC in the follow- ing way: For any input x ∈ IC , this function is given by F (x) = compose(C, r, x), where r is the root node of T and compose is defined re- cursively in Algorithm 1. For a given x ∈ IC and a ∈ N T non-leaf with children c1, . . . , cm, we say that the element of Dom(c1) × · · · × Dom(cm) that is input to Func(a) during the computation of F (x) = compose(C, r, x) is the input real- ized at Func(a) on x and the element of Dom(a) that is output by Func(a) is the output realized at Func(a) on x. At a high level, compose(C, a, x) finds the output realized at a node a by computing node a's function Func(a) with the outputs real- ized at node a's children as inputs. This recursion bottoms out when the components of x are pro- vided as the outputs realized at leaf nodes. 3.2 A Baseline Learning Model Algorithm 2 is our baseline learning model. It learns a function by constructing a composition tree. This is equivalent to learning the function that tree realizes, as once the composition tree is created, Algorithm 1 computes the realized func- tion. Because this model constructs a composition tree, it has an inductive bias to recursively com- pute intermediate representations up a tree struc- ture. At a high level, it constructs a full composi- tion tree when provided with the tree structure and training data that provides a label at every node in the tree by looping through training data inputs and memorizing the output realized at each inter- mediate function for a given input. As such, any learning model we compare to this baseline model should be provided with the outputs realized at ev- ery node during training. 3.3 Fairness We define a training dataset to be fair with respect to some function F if our baseline model perfectly learns the function F from that training data. The guiding idea behind fairness is that the training data must expose every intermediate function of a composition tree to every possible intermediate in- put, allowing the baseline model to learn a global solution: Definition 2. (A Property Sufficient for Fairness) A property of a training dataset D and tree T that is sufficient for fairness with respect to a function F is that there exists a composition tree C = (T, Dom, Func) realizing F such that, for any a ∈ N T non-leaf and for any input i to Func(a), there exists (x, Y ) ∈ D where i is the input real- ized at Func(a) on x. Not all fair datasets are challenging. For exam- ple, a scenario in which one trains and tests on the entire space of examples will be fair. The role of C2 → {T, F} symbol example set theoretic definition {T, F} {⇒} C1 → {T, F} {¬, ε} {T, F} Figure 1: A composition tree that realizes a function evaluating propositional sentences. We define the func- tions C1(U, V1) = U (V1) and C2(V1, ⇒, V2) = V1 ⇒ V2 where V1, V2 ∈ {T, F} and U ∈ {¬, ε}. Train T ⇒ ε F T ⇒ ¬ F F ⇒ ¬ T F ⇒ ε T Test T ⇒ ¬ T T ⇒ ε T F ⇒ ¬ F F ⇒ ε F Table 1: A fair train/test split for the evaluation prob- lem defined by the composition tree in Figure 1. We give just the terminal nodes; the examples are full trees. fairness is to ensure that, when we separately de- fine a challenging task, it is guaranteed to be pos- sible. We noted in Section 2 that some challenging problems in the literature fail to meet this minimal requirement. 3.4 Fair Tasks for Propositional Evaluation As a simple illustration of the above concepts, we consider the task of evaluating the truth of a sen- tence from propositional logic. We use the stan- dard logical operators material conditional, ⇒, and negation, ¬, as well as the unary operator ε, which we define to be the identity function on {T, F}. We consider a small set of eight propo- sitional sentences, all which can be seen in Ta- ble 1. We illustrate a composition tree that re- alizes a function performing truth evaluation on these sentences in Figure 1, where a leaf node l is labeled with its domain Dom(l) and a non-leaf node a is labeled with Func(a) → Dom(a). A dataset for this problem is fair if and only if it has two specific properties. First, the binary operator ⇒ must be exposed to all four inputs in {T, F} × {T, F} during training. Second, the unary operators ¬ and ε each must be exposed to both inputs in {T, F}. Jointly, these constraints en- sure that a model will see all the possibilities for how our logical operators interact with their truth- value arguments. If either constraint is not met, then there is ambiguity about which operators the x ≡ y x ⊏ y x ⊐ y x ∧ y x y x ⌣ y x # y couch ≡ sofa crow ⊏ bird bird ⊐ crow x = y x ⊂ y x ⊃ y human ∧ nonhuman x ∩ y = ∅ ∧ x ∪ y = U x ∩ y = ∅ ∧ x ∪ y 6= U animal ⌣ nonhuman x ∩ y 6= ∅ ∧ x ∪ y = U cat dog hungry # hippo (all other cases) Table 2: The seven basic semantic relations of MacCartney and Manning (2009): B = {# = indepen- dence, ⊏ = entailment, ⊐ = reverse entailment, = al- ternation, ⌣ = cover, ∧ = negation, ≡ = equivalence}. Pevery/some(⊐) = ⊏ Pevery/some ⊐ every some animal dog Figure 2: Natural logic inference cast as composition on aligned semantic parse trees. The joint projectiv- ity signature Pevery/some operates on the semantic rela- tion ⊐ determined by the aligned pair animal/dog to determine entailment (⊏) for the whole. In contrast, if we reverse every and some, creating the example some animal/every dog, then the joint projectivity signature Psome/every operates on ⊐, which determines reverse en- tailment (⊐). model is tasked with learning. An example fair train/test split is given in Table 1. Crucial to our ability to create a fair training dataset using only four of the eight sentences is that ⇒ operates on the intermediate representation of a truth value, abstracting away from the specific identity of its sentence arguments. Because there are two ways to realize T and F at the intermedi- ate node, we can efficiently use only half of our sentences to satisfy our fairness property. 4 Fair Artificial NLI Datasets Our central empirical question is whether cur- rent neural models can learn to do robust natu- ral language inference if given fair datasets. We now present a method for addressing this ques- tion. To do this, we need to move beyond the sim- ple propositional logic example explored above, to come closer to the true complexity of natural lan- guage. To do this, we adopt a variant of the natu- ral logic developed by MacCartney and Manning (2007, 2009) (see also S´anchez-Valencia 1991; van Benthem 2008; Icard and Moss 2013). Nat- ural logic is a flexible approach to doing logi- cal inference directly on natural language expres- sions. Thus, in this setting, we can work directly with natural language sentences while retaining complete control over all aspects of the generated dataset. 4.1 Natural Logic We define natural logic reasoning over aligned se- mantic parse trees that represent both the premise and hypothesis as a single structure and allow us to calculate semantic relations for all phrases com- positionally. The core components are semantic relations, which capture the direct inferential re- lationships between words and phrases, and pro- jectivity signatures, which encode how semantic operators interact compositionally with their ar- guments. We employ the semantic relations of MacCartney and Manning (2009), as in Table 2. We use B to denote the set containing these seven semantic relations. The essential concept for the material to come is that of joint projectivity: for a pair of semantic functions f and g and a pair of inputs X and Y that are in relation R, the joint projectivity signa- ture Pf /g : B → B is a function such that the rela- tion between f (X) and g(Y ) is Pf /g(R). Figure 2 illustrates this with the phrases every animal and some dog. We show the details of how the natural logic of MacCartney and Manning (2009), with a small extension, determines the joint projectivity signatures for our datasets in Appendix B. 4.2 A Fragment of Natural Language Our fragment G consists of sentences of the form: QS AdjS NS Neg Adv V QO AdjO NO where NS and NO are nouns, V is a verb, AdjS and AdjO are adjectives, and Adv is an adverb. Neg is does not, and QS and QO can be every, not every, some, or no; in each of the remaining categories, there are 100 words. Additionally, AdjS, AdjO, Adv, and Neg can be the empty string ε, which is represented in the data by a unique token. Se- mantic scope is fixed by surface order, with earlier elements scoping over later ones. For NLI, we define the set of premise -- hypothesis pairs S ⊂ G×G such that (sp, sh) ∈ S iff the non-identical non-empty nouns, adjectives, verbs, and adverbs with identical positions in sp and sh are in the # relation. This constraint on S trivializes the task of determining the lexical relations between adjectives, nouns, adverbs, and verbs, since the relation is ≡ where the two aligned elements are identical and otherwise #. Further- more, it follows that distinguishing contradictions from entailments is trivial. The only sources of contradictions are negation and the negative quan- tifiers no and not every. Consider (sp, sh) ∈ S and let C be the number of times negation or a negative quantifier occurs in sp and sh. If sp contradicts sh, then C is odd; if sp entails sh, then C is even. We constrain the open-domain vocabulary to stress models with learning interactions between logically complex function words; we trivialize the task of lexical semantics to isolate the task of compositional semantics. We also do not have multiple morphological forms, use artificial tokens that do not correspond to English words, and col- lapse do not and not every to single tokens to fur- ther simplify the task and isolate a model's ability to perform compositional logical reasoning. Our corpora use the three-way labeling scheme of entailment, contradiction, and neutral. To assign these labels, we translate each premise -- hypothesis pair into first-order logic and use Prover9 (McCune, 2005 -- 2010). We assume no ex- pression is empty or universal and encode these as- sumptions as additional premises. This label gen- eration process implicitly assumes the relation be- tween unequal nouns, verbs, adjectives, and ad- verbs is independence. When we generate training data for NLI cor- pora from some subset Strain ⊂ S, we perform the following balancing. For a given example, every adjective -- noun and adverb -- verb pair across the premise and hypothesis is equally likely to have the relation ≡, ⊏, ⊐, or #. Without this bal- ancing, any given adjective -- noun and adverb -- verb pair across the premise and hypothesis has more than a 99% chance of being in the independence relation for values of Strain we consider. Even with this step, 98% of the sentence pairs are neutral, so we again sample to create corpora that are bal- anced across the three NLI labels. This balancing across our three NLI labels justifies our use of an accuracy metric rather than an F1 score. 4.3 Composition Trees for NLI We provide a composition tree for inference on S in Figure 3. This is an aligned composition tree, as in Figure 2: it jointly composes lexical items from COMP → {≡, ⊏, ⊐, , , ⌣, #} PROJ→ Q COMP → {#, ⊏, ⊐, ≡} COMP→ {≡, ⊏, ⊐, , , ⌣, #} QP QH PROJ → A REL → {#, ≡} PROJ → N COMP → {≡, ⊏, ⊐, , , ⌣, #} AdjP S AdjH S N P O N H O N egP N egH COMP → {#, ⊏, ⊐, ≡} PROJ→ Q COMP → {#, ⊏, ⊐, ≡} PROJ → A REL → {#, ≡} QP QH PROJ → A {#, ≡} AdvP AdvH V P V H AdjP O AdjH O N P O N H O Figure 3: An aligned composition tree for inference on our set of examples S. The superscripts P and H refer to premise and hypothesis. The semantic relations are defined in Table 2. The set Q is {some, every, no, not, every}. The set Neg is {ε, not}. Q is the set of 16 joint projectivity signatures between the elements of Q. N is the set of 4 joint projectivity signatures between ε and no. A is the set of 4 joint projectivity signatures between ε and an intersective adjective or adverb. REL computes the semantic relations between lexical items, PROJ computes the joint projectivity between two semantic functions (Section 4.1 and Appendix B), and COMP applies semantic relations to joint projectivity signatures. This composition tree defines over 1026 distinct examples. the premise and hypothesis. The leaf nodes come in sibling pairs where one sibling is a lexical item from the premise and the other is a lexical item from the hypothesis. If both leaf nodes in a sibling pair have domains containing lexical items that are semantic functions, then their parent node domain contains the joint projectivity signatures between those semantic functions. Otherwise the parent node domain contains the semantic relations be- tween the lexical items in the two sibling node domains. The root captures the overall semantic relation between the premise and the hypothesis, while the remaining non-leaf nodes represent in- termediate phrasal relations. The sets AdjS, NS, AdjO, NO, Adv, and V each have 100 of their respective open class lexical items with Adv, AdjS, and AdjO also containing the empty string ε. The set Q is {some, every, no, not, every} and the set Neg is {ε, not}. Q is the set of 16 joint projectivity signatures between the quantifiers some, every, no, and not every, N is the set of 4 joint projectivity signatures between the empty string ε and no, and A is the set of 4 pro- jectivity signatures between ε and an intersective adjective or adverb. These joint projectivity signa- tures were exhaustively determined by us by hand, using the projectivity signatures of negation and quantifiers provided by MacCartney and Manning (2009) as well as a small extension (details in Ap- pendix B). The function PROJ computes the joint projec- tivity signature between two semantic functions, REL computes the semantic relation between two lexical items, and COMP inputs semantic relations into a joint projectivity signature and outputs the result. We trimmed the domain of every node so that the function of every node is surjective. Pairs of subexpressions containing quantifiers can be in any of the seven basic semantic relations; even with the contributions of open-class lexical items trivialized, the level of complexity remains high, and all of it emerges from semantic composition, rather than from lexical relations. 4.4 A Difficult But Fair NLI Task A fair training dataset exposes each local function to all possible inputs. Thus, a fair training dataset for NLI will have the following properties. First, all lexical semantic relations must be included in the training data, else the lexical targets could be underdetermined. Second, for any aligned seman- tic functions f and g with unknown joint projec- tivity signature Pf /g, and for any semantic relation R, there is some training example where Pf /g is exposed to the semantic relation R. This ensures that the model has enough information to learn full joint projectivity signatures. Even with these constraints in place, the composition tree of Sec- tion 3.1 determines an enormous number of very challenging train/test splits. Appendix C fully de- fines the procedure for data generation. We also experimentally verify that our baseline learns a perfect solution from the data we gener- ate. The training set contains 500,000 examples randomly sampled from Strain and the test and de- velopment sets each contain 10,000 distinct exam- ples randomly sampled from ¯Strain. All random sampling is balanced across adjective -- noun and adverb -- verb relations as well as across the three NLI labels, as described in Section 4.2. 5 Models We consider six different model architectures: CBoW Premise and hypothesis are represented by the average of their respective word em- beddings (continuous bag of words). LSTM Encoder Premise and hypothesis are pro- cessed as sequences of words using a recur- rent neural network (RNN) with LSTM cells, and the final hidden state of each serves as its representation (Hochreiter and Schmidhuber, 1997; Elman, 1990; Bowman et al., 2015a). TreeNN Premise and hypothesis are processed as trees, and the semantic composition func- tion is a single-layer feed-forward network (Socher et al., 2011b,a). The value of the root node is the semantic representation in each case. Attention LSTM An LSTM RNN with word-by- word attention (Rocktaschel et al., 2015). CompTreeNN Premise and hypothesis are pro- cessed as a single aligned tree, following the structure of the composition tree in Fig- ure 3. The semantic composition func- tion is a single-layer feed-forward network (Socher et al., 2011b,a). The value of the root node is the semantic representation of the premise and hypothesis together. CompTreeNTN Identical to the CompTreeNN, but with a neural tensor network as the com- position function (Socher et al., 2013). For the first three models, the premise and hy- pothesis representations are concatenated. For the CompTreeNN, CompTreeNTN, and Attention LSTM, there is just a single representation of the pair. In all cases, the premise -- hypothesis repre- sentation is fed through two hidden layers and a softmax layer. All models are initialized with random 100- dimensional word vectors and optimized us- ing Adam (Kingma and Ba, 2014). It would not be possible to use pretrained word vec- tors, due to the artificial nature of our dataset. A grid hyperparameter search was run over dropout values of {0, 0.1, 0.2, 0.3} on the output and keep layers of LSTM cells, learning rates of {1e−2, 3e−3, 1e−3, 3e−4}, L2 regularization sentence adverb-verb phrase every tall kid ǫ happily kicks every ǫ rock happily kicks entailment no tall kid does not ǫ kicks some large rock negated verb phrases ǫ happily kicks every ǫ rock does not ǫ kicks some large rock verb phrases happily kicks every ǫ rock ⊏ ǫ kicks some large rock adjective-noun phrase ǫ rock ⊐ large rock ⊏ ǫ kicks adjective-noun phrase tall kid ≡ tall kid single words tall ≡ tall kid ≡ kid happily ⊏ ǫ single words kicks ≡ kicks ǫ ⊐ large rock ≡ rock Figure 4: For any example sentence pair (top left) the neural models are trained using the a weighted sum of the error on 12 prediction tasks shown above. The 12 errors are weighted to regularize the loss according to the length of the expressions being predicted on. values of {0, 1e−4, 1e−3, 1e−2} on all weights, and activation functions ReLU and tanh. Each hyperparameter setting was run for three epochs and parameters with the highest development set score were used for the complete training runs. The training datasets for this generalization task are only fair if the outputs realized at every non- leaf node are provided during training just as they are in our baseline learning model. For our neu- ral models, we accomplish this by predicting se- mantic relations for every subexpression pair in the scope of a node in the tree in Figure 3 and summing the loss of the predictions together. We do not do this for the nodes labeled PROJ → Q or PROJ → N , as the function PROJ is a bijec- tion at these nodes and no intermediate represen- tations are created. For any example sentence pair the neural models are trained using the a weighted sum of the error on 12 prediction tasks shown in Figure 4. The 12 errors are weighted to regularize the loss according to the length of the expressions being predicted on. The CompTreeNN and CompTreeNTN models are structured to create intermediate representa- tions of these 11 aligned phrases and so interme- diate predictions are implemented as in the sen- timent models of Socher et al. (2013). The other models process each of the 11 pairs of aligned phrases separately. Different softmax layers are used depending on the number of classes, but oth- erwise the networks have identical parameters for all predictions. Model Train Dev Test CBoW TreeNN LSTM encoder Attention LSTM CompTreeNN CompTreeNTN 88.04 ± 0.68 67.01 ± 12.71 98.43 ± 0.41 73.66 ± 9.97 99.65 ± 0.42 99.92 ± 0.08 54.18 ± 0.17 54.01 ± 8.40 53.14 ± 2.45 47.52 ± 0.43 80.17 ± 7.53 90.45 ± 2.48 53.99 ± 0.27 53.73 ± 8.36 52.51 ± 2.78 47.28 ± 0.95 80.21 ± 7.71 90.32 ± 2.71 Table 3: Mean accuracy of 5 runs on our difficult but fair generalization task, with standard 95% confidence intervals. These models are trained on the intermediate predictions described in Section 5. 6 Results and Analysis Table 3 summarizes our findings on the hardest of our fair generalization tasks, where the train- ing sets are minimal ones required for fairness. The four standard neural models fail the task com- pletely. The CompTreeNN and CompTreeNTN, while better, are not able to solve the task per- fectly either. However, it should be noted that the CompTreeNN outperforms our four standard neu- ral models by ≈30% and the CompTreeNTN im- proves on this by another ≈10%. This increase in performance leads us to believe there may be some other composition function that solves this task perfectly. Both the CompTreeNN and CompTreeNTN have large 95% confidence intervals, indicating that the models are volatile and sensitive to ran- dom initialization. The TreeNN also has a large 95% interval. On one of the five runs, the TreeNN achieved a test accuracy of 65.76%, much higher than usual, indicating that this model may have more potential than the other three. Figure 5, left panel, provides further insights into these results by tracking dev-set performance throughout training. It is evident here that the standard models never get traction on the prob- lem. The volatility of the CompTreeNN and CompTreeNTN is also again evident. Notably, the CompTreeNN is the only model that doesn't peak in the first four training epochs, showing steady improvement throughout training. We can also increase the number of training ex- amples so that the training data redundantly en- codes the information needed for fairness. As we do this, the learning problem becomes one of trivial memorization. Figure 5, right panel, tracks performance on this sequence of progres- sively more trivial problems. The CompTreeNN and CompTreeNTN both rapidly ascend to perfect performance. In contrast, the four standard mod- els continue to have largely undistinguished per- formance for all but the most trivial problems. Fi- nally, CBoW, while competitive with other neural models initially, falls behind in a permanent way; its inability to account for word order prevents it from even memorizing the training data. The results in Figure 5 are for models trained to predict the semantic relations for every subex- pression pair in the scope of a node in the tree in Figure 3 (as discussed in Section 5), but we also trained the models without intermediate pre- dictions to quantify their impact. All models fail on our difficult generalization task when these intermediate values are withheld. Without intermediate values this task is unfair by our standards, so this to be expected. In the hard- est generalization setting the CBoW model is the only one of the four standard models to show sta- tistically significant improvement when interme- diate predictions are made. We hypothesize that the model is learning relations between open-class lexical items, which are more easily accessible in its sentence representations. As the general- ization task approaches a memorization task, the four standard models benefit more and more from intermediate predictions. In the easiest general- ization setting, the four standard models are un- able to achieve a perfect solution without inter- mediate predictions, while the CompTreeNN and CompTreeNTN models achieve perfection with or without the intermediate values. Geiger et al. (2018) show that this is due to standard models being unable to learn the lexical relations between open class lexical items when not directly trained on them. Even with intermediate predictions, the standard models are only able to learn the base case of this recursive composition. y c a r u c c A 100 90 80 70 60 50 40 33 CompTreeNTN CompTreeNN CBoW TreeNN LSTM Encoder Attention LSTM CompTreeNN CompTreeNTN CBoW LSTM Encoder TreeNN Attention LSTM 100 90 80 70 60 50 40 y c a r u c c A 0 2M 4M 6M 8M 10M 12M # of training examples ·104 hardest easiest Difficulty Figure 5: Left: Model performance on our difficult but fair generalization task throughout training. Right: Mean accuracy of 5 runs as we move from true generalization tasks ('hardest') to problems in which the training set contains so much redundant encoding of the test set that the task is essentially one of memorization ('easiest'). Only the task-specific CompTreeNN and CompTreeNTN are able to do well on true generalization tasks. The other neural models succeed only where memorization suffices, and the CBoW model never succeeds because it does not encode word order. 7 The Problem is Architecture One might worry that these results represent a failure of model capacity. However, the system- atic errors remain even for much larger networks; the trends by epoch and final results are virtually identical with 200-dimensional rather than 100- dimensions representations. The reason these standard neural models fail to perform natural logic reasoning is their architec- ture. The CBoW, TreeNN, and LSTM Encoder models all separately bottleneck the premise and hypothesis sentences into two sentence vector em- beddings, so the only place interactions between the two sentences can occur is in the two hid- den layers before the softmax layer. However, the essence of natural logic reasoning is recursive composition up a tree structure where the premise and hypothesis are composed jointly, so this bot- tleneck proves extremely problematic. The At- tention LSTM model has an architecture that can align and combine lexical items from the premise and hypothesis, but it cannot perform this process recursively and also fails. The CompTreeNN and CompTreeNTN have this recursive tree structure encoded as hard alignments in their architecture, resulting in higher performance. Perhaps in future work, a general purpose model will be developed that can learn to perform this recursive composi- tion without a hard-coded aligned tree structure. uralistic corpus evaluations. Recent experiments with artificial and adversarial example generation have yielded valuable insights here already, but it is vital that we ensure that these evaluations are fair in the sense that they provide our mod- els with achievable, unambiguous learning targets. We must carefully and precisely navigate the bor- der between meaningful difficulty and impossibil- ity. To this end, we developed a formal notion of fairness for train/test splits. This notion of fairness allowed us to rigorously pose the question of whether specific NLI models can learn to do robust natural logic reasoning. For our standard models, the answer is no. For our task-specific models, which align premise and hy- pothesis, the answer is more nuanced; they do not achieve perfect performance on our task, but they do much better than standard models. This helps us trace the problem to the information bottleneck formed by learning separate premise and hypoth- esis representations. This bottleneck prevents the meaningful interactions between the premise and hypothesis that are at the core of inferential rea- soning with language. Our task-specific models are cumbersome for real-world tasks, but they do suggest that truly robust models of semantics will require much more compositional interaction than is typical in today's standard architectures. Acknowledgments 8 Conclusion and Future Work It is vital that we stress-test our models of seman- tics using methods that go beyond standard nat- We thank Adam Jaffe for help developing math- ematical notation and Thomas Icard for valuable discussions. This research is based in part upon work supported by the Stanford Data Science Ini- tiative and by the NSF under Grant No. BCS- 1456077. This research is based in part upon work supported by a Stanford Undergraduate Academic Research Major Grant. References Johan van Benthem. 2008. A brief history of natu- ral logic. In Logic, Navya-Nyaya and Applications: Homage to Bimal Matilal. Suchin Gururangan, Swabha Swayamdipta, Samuel 2018. Roy Levy, Smith. Schwartz, and Noah A. Omer Bowman, Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 107 -- 112. Associa- tion for Computational Linguistics. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural Comput., Long short-term memory. 9(8):1735 -- 1780. Samuel R. Bowman. 2013. Can recursive neural tensor networks learn logical reasoning? CoRR, abs/1312.6192. Thomas F. Icard and Lawrence S. Moss. 2013. Recent progress on monotonicity. Linguistic Issues in Lan- guage Technology, 9(7):1 -- 31. Samuel R. Bowman, Gabor Angeli, Christopher and Christopher D. Manning. 2015a. Potts, A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empir- ical Methods in Natural Language Processing, pages 632 -- 642, Lisbon, Portugal. Association for Computational Linguistics. Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2021 -- 2031, Copenhagen, Denmark. Association for Computational Linguistics. Christopher Potts, 2015b. Samuel Bowman, R. Christopher D. Manning. and Recursive neural networks can learn logical semantics. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositional- ity, pages 12 -- 21. Association for Computational Linguistics. Diederik P. Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. CoRR, abs/1412.6980. Brenden M. Lake and Marco Baroni. 2017. Still not systematic after all these years: On the compositional skills of sequence-to-sequence recurrent networks. CoRR, abs/1711.00350. Ishita Dasgupta, Demi Guo, Andreas Stuhlmuller, Samuel J. Gershman, and Noah D. Goodman. 2018. Evaluating compositionality in sentence embeddings. CoRR, abs/1802.04302. Jeffrey L. Elman. 1990. Finding structure in time. Cognitive Science, 14(2):179 -- 211. Richard Evans, David Saxton, David Amos, Push- meet Kohli, and Edward Grefenstette. 2018. Can neural networks understand logical entailment? CoRR, abs/1802.08535. Atticus Geiger, Ignacio Cases, Lauri Karttunen, and Christopher Potts. 2018. Stress-testing neural mod- els of natural language inference with multiply- quantified sentences. Ms., Stanford University. arXiv 1810.13033. Bill MacCartney and Christopher D. Manning. 2007. Natural logic for textual inference. In Proceedings of the ACL-PASCAL Workshop on Textual Entail- ment and Paraphrasing, RTE '07, pages 193 -- 200, Stroudsburg, PA, USA. Association for Computa- tional Linguistics. Bill MacCartney and Christopher D. Manning. 2009. An extended model of natural logic. In Proceedings of the Eight International Conference on Compu- tational Semantics, pages 140 -- 156. Association for Computational Linguistics. W. McCune. 2005 -- 2010. Prover9 and Mace4. http://www.cs.unm.edu/mccune/prover9/. Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018. Stress test evaluation for natural language inference. arXiv preprint arXiv:1806.00692. Max Glockner, Vered Shwartz, 2018. Yoav Goldberg. and Breaking nli systems with sentences that require simple lexical inferences. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 650 -- 655. Association for Computational Linguistics. Yixin Nie, Yicheng Wang, and Mohit Bansal. 2018. Analyzing compositionality-sensitivity of NLI mod- els. CoRR, abs/1811.07033. Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. 2015. Explaining and harnessing adver- sarial examples. In ICLR. Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. 2018. Hypothesis only baselines in natural language inference. In Proceedings of the Seventh Joint Conference on Lexical and Computational Semantics, pages 180 -- 191. Association for Computational Linguistics. Tim Rocktaschel, Edward Grefenstette, Karl Moritz Hermann, Tom´as Kocisk´y, and Phil Blunsom. 2015. Reasoning about entailment with neural attention. CoRR, abs/1509.06664. V.M.S. S´anchez-Valencia. 1991. Studies on Natural Logic and Categorial Grammar. Universiteit van Amsterdam. Richard Socher, Cliff Chiung-Yu Lin, Andrew Y. 2011a. and Christopher D. Manning. Ng, Parsing natural scenes and natural language with recursive neural networks. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML'11, pages 129 -- 136, USA. Omnipress. Richard Socher, Jeffrey Pennington, Eric H. Huang, Andrew Y. Ng, and Christopher D. Manning. 2011b. Semi-supervised recursive autoencoders for predicting sentiment distributions. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, EMNLP '11, pages 151 -- 161, Stroudsburg, PA, USA. Association for Computational Linguistics. Jean Wu, Richard Socher, Alex Perelygin, and Christopher Ja- son Chuang, Christopher D. Manning, An- drew Ng, 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631 -- 1642, Seattle, Washington, USA. Association for Computational Linguistics. Potts. Christian Szegedy, Wojciech Zaremba, Sutskever, Joan Ian Goodfellow, Intriguing properties of neural networks. national Conference on Learning Representations. Bruna, and Rob Dumitru Fergus. Ilya Erhan, 2014. In Inter- Masatoshi Tsuchiya. 2018. Performance impact caused by hidden bias of training data for recognizing textual entailment. CoRR, abs/1804.08117. Sara Veldhoen and Willem Zuidema. 2018. Can neural networks learn logical reasoning? In Proceedings of the Conference on Logic and Machine Learning in Natural Language (LaML 2017), pages 35 -- 41. As- sociation for Computational Linguistics. Hitomi Yanaka, Koji Mineshima, Daisuke Bekki, Ken- taro Inui, Satoshi Sekine, Lasha Abzianidze, and Jo- han Bos. 2019. HELP: A dataset for identifying shortcomings of neural models in monotonicity rea- soning. ArXiv:1904.12166. Supplementary materials for 'Posing Fair Generalization Tasks for Natural Language Inference' A Some Unfair Idealized Test Scenarios In Section 4.4, we explained that a fair NLI dataset must expose every joint projectivity signature to each semantic relation. We will now demon- strate that the difficult generalization tasks posed by Bowman (2013) and Veldhoen and Zuidema (2018) are unfair in our sense. Both use the dataset provided in Bowman (2013), which contains ex- amples with premises and hypotheses that contain a single quantifier. Bowman (2013) propose the generalization tasks SUBCLASS-OUT and PAIR-OUT. For a particular joint projectivity signature and semantic relation input, the SUBCLASS-OUT generaliza- tion task holds out all examples that expose that joint projectivity signature to that semantic rela- tion for testing. For a particular joint projectiv- ity signature, the PAIR-OUT generalization task holds out all examples containing that joint pro- jectivity signature for testing. Both of these tasks directly violate our standard of fairness by not ex- posing all joint projectivity signatures to all se- mantic relation inputs. pressions is contradiction, ∧. This demonstrates the need for a joint projectivity signature that di- rectly captures such relations. We provide a small extension to the natural logic theory of MacCartney and Manning (2009) by introducing joint projectivity signatures, which allow for new inferences involving quantifiers. The joint projectivity signature of a pair of seman- tic functions f and g is Pf /g : B → B where, if the relation between A and B is R, the relation be- tween f (A) and g(B) is Pf /g(R). It follows that the joint projectivity between a semantic function and itself is equivalent to the projectivity of that semantic function. The joint projectivity signatures between ev- ery and some are provided in Figure 6 along with the joint projectivity signatures between ε and not. We mark where the natural logic of MacCartney and Manning (2009) is extended. The remaining joint projectivity signatures be- tween the quantifiers every, some, no, and not ev- ery can be determined by composing the joint pro- jectivity signatures of every and some with the joint projectivity signatures between not and ǫ, where we parse no as not some. C Fair Data Generation Algorithm to De Morgan's and hypothesis laws There is a certain class of examples where are equivalent the premise due for quantifiers. Veldhoen and Zuidema (2018) propose a general- ization task that holds out this class of examples for testing. However, these are the only examples in which the joint projectivity signature for all and no and the joint projectivity signature for not all and some are exposed to the semantic relations ≡ and ∧. This directly violates our standard of fairness by not exposing all joint projectivity signatures to all semantic relation inputs. B Joint Projectivity : B → B where, The projectivity signature of a semantic func- tion f is Pf if the rela- tion between A and B is R, the relation between f (A) and f (B) is Pf (R). The natural logic of MacCartney and Manning (2009) only makes use of projectivity signatures, and is unable to derive De Morgan's laws for quantifiers. For example, it would label the relation between some dog eats and every dog does not eat as independence # when the true semantic relation between these ex- We now present Algorithm 3, which generates fair training data of varying difficulties by restricting the way an intermediate output is realized during training based on the outputs realized by sibling The ratio parameter determines the nodes. difficulty of the generalization task; the higher the ratio, the more permissive the training set and the easier the task. This algorithm uses a handful of helper functions. The function children(a) returns the left-to-right ordered children of node a and the function cartesian product(L) returns the Cartesian product of a tuple of sets L. The function sibling space(a, ck) re- turns the set Dom(c1) × · · · × Dom(ck−1) × Dom(ck+1) × Dom(cm) where c1, . . . , cm function are random even split(S, D, ratio) parti- tions a set S into P1 and P2 where P1 S = ratio and returns a function F : D → ℘(S) (℘ is the powerset function) that satisfies the follow the elements in the range of F are properties: non-empty, P1 is a subset of every element in the range of F , the union of every element in the range of F is S, and the elements of P2 children the of a. The Projectivity for first argument Projectivity for second argument ≡ ⊏ ⊐ ⊐ ⊐ ⊐ ⊏ ⊏ ⊏ ≡ ⊐ ⊏ # # ⌣ # ≡ ⊏ ⊐ # # # # # # # # ⊐ # ⊐ ⊏ ⊏ # ≡ ⊏ ⊐ ∧ ∧ ⌣ # ⌣ # ⌣ # # # ≡ ⊏ ⊐ ⌣ # ⌣ # ≡ ⊏ ⊐ ⌣ # ⌣ # ⌣ ⌣ ≡ ⊐ ≡ ⊏ ⊏ # ⊐ # ≡ ⊐ ⊏ ⌣ # ≡ ⊏ ⊐ ⌣ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - some/every every/some every/every some/some not/ ε ε/not not/not ε/ε Figure 6: The four joint projectivity signatures between quantifiers every and some and the four joint pro- jectivity signatures between ε and not. Boxed relations would not be computed in the natural logic of MacCartney and Manning (2009). are randomly and evenly distributed among the elements in the range of F . By our definition, a dataset is fair if it ex- poses every function to all possible local inputs. This algorithm recursively constructs a fair train- ing dataset. When ratio is set to 0 the dataset con- structed is minimal and when ratio is set to 1 the dataset is the entire space of examples. When this algorithm is called on the root node, it returns a function mapping outputs to sets of inputs and the training dataset is the union of these sets. When this algorithm is called on an interme- diate node it constructs sets of partial inputs that expose this node's function to all possible local inputs. Then these partial inputs are recursively passed to the parent node, where the process is repeated. This ensures that the function of every node is exposed to every local input by the gener- ated training data. According to the value of ratio, we constrain how local inputs are realized based on the values of their siblings. For example, the fair training dataset in Table 1 restricts how the truth value of the right argument to ⇒ is realized base on the truth value of the left argument. We experimentally verify that our training dataset is fair, though it is clearly guaranteed to be from the data generation algorithm. Data: A composition tree (T,Dom, Func) and ratio a number between 0 and 1 inclusive. Result: A training dataset D that is fair with respect to our baseline model function generate inputs (T,Dom, Func, a, ratio) if a ∈ N T leaf then equivalence classes ← Dict() for i ∈ Dom(a) do equivalence classes[i] ← {i} end return equivalence classes else c1, . . . cm ← children(a) equivalence classes ← Dict() C ← Dom(c1) × Dom(c2) · · · × Dom(cm) for (i1, i2, . . . , im) ∈ C do new class ← List() for k ← 1 . . . m do partial inputs ← generate inputs (T, Dom, Func, ck) split ← random even split (partial inputs[ik ], sibling space (a,k), ratio) new class.append(split[i1 , . . . , ik−1, ik+1, . . . , im]) end equivalence classes[Func(a)(i1, . . . , im)] ← equivalence classes[Func(a)(i1, . . . , im)] ∪ cartesian product (new class) end return equivalence classes end Algorithm 3: This model generates a training dataset that is fair with respect to our baseline model. The output of generate inputs(T, Dom, Func, a, ratio) is a function mapping elements of Dom(a) to sets of partial inputs that realize the element.
1905.08063
1
1905
2019-05-17T10:14:07
The Unexpected Unexpected and the Expected Unexpected: How People's Conception of the Unexpected is Not That Unexpected
[ "cs.CL", "cs.AI", "cs.HC" ]
The answers people give when asked to 'think of the unexpected' for everyday event scenarios appear to be more expected than unexpected. There are expected unexpected outcomes that closely adhere to the given information in a scenario, based on familiar disruptions and common plan-failures. There are also unexpected unexpected outcomes that are more inventive, that depart from given information, adding new concepts/actions. However, people seem to tend to conceive of the unexpected as the former more than the latter. Study 1 tests these proposals by analysing the object-concepts people mention in their reports of the unexpected and the agreement between their answers. Study 2 shows that object-choices are weakly influenced by recency, the order of sentences in the scenario. The implications of these results for ideas in philosophy, psychology and computing is discussed
cs.CL
cs
The Expected Unexpected & Unexpected Unexpected: How People's Conception of the Unexpected is Not Really That Unexpected Molly S. Quinn ([email protected]) Kathleen Campbell ([email protected]) Mark T. Keane ([email protected]) School of Computer Science & VistaMilk SFI Research Centre, University College Dublin, Belfield, Dublin 4, Ireland Abstract The answers people give when asked to "think of the unexpected" for everyday event scenarios appear to be more expected than unexpected. There are expected unexpected outcomes that closely adhere to the given information in a scenario, based on familiar disruptions and common plan- failures. There are also unexpected unexpected outcomes that are more inventive, that depart from given information, adding new concepts/actions. However, people seem to tend to conceive of the unexpected as the former more than the latter. Study 1 tests these proposals by analysing the object-concepts people mention in their reports of the unexpected and the agreement between their answers. Study 2 shows that object- choices are weakly influenced by recency, that is, the order of sentences in the scenario. The implications of these results for ideas in philosophy, psychology and computing are discussed. Keywords: expectation; explanation; cognitive; judgments As we know, there are known knowns; there are things that we know that we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns, the ones we don't know we don't know. Donald Rumsfeld, Feb 2002, US Secretary of Defence 1. Introduction In an uncertain and contingent world, our ability to deal with the unexpected often gives us safe passage through the Siren- like obstacles of everyday life (see e.g., Weiner, 1985a). The Cognitive Sciences have often concerned themselves with how people think about the unexpected. However, most of this research relies on theory-driven definitions of the unexpected (e.g., low probability events), rather than simply asking people to "think of the unexpected" and see how they respond1. In the present paper, we report two studies that ask people to generate unexpected events for everyday scenarios and then analyse their responses. As the title of the paper suggests, our main finding is that people's conception of the unexpected is not really that unexpected at all. In Cognitive Psychology, unexpectedness is often used as a dependent variable in studies of human thinking and decision making. For example, in reasoning research, the unexpected has often been proposed to elicit counterfactual thinking (Kahneman & Miller, 1986; McEleney & Byrne, 1 Khemlani et al.'s (2011) Expt. 3 is a notable, but rare, exception though it focusses on the issue of latent scope. 2006). In attribution research, the unexpected has been cast as non-normative behavior in others, that elicits spontaneous causal thinking (Hastie, 1984; Weiner, 1985b). And, surprising events are often defined in terms of their unexpectedness (Meyer et al., 1997; Maguire et al., 2011). However, most of these studies do not actually ask people to report unexpected outcomes; rather they adopt a priori operational definitions of unexpectedness based on the experimenter's theoretical stance. The unexpected is commonly operationalized as (i) an event rated as having a low subjective probability (Maguire et al., 2011; Teigen & Keren, 2003), or (ii) profiles of people with inconsistent traits (Hastie, 1984), or (iii) events that are simply asserted to be unexpected to the actors in a narrative (McEleney & Byrne, 2006). In contrast, we do not use a priori definitions but rather, simply, ask people to tell us what they consider the unexpected to be. This sort of behaviour was observed by Foster & Keane (2015, 2019), in studies on surprise, in the form of familiar surprises ("I am surprised my wallet is missing from my trouser pocket, but I am guessing it was robbed") and unfamiliar surprises ( "I am surprise my belt is missing from my trousers but have no idea how that could have happened"; see also Maguire & Keane, 2006). 1.1 Thinking About the Unexpected Consider the simple task used in the current experiments to elicit unexpected events from people. Imagine being told a story about a woman, called Louise, who is going shopping at her favourite clothes store, in which she draws money from an ATM and heads into town on the bus. Now imagine you are told "Something unexpected occurred. What do you think happened?" One could respond with one of the following unexpected events, saying that: 1) Louise lost the money she drew from the ATM. 2) Louise was delayed in traffic, arrived late and the shop was shut. However, one could also validly say: 3) The bus stopped at a charity bus-wash and Louise got covered in suds. 4) Louise pulled a gun on the driver and robbed him to raise more money for her shopping spree. Intuitively, as unexpected outcomes, the first two answers (1- 2) are quite conservative and mundane and less unexpected rather than the latter two responses (3-4) which are more inventive and a lot more unexpected. We call the former answers the expected unexpected and gloss the latter as the unexpected unexpected. Expected unexpected outcomes tend to maintain the original goal of the story scenario (i.e., shopping) and the stated object-concepts associated with the story's goal; these goal concepts tend to be re-used in the unexpected event (i.e., bus, ATM, money, store) and few new objects are added (e.g., traffic). Furthermore, these events are often "common failures" that are familiar to people; losing one's money or being delayed are common reasons for failed plans and goals. Unexpected unexpected outcomes, in contrast, may establish new goals for the story scenario (e.g., attending a charity event) and, though goal objects may be used (i.e., bus, money), often "new" object-concepts not present in the original story are introduced (e.g., guns, suds). Also, these unexpected events are quite unfamiliar to the scenario: getting involved in a charity bus-wash is not a common everyday event for most people who are going shopping. In previous work on surprise using these everyday scenarios (Foster & Keane, 2015), we noticed that people typically produced expected unexpected answers than unexpected unexpected ones. But, why? Why do people minimally perturb the stated scenario, keeping its goals and goal-concepts in these expected- unexpected events that they seem to prefer to generate? One possibility is that when people are thinking about the unexpected, they are essentially trying to explain how current goals might fail; so, unexpected events tend to describe disruptions to a current plan or undoings of assumed facts that enable current goals. Being delayed in traffic disrupts Louise's shopping plan, undoing the assumption that the bus gets her to the shop on time. Losing one's money is an unexpected event that explains how any shopping-goal might fail. From an adaptive perspective, it makes sense to minimally change the current situation when projecting such unexpected futures. In contrast, more creative unexpected- unexpected events, that depart significantly from the current scenario, may never occur and, therefore, seem not to be considered. In short, the former probably have higher predictive value than the latter. Across the Cognitive Sciences, many researchers have highlighted this minimalist stance in people when they encounter the unexpected. 1.2 The Minimalism of the Unexpected In Philosophy, when reasoning about inconsistencies (such as new, unexpected facts), it has been repeatedly proposed that any change to stated propositions or prior beliefs should be as minimal as possible; observing the "maxim of minimal mutilation" (Quine, 1992, p.14), or the "principle of conservativism" (Harman, 1986, p.46). Similarly, in considering counterfactual situations (of which unexpected situations could be a subclass), Lewis (1986), taking a possible-world perspective, talks of finding the maximally- similar world to the current one. 2 Note, both Leake and Schank maintain that not all situations can be handled by these pre-canned explanation-patterns; explaining the In Psychology, related ideas arise in considering the minimal-mutability of counterfactual scenarios (Kahneman & Miller, 1986). Also, in the psychology of explanation, several researchers have noted how explanations of the unexpected maintain aspects of the original scenario; they preserve the level-of-abstraction of the original scenario rather than identifying new or more specific information (see e.g., Johnson & Keil, 2014) or they favor explanations with a narrow, latent scope (Khemlani et al., 2011). In Artificial Intelligence, theories of understanding and explanation directly predict minimalism and show how the "expected unexpected" might arise (see Leake, 1991, 1992; Schank, 1986; Schank, Kass & Riesbeck, 1994). David Leake's (1992) computational account of understanding gives the most comprehensive account of what people might be doing when asked to "think of the unexpected" (see also Schank, 1986). Leake argues that people store explanation patterns to handle plan failures and anomalies encountered in everyday life. These explanation patterns can be thought of as "script-like" structures (Schank & Abelson, 1977), at varying degrees of abstraction, that can account for difficulties that arise in plans; for instance, in considering how a planned shopping-expedition might be disrupted, a number of standard disruption-events suggest themselves from pre-stored explanation patterns (e.g., that I might be mugged, or that I might lose my money or that I might be delayed). To handle a contingent world, it is proposed that we store these pre-canned explanations and retrieve them to quickly explain unexpected happenings2. Although these ideas have been referenced in the psychological literature (e.g., Hastie, 1984), they have not been worked up into a psychological model or specifically tested. Here, we propose an initial psychological account, that we then test this model in two experiments. 1.3 Minimal Retrieval Model Our psychological account for the generating unexpected events is called the Minimal Retrieval Model (MRM). According to this model, when people are asked for unexpected outcomes to everyday scenarios, they retrieve explanation patterns and adapt them to the situation in hand. Specifically, that people build a cue frame using the given information in the scenario (e.g., the goals, actors, actions and objects mentioned) for suitable explanation patterns. For example, when people are told Louise had the goal of going shopping, took money from the ATM and then went to town, it is assumed that memory is searched for explanation patterns involving shopping-goals, female-shoppers, buses, money, and ATMs. Accordingly, unexpected events such as Louise losing her money, having problems with the ATM, or being delayed will tend to be found in memory and returned as responses, rather than more inventive answers. Minimal Retrieval Model makes several predictions about the nature of the unexpected outcomes reported by people; specifically, it is predicted that (i) reported unexpected events should tend to use the stated object-concepts in the original to search memory unexpected may sometimes involve much more creative uses of prior knowledge, such as analogical explanations. scenario because memory will be cued with these concepts and the retrieved explanation patterns will instantiate these objects, (ii) goal-related objects will be preferred in reported events, over non-goal objects, (iii) people will tend to agree on the reported unexpected events because they are using familiar plan-failures (i.e., explanation patterns). Note, the first two of these predictions basically propose that minimalism is a side-effect of the retrieval process and the third prediction basically says that answers will be expected- unexpected events rather than unexpected-unexpected ones. Table 1: Louise-Shopping Story & Answer Categories Sentence Order Used in Study 1 & 2 (Normal Condition) Goal (S1) Non-Goal (S2) Louise wants to shop at an expensive clothes store. She is wearing her favourite dress and matching shoes. Louise draws money from the ATM. Goal Step (S3) Sentence Order Used in Study 2 (Reversed Condition) Goal (S1) (obviously, outcomes (excluding references to Louise who as the main actor will always tend to be mentioned). Preference for Goal Objects. Within the preference for stated objects, MRM also predicts that goal-related objects will be preferred over less goal-related objects (which we will call non-goal objects). For example, if the scenario mentions that "Louise was wearing her favorite dress and matching shoes" (see Table 1), these objects dress and shoes are less goal-critical. People need money to go shopping but what they wear is less critical to the shopping goal 3. Although, it is feasible to generate unexpected events from these non-goal objects (e.g., "when Louise got on the bus, everyone was wearing the same dress and shoes"), explanation patterns based on non-goal objects are less likely to be retrieved because they are not goal-critical. In the present studies, we check for this preference by recording the frequency of stated goals-objects versus non-goal objects in the reported unexpected outcomes excluding references to Louise who as the main actor will tend to be mentioned anyway). Agreement. By definition, explanation patterns are explanations to everyday plan-goal sequences; it makes more sense for the cognitive system to assume that disruptions that happened repeatedly in the past will happen again. As such, they should be familiar to people, they should be expected-unexpected events. Hence, there should be a high level of agreement between people in the unexpected outcomes they propose. This means that most answers should fall into a small set of common answer-categories; for instance, we should see many people using answers that describe "Louise losing her money" or "the shop being shut" (see Table 1). In the present studies, we test this prediction by classifying people's responses the proportion of answers that fall into these categories. In the remainder of this paper, we report two experiments designed to test these predictions. To the best of our knowledge, these tests are new, as are the measures used to assess what people report as the unexpected. for commonly-occurring disruptions into answer-categories and recording again, Goal Step (S2) Non-Goal (S3) Louise wants to shop at an expensive clothes store. Louise draws money from the ATM. She is wearing her favourite dress and matching shoes. Answer Categories for Unexpected Events ls_neg_ans1 ls_neg_ans2 ls_neg_ans3 ls_neg_ans4 ls_neg_ans5 ls_pos_ans1 ls_pos_ans2 ls_pos_ans3 ls_pos_ans4 ls_other She has insufficient money to buy She has problems with the ATM She is robbed or loses money/card/id. Clothes issues (dress rips, shoe snaps). The shop is closed. She finds or ATM gives more money. She has more money than she thought. Good events involving shoes and dress. Sale is on at the shop. e.g.; ATM speaks,gives money to charity. Preference for Stated Object-Concepts. If memory is being searched with the stated goals and object-concepts given in the scenario then the explanation patterns retrieved should reflect these objects/entities and minimally introduce new objects (e.g., ones that mention money, ATMs, buses). This process thus delivers unexpected events that remain close to the original scenario, with perhaps better predictive value. In Quine's terms, the reported unexpected event will minimally mutilate the original scenario. In the present studies, we measure this minimalism by recording the frequency of stated objects versus new objects in the reported unexpected 2. Study 1: How Unexpected? The study presented participants with scenarios describing everyday events such as going shopping, doing exams, going on trips and attending business meetings (adapted from Foster & Keane, 2015). Each story was followed by an instruction to think of the unexpected. The unexpected outcomes reported for each scenario were categorized by three judges in terms of object-concepts (i.e., goal-objects, non-goal-objects, both goal- and non-goal-objects and neither of the stated objects) and answer-categories used. 3 Though, obviously, it could be made goal-critical with additional conditions (e.g., if one said "she wanted to be able to match the clothes she was wearing with those in the shop"). Fig 1. Frequencies for Answer Categories in Louise Story (see Table 1 for Meaning of Answer Code) speakers native English 2.1 Method Participants & Design. The study involved 127 participants and was run on the crowdsourcing platform, prolific.com4. Participants were from Ireland/UK/USA and had not participated in previous studies by the group. Procedure & Materials. All participants received the same 20 scenarios (randomly re-ordered for each participant), after first being shown two practice materials (these items were not flagged as practice items and not included in the analysis). Participants were presented with a series of web pages, explaining the task and then presented with one scenario after the other, each on its own page. Each material was presented along with the associated instruction to think of unexpected outcomes to the scenario (material lists available on request). Each scenario was described in three sentences: a setting goal-sentence (S1; Louise going shopping), one giving additional information that was not on the critical path of the plan for the goal (S2; Louise wearing her favourite dress and shoes) and a final one describing some further action taken to achieve the goal (S3: Louise drawing money, see Table 1). Two comprehension questions were asked about the scenario, as a test micro-task, to ensure participants had carefully read and understood the scenario. The instruction to think of the unexpected followed these questions. Participants wrote their responses in a text-field with no upper limit. Measures & Judgements. In total the study yielded 2,540 responses (127 participants x 20 materials) each of which were judged by three raters (i.e., the three authors) for answer-type and the use of goal-related and non-goal-related objects (the main actor of the scenario was always excluded from this object judgement). Every response was categorized into answer categories specific to the material (e.g., in Louise scenario, answers about losing money, being delayed, the 4 The original experiment was divided into four conditions that used variants on for "something unexpected", "something good and unexpected", "something bad the main instruction: asking shop being shut). The classification of answers by the three judges revealed high levels of agreement: pairwise comparisons between judgements revealed Cohen's Kappas from K=0.82 to K=0.89. The classification of objects in the answers (as goal, non-goal, both, neither stated object) by the three judges had lower, but acceptable, levels of agreement. Agreement between Judge-1 and Judge-3 was lower (K=0.56) as object classifications were re-defined more tightly for Judge-2 and 3, who agreed more often (K=0.74). The final classifications chosen for all judgements was based on a majority vote from the three judges. Three-way splits (which were rare, N<20) were resolved by discussion. 2.2 Results & Discussion Overall, the results confirm the predictions made from the Minimal Retrieval Model; the unexpected is really not that unexpected. People tend to (i) stick to the stated objects in the scenario rather than use new objects, (ii) they show a strong preference for given goal-objects over non-goal objects, (iii) they agree on the unexpected events reported, as a few answer-categories cover most responses made. Preference for Stated Objects. As predicted, people tend to stick to the object-concepts given in the scenario (e.g., the money, buses, shoes of the Louise story), rather than introducing new objects into their answers. Of the 2,540 unexpected outcomes reported by participants, 78% (N=1891) relied on the given objects, while only 22% (N = 649) of answers mentioned none of the stated objects (i.e., "Louise met her best friend"). Most unexpected outcomes assert a new relation between the given objects (e.g., "The ATM showed Louise had more money"). Preference for Goal over Non-Goal Objects. Furthermore, of the 78% (N=1,891) of unexpected outcomes that used the given objects from the scenario, the majority used only goal- objects (80%; N=1,518) with a minority using the non-goal and unexpected", or "what would happen if the goal failed". For brevity, this manipulation is not reported here, as the same pattern of responding is seen across all these four conditions. objects (14%; N=261) and a few using both stated object- types (6%; N=112). Chi2 tests performed on frequencies of the four object-types (df=3) for each material were all statistically significant at p < 0.01. Also, a by-materials analysis, using Wilcoxen's test, revealed a statistically significant difference in the proportions of goal versus non- goal objects chosen, z = 3.00, p < .001. Of course, one could argue that this result is not surprising, as two sentences mentioned goal-objects (S1 and S3) and only one mentions non-goal objects (S2, see e.g. Table 1)5. However, even if examine goal and non-goal object choices at the sentence level, the preference for goal-objects remains: on average, goal-objects are chosen from S1 (M=27%) and S3 (M=44%) more often than the non-goal-objects from S2 (M=13%; see Table 2). Chi2 tests performed on 40 pairwise comparisons of choices, for S1xS2 and S2xS3, found that only 5 comparisons were non-significant (most are p < .001). However, it is clear that there is a preference for goal-objects from the final sentence in the scenario (S3 at 44%), suggesting a recency effect, that we explore in Study 2. Thus far, the evidence suggests that people respond in a minimalist way, sticking close to the original scenario's objects, with a strong preference for stated goal-related objects over stated non-goal objects. Agreement in Answer Categories. Apart from analysing the object-concepts used in the unexpected outcome, we also categorised responses and noted their frequency of occurrence (e.g. see Table 2 and Fig.1). On average, materials were found to involve 10 answer categories (M=10.68, SD=1.7); Min=6 (lucy_loan) and a Max=13 (robert_essay; see Table 2). Figure 1 shows a typical distribution of responses across answer-categories for the Louise story; note, the top-3 most-frequently-used answer-categories of 10 categories tend to cover most responses (63%) followed by a long tail of lower-frequencies for other categories. Note, one answer-category was used as a residual one (the other category), and it typically also has a low count. Table 2 shows the percentage of responses that fall into the top-3 most-used answer-categories for each material. In the most extreme case, lucy_loan, 89% of responses are covered by the top-3 answer-categories, with the lowest being 49% (for bill_holiday). This pattern of responding shows that there are very high levels of agreement between people with respect to the unexpected events they propose. For example, in the louise_shopping scenario, 29% of people proposed that Louise had money problems such as spending too much or not having enough money for the clothes (ls_neg_ans1), 25% proposed that she lost her money in some way (ls_neg_ans3) and 9% said that the ATM told her she had more money than she thought (ls_pos_ans2). None of these unexpected events are particularly "unexpected"; they are rather, typical disruptions that occur in everyday plans to achieve mundane 5 Also, note the sentences themselves in the original scenarios mentioned equivalent numbers of objects (by-materials, paired t- tests on the object counts in S1, S2 and S3 revealed no differences, all ps > 0.10). 6 The original experiment had 6 conditions that used (i) the three instructional variants used in Study 1 ("unexpected", "good and goals. They are expected unexpected events. Indeed, more inventive answers -- the unexpected unexpected -- are quite rare and typically found in the other category. For instance, in the Louise story, the other category (ls_other, N=8) includes responses about (i) Louise deciding to give her money to a charity instead, (ii) Louise being approached by a film director who says she is beautiful and wants to make her a star and, (iii) the wonderful "The ATM opens, and Louise realizes it is a portal to her happiest childhood memory". These sorts of answers are the unexpected unexpected, truly unusual possible outcomes but, notably, are rare too. 3. Study 2: The Recently Unexpected? Study 1 supports the minimalist predictions that people will stick closely to the original scenario, introduce few "new" objects and agree with others when proposing unexpected events for everyday scenarios. However, with respect to the object-concept analyses, the preference for goal-objects (especially, objects from the final sentence, S3) and lack-of- preference for non-goal objects could be due, in part, to a recency effect. That is, maybe people follow on from the last sentence in the story and, hence, use its goal-objects. For example, in the Louise story people do not mention her shoes and dress (the non-goal objects from S2) but rather follow on from the mention of ATMs and money (from S3) in proposing their unexpected outcome. If this were true then people's object-choices perhaps hinge less on their goal or non-goal status but more on order of mention. In this study, we put the non-goal sentence last (S3) to check if this changes the object-choices made (see Table 1 for a sample material). 3.1 Method Participants and Design. The study involved 258 participants on the prolific.com crowdsourcing platform5,6. All were native English speakers from Ireland/UK/USA and had not taken part in our previous studies. Procedure & Materials. All participants received the 20 scenarios used in Study 1, using the same procedure. There were two main conditions of interest: Normal (N = 126) and Reversed conditions (N = 132). Participants in the Normal condition received the same materials as those used in Study 1. Participants in the Reversed condition received variants of these materials, in which the non-goal sentence was moved to the last position in the story (S3; see example in Table 1). Measures & Judgements. In total the study yielded 5,160 responses (258 participants x 20 materials). Given the very large number of responses in this experiment, we automated the object-judgement process (program and data will be made available on email request). A program, called ObjJudge was developed using the NLTK, Pandas and SciPy python packages to process the answers and identify whether unexpected", "bad and unexpected"), crossed with (ii) a variant to think of "bizarre" events. Initial, analyses suggested that these variables do not impact the pattern of responding for object choices and, for brevity, are not reported here. they mentioned goal-objects, non-goal-objects, both object- types or neither. The program was trained on responses and their respective judgments from Study 1. Using lists of the object-entities (i.e.; object words given in the scenarios and synonyms provided in responses from Study 1), ObjJudge sorts the responses given in Study 2 into goal-object, non- goal object, both, or neither categories. Stated simply, this program matches object-entities in the response-string against object-lists for each material (including common synonyms that people used in Study 1 answers). With this program, we achieved a high accuracy over all materials comparing its object-judgements against the human-judgments from Study 1 (M=93%; Min=90%, Max = 97%; Cohen's Kappa was K=1). In all other respects, the object-judgement measures were as detailed in Study 1. 3.2 Results & Discussion The results replicate the findings of Study 1 that people (i) stick to the stated objects in the scenario rather than using new objects, (ii) they show a strong preference for the given goal-objects over non-goal objects. However, it also shows that here is a slight recency effect, in the Reversed condition, where the choice of non-goal objects increased by about 9% relative to the Normal condition. Preference for Stated Objects. As we saw in Study 1, people tend to stick to the object-concepts given in the scenario (e.g., the money, shoes of the Louise story), rather than introducing new objects into their answers (e.g., guns, suds). Of the 5,160 unexpected outcomes reported by participants, 79% (N=4,098) made use of objects stated in the scenario, while only 21% (N = 1,062) of answers mentioned none of the given objects Most of the unexpected outcomes reported created a new relation between the given objects (e.g., "The ATM showed Louise had more money"). Preference for Goal over Non-Goal Objects. In a similar vein, of the 4,098 (79% of 5,160) unexpected outcomes that used objects from the original scenario, the majority mentioned only goal-objects (56%; N=2,869) whereas a minority mentioned only non-goal objects (13%; N=688), with some responses mentioning both goal and non-goal objects (10%; N=541). Chi2 tests performed on frequencies of object-types reported for each material were all significant at p < 0.05 (df=3, with corrections for low-valued cells). However, these analyses collapse across the Normal- Reversed manipulation designed to test for recency. When these conditions are broken out there is a small but statistically-significant increase in the use of the non-goal objects (roughly 9%, with a corresponding reduction in goal- object choices). The following are the relative percentages, for each choice category, Chi2(3) = 76.9, p < 0.001: 10% 16% Non-Goal Goal 61% 51% Cond. Normal Reversed In short, when the sentence with the non-goal objects is last in the story, people prefer to use the non-goal objects somewhat more often; showing that they are sensitive, to some degree, to the order in which information is given, Neither 20% 21% Both 9% 12% though the dominance of goal-object choice still remains. 4. Conclusions To the best of our knowledge, the current study is the only one simply asking people to "think of the unexpected" when presented with everyday scenarios. Our view is that when people are asked to do this, they tend to recall characteristic explanation patterns that account for common disruptions to everyday plans and goals (e.g., losing a resource, being delayed in executing a plan step). Accordingly, people report unexpected events are not really that unexpected; the expected unexpected. This work shows that these are a class of unexpected events -- things that commonly go wrong -- that are to be distinguished from "truly unexpected" events (as Foster & Keane, 2015, found for surprising events). These findings should prompt a re-assessment of what we mean by the "unexpected" as a dependent variable in exploring aspects of human thought. It also raises the interesting prospect, that there is a lot more to be discovered about what people conceive the unexpected to be. Acknowledgements The first author was supported by a scholarship from the School of Computer Science, University College Dublin, Ireland. Furthermore, this publication has emanated from research conducted with the financial support of Science Foundation Ireland (SFI) and the Department of Agriculture, Food and Marine on behalf of the Government of Ireland under Grant Number 16/RC/3835. References Foster, M. I., & Keane, M. T. (2015). Why some surprises are more surprising than others: Surprise as a metacognitive sense of explanatory difficulty. Cognitive psychology, 81, 74-116. Foster, M. I., & Keane, M. T. (2019). The Role of Surprise in Learning: Different Surprising Outcomes Affect Memorability Differentially. Topics in cognitive science, 11(1), 75-87. Harman, G. (1986). Change in view: Principles of reasoning. Cambridge, MASS: The MIT Press. Hastie, R. (1984). Causes and effects of causal attribution. Journal of Personality and Social Psychology, 46(1), 44. Johnson, S. G., & Keil, F. C. (2014). Causal inference and the hierarchical structure of experience. JEP: General,, 143(6), 2223. Kahneman, D., & Miller, D. T. (1986). Norm theory: Comparing reality to its alternatives. Psychological Review, 93(2), 136-153. Khemlani, S. S., Sussman, A. B., & Oppenheimer, D. M. (2011). Harry Potter and the sorcerer's scope. Memory & Cognition, 39(3), 527-535. Leake, D. B. (1991). Goal-based explanation evaluation. Cognitive Science, 15(4), 509-545. Leake, D. B. (1992). Evaluating explanations: A content theory. Hillsdale, NJ: Erlbaum Lewis, D. K. (1986). On the plurality of worlds. Oxford: Blackwell. Maguire, R., & Keane, M. T. (2006). Surprise: Disconfirmed expectations or representation-fit. In Proceedings of the 28th Annual Conference of the Cognitive Science Society. Maguire, R., Maguire, P., & Keane, M. T. (2011). Making sense of surprise. JEP: LMC, 37(1), 176-186. McEleney, A., & Byrne, R. M. (2006). Spontaneous counterfactual thoughts and causal explanations. Thinking & Reasoning, 12(2), 235-255. Meyer, W. U., Reisenzein, R., & Schützwohl, A. (1997). Toward a process analysis of emotions: The case of surprise. Motivation and Emotion, 21(3), 251-274. Quine, W. V. O. (1992). Pursuit of truth. Cambridge, MASS: Harvard University Press. Schank, R.C. (1986). Explanation patterns. London: Psychology Press. Schank, R. C., & Abelson, R. P. (1977). Scripts, plans, goals, and understanding. Hillsdale, NJ: Lawrence Erlbaum. Schank, R. C., Kass, A., & Riesbeck, C. K. (Eds.) (1994). Inside case-based explanation. Hillsdale, NJ: Lawrence Erlbaum. Teigen, K. H., & Keren, G. (2003). Surprises: Low probabilities or high contrasts? Cognition, 87(2), 55-71. Weiner, B. (1985a). An attributional theory of achievement motivation and emotion. Psychological Review, 92, 548. Weiner, B. (1985b). "Spontaneous" causal thinking. Psychological Bulletin, 97(1), 74-84. Table 2: Percentages of Responses Made for Various Measures, by Material, in Study 1 (N=127 responses per material) Material Non-Goal % Both % Goal % S2 Obj. Obj. % % Top-3 Answer Cats. No. of Answer Cats. % Non- Goal Obj. % S3 Goal Objs Neither Obj. % S1 Goal Objs Objs alan_plane anna_interview belinda_meeting bill_holiday bob_job edith_exam john_party karen_bus mary_food katie_kitten louise_shopping lucy_loan michael_tea peter_college rebecca_swimming robert_essay sally_wine sean_call sam_driving steve_gardening 55% 74% 58% 49% 81% 50% 67% 57% 69% 50% 63% 89% 56% 56% 54% 54% 54% 65% 61% 55% 12 10 11 12 8 11 12 10 8 11 10 6 12 12 12 13 12 10 11 11 64% 71% 37% 48% 78% 44% 62% 81% 80% 91% 64% 87% 34% 59% 46% 27% 62% 61% 64% 59% 7% 6% 28% 9% 0% 20% 1% 2% 6% 1% 7% 0% 35% 2% 6% 41% 9% 10% 5% 9% 6% 9% 20% 2% 0% 11% 0% 0% 2% 7% 6% 2% 6% 1% 6% 9% 8% 6% 9% 13% 24% 15% 15% 40% 22% 25% 37% 17% 13% 1% 24% 11% 24% 38% 43% 23% 21% 24% 23% 18% 38% 33% 21% 23% 19% 31% 34% 31% 64% 16% 21% 3% 9% 37% 36% 18% 35% 31% 31% 8% 11% 12% 32% 19% 0% 20% 1% 1% 1% 11% 2% 7% 38% 3% 8% 38% 13% 9% 14% 20% 29% 43% 37% 58% 63% 33% 34% 54% 29% 66% 68% 77% 30% 27% 25% 27% 36% 44% 35% 63%
1905.13326
1
1905
2019-05-30T21:43:57
Grammar-based Neural Text-to-SQL Generation
[ "cs.CL" ]
The sequence-to-sequence paradigm employed by neural text-to-SQL models typically performs token-level decoding and does not consider generating SQL hierarchically from a grammar. Grammar-based decoding has shown significant improvements for other semantic parsing tasks, but SQL and other general programming languages have complexities not present in logical formalisms that make writing hierarchical grammars difficult. We introduce techniques to handle these complexities, showing how to construct a schema-dependent grammar with minimal over-generation. We analyze these techniques on ATIS and Spider, two challenging text-to-SQL datasets, demonstrating that they yield 14--18\% relative reductions in error.
cs.CL
cs
Grammar-based Neural Text-to-SQL Generation Kevin Lin1 Ben Bogin2 Mark Neumann 1 Jonathan Berant1,2 Matt Gardner1 1Allen Institute for Artificial Intelligence 2School of Computer Science, Tel-Aviv University {kevinl, markn, mattg}@allenai.org {ben.bogin, joberant}@cs.tau.ac.il 9 1 0 2 y a M 0 3 ] L C . s c [ 1 v 6 2 3 3 1 . 5 0 9 1 : v i X r a Abstract by neural sequence-to-sequence paradigm em- The ployed text-to-SQL models typically performs token-level decoding and does not consider generating SQL hierar- chically from a grammar. Grammar-based decoding has shown significant improvements for other semantic parsing tasks, but SQL and other general programming languages have complexities not present in logical formalisms that make writing hierarchical grammars difficult. We introduce techniques to handle these complexities, showing how to construct a schema-dependent grammar with minimal over-generation. We analyze these techniques on ATIS and SPIDER, two challenging text-to- SQL datasets, demonstrating that they yield 14 -- 18% relative reductions in error. to interfaces Introduction language 1 Natural databases (NLIDB), the task of mapping natural language utterances to SQL queries, has been of interest to both the database and natural language processing communities, as effective NLIDB would allow people of all technical backgrounds to access information stored in relational databases. Recent text-to-SQL models typically take a standard sequence-to-sequence modeling ap- proach, encoding a sequence of natural language tokens and then decoding a sequence of SQL to- kens, possibly constrained by the table schema or a SQL grammar in some way (Iyer et al., 2017; Yu et al., 2018a,b). However, work in the (closely related) semantic parsing literature has shown that hierarchical, grammar-based decoding, where the output of the model changes from a sequence of tokens to a sequence of productions rules from the grammar, is often more effective (Rabinovich et al., 2017; Krishnamurthy et al., 2017; Yin and Neubig, 2017). Applying grammar-based decoding to general programming languages such as SQL is very chal- lenging. Constructing a grammar that constrains the outputs correctly such that it cannot generate invalid programs ("over-generate") is difficult, as the abstract syntax trees (ASTs; Aho et al., 1986) used by the languages' compilers 1 are not suffi- ciently constraining. There are trade-offs between manual effort in constructing a tight grammar, the complexity and depth of the grammar, and the learnability of the grammar to a model. These languages often define typed variables (e.g., table aliases in SQL), which mean they are not context- free, requiring more complex mechanisms to han- dle and making it difficult to construct a grammar that completely removes over-generation. There are often classes or schemas that need to be respected when generating (e.g., table columns like city.city name), requiring the grammar to depend on the schema of the database be- ing queried. With SQL, this can be taken one step further, constraining (or at least encourag- ing) comparisons on table columns to be values in that column (e.g., WHERE city.city name = "New York"). In this work we develop a grammar that covers more than 98% of instances with min- imal over-generation in two popular datasets: ATIS (Hemphill et al., 1990), a dataset of con- textual interactions with a flight database, and SPIDER (Yu et al., 2018c), a dataset focused on complex SQL queries over a variety of schemas, many of which are unseen at test time. We show how to modify grammar-based semantic parsers to use this grammar, and discuss how the com- mon practice of identifier anonymization in SQL queries applies to grammar-based decoding. Inter- estingly, prior grammar-based parsers have their 1The same also applies for interpreters; we use the term compilers in this work to simplify the discussion. own linking mechanism which serves largely the same purpose as identifier anonymization, and we show that these two mechanisms are complemen- tary to each other. Finally, we note that context- sensitive grammar constraints are easily handled inside the decoder, allowing us to use a relatively simple context-free grammar and impose further constraints (e.g., on the production of joins in SQL) at run-time (both during training and infer- ence). We apply these contributions to models for ATIS and SPIDER, demonstrating the effective- ness of grammar-based decoding for text-to-SQL tasks. Our model achieves 73.7% denotation ac- curacy on the resplit, contextual ATIS task (Suhr et al., 2018), a 4.5% absolute improvement over the prior best result, and 33.8% accuracy on the database split of SPIDER, a 14.1% absolute im- provement over the best prior work with the same supervision. 2 SQL Grammar In this section we discuss several important con- siderations when designing a grammar for a gen- eral programming language like SQL, and we present the grammar that we use in our experi- ments. When doing grammar-based decoding on a pro- gramming language, one obvious potential start- ing place, which has been used repeatedly in prior work, is to directly use a compiler's grammar and the ASTs it produces (Yin and Neubig, 2017; Iyer et al., 2018). This approach, while sim- ple and intuitive, has several drawbacks. First, these grammars are written to recognize and parse presumed-valid programs, and further checking is done by the compiler after the ASTs are pro- duced. This means that using the compiler's grammar for grammar-based decoding will sig- nificantly over-generate programs, still requiring a semantic parser to learn which of the possible programs that it can produce are actually valid programs. Second, these grammars are also typ- ically very deep, with many intermediate non- terminals and unary productions that lead to very long derivations for simple programs. It is easier for a semantic parser to learn to produce shorter derivations, so a shallower grammar would be preferable. The main issue that leads a compiler's gram- mar to over-generate in a semantic parser is that Figure 1: The base SQL grammar before augmentation with schema specific and utterance specific rules. The non-terminals are shown in boxes. a programming language is not context free, while the compiler's grammar for it generally is. The context-sensitive parts of a programming language revolve around variables, their definitions, and their use. A variable can have user- or schema- defined types, which restrict the identifiers that are validly used in conjunction with it. For ex- ample, a class in python would only have a lim- ited set of member variables and functions, and a SQL identifier referring to a table in a database, such as city, only has a limited set of col- umn identifiers that can be used with it, such as city.city name. We address these issues for SQL by design- ing shallow parsing expression grammars (Ford, 2004) that capture the minimum amount of SQL necessary to cover most of the examples in a given dataset. Limiting the SQL covered to only what is necessary allows the grammar to be more com- pact, which aids the learnability of the grammar for the semantic parser. Unfortunately, this means that the grammars we write are dataset-specific, though we share a common base that needs only minimal modification for a new dataset. A simpli- fied base grammar is shown in Figure 1. 2 In order to handle the context-sensitive compo- nents of SQL, we use two approaches. First, we note that some amount of context sensitivity can be handled by adding additional non-terminals to a context-free grammar (c.f. Petrov et al. (2006)), and we use this approach to ensure consistency of table, column, and value references. Second, for 2The full grammar and code for reproducing the experi- ments are in AllenNLP (Gardner et al., 2018) flight.departure time < 1701. In or- der to handle cases like this, we additionally exam- ine the input utterance and dynamically add rules to the grammar based on values seen there. These are largely based on heuristic detection of num- bers and times in the input. This is also shown in Figure 2. Both of these mechanisms for dynamically pro- ducing production rules, either from the database schema or from the input utterance, can generate rules at test time that were never seen during train- ing. In order to handle this, we distinguish be- tween global rules that come from the base gram- mar, and linked rules that are dynamically gener- ated. These two kinds of rules will be parame- terized differently in the model (§3), so that the model can handle unseen rules at test time. Run-time Grammar Constraints: For datasets that involve joins we apply additional constraints at run-time. To start off, we keep track of two sets of tables: used tables, U, and required tables, R. When a table is SELECTed or JOINed, it is added to the set of used tables, and when a column is SELECTed, the table that it belongs to is added to a set of required tables. . First, when generating WHERE, ORDER BY, GROUP BY, and JOIN conditions, we eliminate rules that generate columns that are not from the set of used tables. Second, when predicting the last join, if there exists a table t in R not in U, we remove all rules that do not join t. Third, we constrain the number of joins using the used tables and required tables. If R − U > 1, then there must be more joins so we remove all rules that stop joins. If R−U ≤ 1, then we do not allow rules that generate more than one join, since we are assuming no self-joins. Other Considerations: Many current text-to- SQL datasets in the NLP community make liberal use of table aliases when they are not strictly nec- essary. These aliases give traditional sequence- to-sequence models some consistency when pre- dicting output tokens, but unnecessarily compli- cate the grammar in grammar-based decoding. It makes the grammar deeper, and requires the parser to keep track of additional identifiers that are hard to model. Accordingly, we simply undo the ta- ble alias normalization that has been done in these datasets before training our model, and add it back in during post-processing of our predicted queries if the dataset requires it. Table aliases are some- Figure 2: Example of additional rules added to the base SQL grammar based on database schema and entities in utterance if the entities WESTCHESTER COUNTY, DETROIT, and 1701 are detected in the utterance more complex context sensitivity, such as ensuring that joined tables in a SQL query share a common foreign key, we use runtime constraints on produc- tion rule expansion (during decoding at both train- ing and inference time) to ensure that only valid programs are allowed (c.f. Liang et al. (2017)). Adding schema non-terminals: In the base grammar, the table name and col ref non- terminals are left undefined. For each example, both during training and inference, we examine the database schema associated with that exam- ple and automatically add grammar rules for these non-terminals. All tables in the database have their names added as valid productions of the table name non-terminal, and each column in each table gets a production for the col ref non- terminal that generates the table and column name together (e.g., city.city name). We further only allow comparisons to table columns with val- ues that occur in that column. For example, in a WHERE clause, we only allow statements such as city.city name = VALUE where VALUE is actually a value in the city.city name col- umn in the database. We accomplish this by mod- ifying the biexpr non-terminal to have one pos- sible production for each table column, making use of a new non-terminal for values in that col- umn. An example of each of these kinds of rules is shown in Figure 2. Note that an compiler's gram- mar would allow arbitrary identifiers in these con- ditions; in order to properly constrain the produc- tions allowed by the semantic parser in a given context, we need to add these schema-dependent production rules. The binary comparison rule mentioned above, restricting column comparisons to only accept values in the corresponding column, is oc- If our input utterance casionally too strict. mentions "flights before 5:01pm", we want to be able to have a clause like WHERE times required in complex SQL programs, but these are very rare in current datasets, and we do not currently handle them. Linearizing a syntax tree: Given this dynami- cally generated grammar for a given example, dur- ing training we parse the input SQL into an AST. Following Krishnamurthy et al. (2017), we then linearize this tree depth-first, left-to-right, to get a sequence of production rules for the parser to learn to generate. During decoding, the grammar (along with runtime constraints) is used to con- strain the production rules available to the model at each timestep. An example query derivation in this grammar can be seen in Figure 3. SELECT FLIGHT . COST, FROM FLIGHT WHERE FLIGHT . FLIGHT TIME = (SELECT MIN(FLIGHT . FLIGHT TIME) FROM FLIGHT); (a) Gold SQL label statement −> [query, ";"] query −> ["(", "SELECT", distinct, select results, "FROM", table refs, where clause, ")"] distinct −> "" select results −> [col refs] ... (b) Gold derivation Figure 3: An example of how gold SQL queries are transformed into gold derivations for model supervi- sion. Derivations are formed from a depth-first traver- sal of the AST from the parsed statement. 3 Model To translate natural language utterances to SQL statements, we pair our grammar from Section 2 with a semantic parsing model that closely fol- lows that of Krishnamurthy et al. (2017).3 Our model takes as input an utterance, a database, and an utterance-specific grammar, and outputs a se- quence of production rules that sequentially build up an AST for a SQL program. The model distin- guishes between two kinds of production rules: (1) global rules that come from the base grammar and are shared across utterances, and (2) linked rules that are utterance-specific and might be unseen at test time. The base grammar rules typically deter- 3The main differences with prior work are in how and when we compute linking scores, and in the identifier anonymization. mine the structure of the SQL statement, while the utterance-specific rules perform linking of words in the utterance to identifiers in the database (such as table names, columns names, and column val- ues). Notation: The utterance is denoted as a se- quence of tokens [u1, . . . , un]. Identifiers in the database that may be unseen at test time, such as the name of a city or an airport code in ATIS, or table and column names in SPIDER, are denoted as e, and the whole set of identifiers is denoted as E. The production rule that generates a particular identifier is denoted as le. Identifier Linking We use simple string match- ing heuristics to link words or phrases in the input utterance to identifiers in the database.4 For example, if "Boston" appears in the utter- ance, then it should be linked to the linked rules that produce the relevant identifiers, such as city name string -> "BOSTON" and city code -> "BOS". First, we generate a linking score between the utterance token, ui and each identifier: (cid:40) s(e, ui) = 1, 0, if ui heuristically triggers e otherwise li = (cid:80) We use this linking score in both the encoder and the decoder. In the encoder, we generate a link em- bedding for each token in the utterance that rep- resents what database values it is linked to. For each linked rule that generates a database identi- fier e, we generate a type vector vτ (e) based on the non-terminal type of the identifier. This al- lows the model to handle unseen identifiers at test time. The link embedding is then computed as e∈E s(e, ui) tanh vτ (e). The decoder sec- tion describes the use of the linking in decoding. is a bi-directional LSTM (Hochreiter and Schmidhuber, 1997) that takes as input a concatenation of a learned word vector and the link embedding for each token. To incorporate the history of the interaction in ATIS, we concatenate the previous n utterances delim- ited with special tokens. The model is able to ac- cess the previous utterances but not the previous queries. Encoder: The encoder 4This heuristic string matching could easily be replaced by a learned function, and this was done in prior work that focused on WikiTableQuestions (Krishnamurthy et al., 2017), but we found that to be unnecessary for these text-to-SQL datasets. Figure 4: Overview of our type-constrained semantic-parser based on Krishnamurthy et al. (2017). The encoder links input tokens to database values and generates link embeddings which, along with word embeddings, are fed into a bidirectional LSTM. The decoder predicts a sequence of SQL grammar rules that generate a SQL query. Decoder: The decoder is an LSTM with atten- tion on the input utterance that predicts produc- tion rules from the grammar described in Section 2. At each step, the decoder iteratively builds up the SQL query by applying a grammar rule to the leftmost non-terminal in the AST. The production rules associated with any particular non-terminal could either be global rules, linked rules, or both. Global rules are parameterized with an embed- ding, and the model assigns logits to these rules using a multilayer perceptron. Linked rules are pa- rameterized using the decoder's attention over the input utterance and the linking scores mentioned earlier. At step j, the decoder computes an atten- tion aj over the input utterance and then computes i s(e, i)aji. Logits for all rules are jointly normalized with a softmax to produce a distribution over the avail- able production rules at each decoding step. We note that this parameterization of linked rules through the attention mechanism is a key differ- ence from traditional sequence-to-sequence mod- els. It is similar to a copy mechanism (Gu et al., 2016), though we are "copying" production rules that are linked to utterance tokens, not the utter- ance tokens themselves. logits for linked rules as sj(le) = (cid:80) Identifier anonymization, which has long been done in text-to-SQL models, is the process of taking database identifiers that appear in both the question and SQL query and replacing them with dummy variables, to simplify the prediction task. For example, the utterance "what flights go from boston to orlando" would be preprocessed to be "what flights go from CITY NAME 0 to CITY NAME 1". This anonymization has some of the same goals as our identifier linking -- enabling prediction of identifiers not seen during training -- but it also simplifies the encoder's vocabulary, be- cause all city names get removed from the vocab- ulary and replaced with the dummy variable. In our model, we experiment with both anonymiza- tion and linking at the same time, treating the dummy variables as linked production rules. Im- portantly, however, we do the anonymization us- ing our linking heuristics only, not looking at the SQL query, so our evaluation is equivalent to a non-anonymized setting. Training The model is given access to utter- ances paired with one or more corresponding SQL queries. The SQL queries are parsed into their derivations, which are used as supervision for the model. The model is then trained to maximize the log-likelihood of the labeled query. If there are multiple programs we train on only the one with the shortest derivation. 4 Experiments 4.1 Datasets We evaluate on two datasets, the ATIS flight plan- ning dataset (Hemphill et al., 1990) and the SPI- DER dataset (Yu et al., 2018c). ATIS: We use Suhr et al. (2018)'s data re-split to avoid scenario bias and to make use of their pre- processing to identify times with UWTime (Lee et al., 2014). The dataset consists of 1148/380/130 train/dev/test interactions. There is an average of 7 utterances per interaction. We use Suhr et al. (2018)'s model as our baseline, as it uses the same D Development Q 37.5 62.5 39.1 65.8 Test D Q 43.6 69.2 44.1 73.7 Suhr et al. (2018) Ours Table 1: Comparison of our model with the best prior work on the ATIS dataset. Q and D correspond to exact query accuracy and denotation accuracy. The main difference between the models is that ours uses grammar-based decoding while Suhr et al. (2018)'s is token-based. Yu et al. (2018b) Ours Development Test 19.7 33.8 18.9 34.8 Table 2: Comparison of our model with the best prior work on the SPIDER dataset, with the exact component matching accuracy. dataset, preprocessing, and supervision, but with token-based decoding. For evaluation, we use exact query match accu- racy and denotation accuracy. Query match accu- racy is the percentage of queries that have the same sequence of SQL tokens as the reference query. Denotation accuracy is the percentage of queries that execute to the same table as the gold query, where credit is not given to queries that do not ex- ecute. Denotation accuracy is a particularly impor- tant evaluation metric when considering SQL as a target language, as the ordering of various clauses do not affect query execution (Xu et al., 2017). SPIDER: The key difference between Spider and other text-to-SQL datasets is that databases not seen in training can appear in the test set. In the database split, databases are split randomly into 146/20/40 train/dev/test databases. To do well on the database split, the model needs to learn to com- pose various SQL operators and generalize to new schemas, as all databases will be unseen at test time. To compare with prior work, we report the exact component matching score. The predicted query is decomposed by the SELECT, WHERE, GROUP BY, ORDER BY and KEYWORDS. Each component in the predicted query and the ground truth are then decomposed into subcomponents and checked if the sets of the components match exactly. The predicted query is correct when all components match. Implementation Details 4.2 The two datasets we experiment with were de- signed to test different aspects of the text-to- SQL task, and thus we include different parts of the model in each dataset to address them. Our model for the ATIS dataset includes iden- tifier anonymization -- since this dataset is evalu- ated on execution accuracy linking tokens in the utterance to database values is extremely impor- tant. The ATIS model does not include the run- time constraints as there are no joins or table aliases in this dataset. Conversely, SPIDER already anonymizes database values but has many joins, so our model does not have identifier anonymiza- tion and database value generation but does in- clude run-time constraints. We use the sparse Adam optimizer with a learn- ing rate of 0.001 (Kingma and Ba, 2014). We use a batch size of 32 and initial patience of 10 epochs. We use accuracy on the dev set as a metric for early stopping and hyperparameter tuning. We use uniform Xavier initialization for the weights of the LSTM and zero vectors for the biases (Glorot and Bengio, 2010). The word embeddings and identi- fier type embeddings are both of size 400 are not pretrained. The encoder and decoder both contain 1 layer with hidden size 800. We apply dropout with probability of 0.5 after the encoder. During training, we train on instances with derivation less than 300 steps and during inference we limit the decoder to 300 generation steps. For incorporat- ing context on ATIS, we allow the model to see the past 3 utterance as context. During evaluation, we use beam search with a beam size of 10. 4.3 Results Table 1 shows a comparison of our model against the best prior published result on the context- dependent ATIS dataset. Our model, which in- cludes identifier linking, link embeddings and type-constraints, yields a 4.5% improvement in denotation accuracy over prior work. Table 2 shows a comparison of our model with previ- ous work on the SPIDER dataset, and shows that it yields a 14.1% increase in exact component matching compared to the best previously pub- lished result.5 5Yu et al. (2018b) also present a model that gets 27.2% accuracy, but it uses additional manual annotations. Table 2 shows what is included on the official SPIDER leaderboard. Linking Link Embedding Anon. Acc. 57.1 Yes 60.4 Yes 64.1 Yes No 60.6 65.8 Yes No Yes No Yes Yes No No Yes Yes Yes Table 3: Model ablations on ATIS, ablating the linked rules during decoding (making them global rules), the link embedding, and the identifier anonymization, showing denotation accuracy on the development set. Constrained Columns Values Acc. 55.8 No Yes 56.2 65.8 Yes No No Yes Table 4: Grammar ablations on ATIS, ablating the col- umn and value consistency constraints, showing deno- tation accuracy on the development set. 5 Discussion Table 3 presents ablations of various components of the model. In the setting without identifier anonymization, the link embedding improves de- notation accuracy by 3.3%. This is due to the fact that identifiers need to be accounted for not only to generate values, but also to generate the cor- rect query structure. Figure 5 shows that model with link embeddings is able to use the type infor- mation to generate the correct query structure and values, even for identifiers that have low frequency in the dataset. In this case, even before the model generates the linked identifier, fare basis . fare basis code = 'F', the model has to generate the correct columns in the SELECT clause and table in the FROM clause. With the link embedding, the model correctly identifies that it needs to select from the fare basis table, while the model without the link embedding in- correctly selects the class of service table. the schema- dependent grammar constraints on the ATIS dataset. We find that adding the constraint that columns appear with the table does not signifi- cantly improve performance. This could be due to the fact that the same tables are seen during train- ing and test in ATIS, so associating tables with columns is not as challenging. However, remov- Table 4 presents ablations of Alias Pre. Runtime Constraints Acc. 29.8 No 30.7 Yes 34.9 Yes No No Yes Table 5: Grammar abations on SPIDER, ablating the preprocessing for handling table aliases and run-time constraints, showing exact component accuracy on the development set. SELECT DISTINCT fare basis . fare basis code, fare basis . booking class, fare basis . class type, fare basis . premium, fare basis . economy, fare basis . discounted, fare basis . night, fare basis . season, fare basis . basis days FROM fare basis WHERE fare basis . fare basis code = 'F' ) ; (a) Model with link embeddings SELECT DISTINCT class of service . booking class, class of service . rank, class of service . class description FROM class of service WHERE class of service . booking class = 'F'; (b) Model without link embeddings Figure 5: Query generated with link embeddings 5a that matches the gold query and without link embed- ding 5b for the input utterance "what is fare code f" ing the constraint on values decreases the deno- tation accuracy by 9.6%, showing that generating the correct value in a WHERE clause is a central problem in this dataset. Table 5 shows that both table aliases and run-time constraints improve our model on for the SPIDER dataset. We also experimented with a production rule copy mechanism similar to that of Suhr et al. (2018). While copied production rules shorten the derivation and aid interpretability by showing which subtrees come from previous queries, we did not observe significant change in accuracy. One final point that highlights the complexity of constructing grammars is that the ordering of recursive rules is important. For the col refs rule in Figure 3, and similarly for JOIN clauses, switching between left or right branching can cause a several point difference in performance. Automatically determining the optimal grammar is an interesting direction for future research. 5.1 Error Analysis Since linked rules dealing with numbers and times are only added to the grammar based on the ut- terance text, the grammar will only parse a query correctly when all identifiers in the query can be detected in the utterance. By manually inspecting the preprocessed utterances and gold SQL labels for ATIS, we found that UWTime identified incor- rect dates in 27.6% of the unparseable queries. On the queries that can be parsed, our model performs substantially better, yielding 52% query match ac- curacy and 80% denotation accuracy, which sug- gests that improving datetime parsing could have a significant impact on performance. In addition, we manually examined model out- put for 70 development set queries on the ATIS dataset. We found that 70% of errors come from either linking or missing constraints. In particular, conflating references to airport tables and city ta- bles was the cause of many errors, as references to cities and airports in the utterance are particularly ambiguous, resulting in poor linking using string heuristics. The remaining 30% of errors stem from a variety of sources including difficulty in resolv- ing anaphora, ambiguity in references to time, and selecting incorrect tables. 6 Related Work Text-to-SQL: Generating SQL queries from En- glish queries has been a longstanding chal- lenge that has interested both the database and NLP communities (Androutsopoulos et al., 1995). More generally, semantic parsing into logical formalisms has been studied extensively in the NLP community (Zelle and Mooney, 1996; Zettle- moyer and Collins, 2005; Liang et al., 2011). A relevant line of work in semantic parsing has been treating the problem as a sequence genera- tion task by linearizing trees (Dong and Lapata, 2016; Alvarez-Melis and Jaakkola, 2016). Datasets: We evaluate on the SPIDER and ATIS datasets, two datasets that present challenges not present in other text-to-SQL datasets. Spider is the most difficult in terms of query complexity and requires generalizing to unseen databases at test time (Yu et al., 2018c). ATIS requires han- dling context-dependent utterances and contains a large number of tables per database. Other well studied datasets include Restaurants (Ana- Maria Popescu and Kautz, 2003), Academic (Li and Jagadish, 2014) and WikiSQL (Zhong et al., 2017). There has recently been work in stan- dardizing the many proposed text-to-SQL datasets (Finegan-Dollak et al., 2018). Grammar-based decoding: Semantic parsers that output production rules from a grammar in- stead of directly outputting tokens have been stud- ied for other formal languages such as λ-DCS and general purpose programming languages (Krish- namurthy et al., 2017; Rabinovich et al., 2017; Yin and Neubig, 2017). Grammar-based methods have been explored by Yin and Neubig (2018) for Wik- iSQL. However, as noted by Finegan-Dollak et al. (2018), WikiSQL is composed of relatively sim- ple SQL queries, with over half of the queries of the form (SELECT col AS result FROM table WHERE col = value), and can be parsed by just 4 grammar rules. The work most similar to ours is Yu et al. (2018b), which also exploits a SQL-specific grammar to constrain the output by structuring it as a set of recursive mod- ules. However, they still output tokens instead of production rules, and have a more complex set of modules in their decoder. Our method consider- ably outperforms this work. Zero-shot semantic parsing: One of the main challenges in SPIDER is handling databases at test time that were not seen during training, in a zero- shot setting. Zero-shot semantic parsing has been studied before (Herzig and Berant, 2018; Lake and Baroni, 2018), with the best method using a complex two-step processes to decouple program structure from identifiers. Our grammar-based model, with separate handling for global rules and linked rules, naturally performs this decoupling without additional complexity. 7 Conclusion We proposed a model that uses a dynamic schema- dependent SQL grammar to guide the decoding process and a deterministic entity linking module for the NLIDB task. Comparing to prior work, we show that decoding into a structured output with type constraints gives considerable improvements in performance, yielding a 4.5% absolute increase in denotation accuracy and 14.1% exact compo- nent matching over the best prior work on ATIS and SPIDER respectively. Our result suggests type information through link embedding or identifier anonymization and modeling context sensitivity is important for the task. References Alfred V Aho, Ravi Sethi, and Jeffrey D Ullman. 1986. Compilers, principles, techniques. Addison wesley, 7(8):9. David Alvarez-Melis and Tommi S Jaakkola. 2016. Tree-structured decoding with doubly-recurrent neural networks. Oren Etzioni Ana-Maria Popescu and Henry Kautz. 2003. Towards a theory of natural language inter- faces to databases. In Proceedings of the 8th Inter- national Conference on Intelligent User Interfaces, pages 149 -- 157. Ion Androutsopoulos, Graeme D Ritchie, and Peter Thanisch. 1995. Natural language interfaces to databases -- an introduction. Natural language engi- neering, 1(1):29 -- 81. Li Dong and Mirella Lapata. 2016. Language to logi- cal form with neural attention. In Proceedings of the 54th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), vol- ume 1, pages 33 -- 43. Catherine Finegan-Dollak, Jonathan K. Kummerfeld, Xiang Lin, Karthik Ramanathan, Sesh Sadasivam, Rui Zhang, and Dragomir R. Radev. 2018. Improv- ing text-to-sql evaluation methodology. In ACL. Bryan Ford. 2004. Parsing expression grammars: a In ACM recognition-based syntactic foundation. SIGPLAN Notices, volume 39, pages 111 -- 122. ACM. Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson Liu, Matthew Pe- ters, Michael Schmitz, and Luke Zettlemoyer. 2018. Allennlp: A deep semantic natural language pro- cessing platform. arXiv preprint arXiv:1803.07640. Xavier Glorot and Yoshua Bengio. 2010. Understand- ing the difficulty of training deep feedforward neu- In Proceedings of the thirteenth in- ral networks. ternational conference on artificial intelligence and statistics, pages 249 -- 256. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. 2016. Incorporating copying mech- anism in sequence-to-sequence learning. CoRR, abs/1603.06393. Charles T Hemphill, John J Godfrey, and George R Doddington. 1990. The atis spoken language sys- tems pilot corpus. In Speech and Natural Language: Proceedings of a Workshop Held at Hidden Valley, Pennsylvania, June 24-27, 1990. Jonathan Herzig and Jonathan Berant. 2018. Decou- pling structure and lexicon for zero-shot semantic parsing. In EMNLP. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural computation, Long short-term memory. 9(8):1735 -- 1780. Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke S. Zettlemoyer. 2017. Learning a neural semantic parser from user feed- back. In ACL. Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke S. Zettlemoyer. 2018. Mapping language to code in programmatic context. In EMNLP. Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. Proceedings of the International Conference on Learning Represen- tations. Jayant Krishnamurthy, Pradeep Dasigi, and Matt Gard- ner. 2017. Neural semantic parsing with type con- straints for semi-structured tables. In Proceedings of the 2017 Conference on Empirical Methods in Nat- ural Language Processing, pages 1516 -- 1526. Brenden M. Lake and Marco Baroni. 2018. General- ization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In ICML. Kenton Lee, Yoav Artzi, Jesse Dodge, and Luke S. Zettlemoyer. 2014. Context-dependent semantic parsing for time expressions. In ACL. Fei Li and H. V. Jagadish. 2014. Constructing an interactive natural language interface for relational databases. Proceedings of the VLDB Endowment, 8(1):73 -- 84. Chen Liang, Jonathan Berant, Quoc Le, Kenneth D. Forbus, and Ni Lao. 2017. Neural symbolic ma- chines: Learning semantic parsers on freebase with weak supervision. In ACL. Percy S. Liang, Michael I. Jordan, and Dan Klein. 2011. Learning dependency-based compositional semantics. Computational Linguistics, 39:389 -- 446. Slav Petrov, Leon Barrett, Romain Thibaux, and Dan Klein. 2006. Learning accurate, compact, and inter- pretable tree annotation. In ACL. Maxim Rabinovich, Mitchell Stern, and Dan Klein. 2017. Abstract syntax networks for code genera- In Proceedings of the tion and semantic parsing. 55th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), vol- ume 1, pages 1139 -- 1149. Alane Suhr, Srinivasan Iyer, and Yoav Artzi. 2018. Learning to map context-dependent sentences to ex- ecutable formal queries. In NAACL-HLT. Xiaojun Xu, Chang Liu, and Dawn Song. 2017. Sqlnet: Generating structured queries from natural language arXiv preprint without reinforcement arXiv:1711.04436. learning. Pengcheng Yin and Graham Neubig. 2017. A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 440 -- 450. Pengcheng Yin and Graham Neubig. 2018. Tranx: A transition-based neural abstract syntax parser for se- mantic parsing and code generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstra- tions, pages 7 -- 12. Tao Yu, Zifan Li, Zilin Zhang, Rui Zhang, and Typesql: Knowledge- text-to-sql generation. Dragomir Radev. 2018a. based type-aware neural arXiv preprint arXiv:1804.09769. Tao Yu, Michihiro Yasunaga, Kai Yang, Rui Zhang, Dongxu Wang, Zifan Li, and Dragomir Radev. 2018b. Syntaxsqlnet: Syntax tree networks for com- plex and cross-domain text-to-sql task. In Proceed- ings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1653 -- 1663. Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingn- ing Yao, Shanelle Roman, et al. 2018c. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. arXiv preprint arXiv:1809.08887. John M. Zelle and Raymond J. Mooney. 1996. Learn- ing to parse database queries using inductive logic programming. In Proceedings of the Thirteenth Na- tional Conference on Artificial Intelligence - Volume 2, pages 1050 -- 1055. Luke S Zettlemoyer and Michael Collins. 2005. Learn- ing to map sentences to logical form: structured classification with probabilistic categorial gram- In Proceedings of the Twenty-First Confer- mars. ence on Uncertainty in Artificial Intelligence, pages 658 -- 666. AUAI Press. Victor Zhong, Caiming Xiong, and Richard Socher. 2017. Seq2sql: Generating structured queries from natural language using reinforcement learning. CoRR, abs/1709.00103.
1802.08614
1
1802
2018-02-23T15:56:07
Visualizing the Flow of Discourse with a Concept Ontology
[ "cs.CL", "cs.AI", "cs.IR" ]
Understanding and visualizing human discourse has long being a challenging task. Although recent work on argument mining have shown success in classifying the role of various sentences, the task of recognizing concepts and understanding the ways in which they are discussed remains challenging. Given an email thread or a transcript of a group discussion, our task is to extract the relevant concepts and understand how they are referenced and re-referenced throughout the discussion. In the present work, we present a preliminary approach for extracting and visualizing group discourse by adapting Wikipedia's category hierarchy to be an external concept ontology. From a user study, we found that our method achieved better results than 4 strong alternative approaches, and we illustrate our visualization method based on the extracted discourse flows.
cs.CL
cs
VisualizingtheFlowofDiscoursewithaConceptOntologyBaoxuShiUniversityofNotreDamebshi@nd.eduTimWeningerUniversityofNotreDametweninge@nd.eduABSTRACTUnderstandingandvisualizinghumandiscoursehaslongbeingachallengingtask.Althoughrecentworkonargumentmininghaveshownsuccessinclassifyingtheroleofvarioussentences,thetaskofrecognizingconceptsandunderstandingthewaysinwhichtheyarediscussedremainschallenging.Givenanemailthreadoratranscriptofagroupdiscussion,ourtaskistoextracttherelevantconceptsandunderstandhowtheyarereferencedandre-referencedthrough-outthediscussion.Inthepresentwork,wepresentapreliminaryapproachforextractingandvisualizinggroupdiscoursebyadaptingWikipedia'scategoryhierarchytobeanexternalconceptontology.Fromauserstudy,wefoundthatourmethodachievedbetterresultsthan4strongalternativeapproaches,andweillustrateourvisualiza-tionmethodbasedontheextracteddiscourseflows.ACMReferenceFormat:BaoxuShiandTimWeninger.2018.VisualizingtheFlowofDiscoursewithaConceptOntology.InThe2018WebConferenceCompanion,April23–27,2018,Lyon,France.ACM,NewYork,NY,USA,2pages.https://doi.org/10.1145/3184558.31869431INTRODUCTIONLanguagehaslongbeenoneofthemostefficientformsofcom-municationbetweenpeople.Technologythatcanparseandextractinformationfromtheseconversationscurrentlyexistsandoperateswithreasonableaccuracy;however,thereisagapinourabilitytounderstandandvisualizetheseconversationalstatements.Cur-rentandpreviousworkintheanalysisofnewsarticlesandsocialpostshavedemonstratedtheabilitytoextractandquantifywrittenideas[1,2,5];however,thesetoolsoperateoverlargetextornewscorpora,sotheyarenotabletodiscoverconceptflowsofindividualconversations(ordocuments).Relatedworkinapplication-orientednaturallanguageprocessingaimstoextractnamedentitiesorimpor-tantconceptsandentitiesfromsentences.AlthoughNamedEntityRecognitionmaybeabletoextracthigh-qualityentities,whichcouldbeviewedasconcepts,theyareusuallylimitedtoafewentitytypes.Thegoalofthepresentworkisdifferent.Herewetransformagroupconversationintoanetworkoverconceptsinordertovisualizetheconceptflowssothatwemightbetterunderstandthelatentcom-municationpatternsandgroupdynamics.Ourkeyinsightistotreathumangroupconversationsastrailsoveragraphofconcepts.Withthisperspective,anindividual'sideasasexpressedthroughlanguagecanbemappedtoexplicitentitiesorconcepts,and,therefore,asingleargumentcanbetreatedasapathoverthegraphofconcepts.ThispaperispublishedundertheCreativeCommonsAttribution4.0International(CCBY4.0)license.AuthorsreservetheirrightstodisseminatetheworkontheirpersonalandcorporateWebsiteswiththeappropriateattribution.WWW'18Companion,April23–27,2018,Lyon,France©2018IW3C2(InternationalWorldWideWebConferenceCommittee),publishedunderCreativeCommonsCCBY4.0License.ACMISBN978-1-4503-5640-4/18/04.https://doi.org/10.1145/3184558.3186943Weovercomethelimitationsmentionedabovebydistillingahigh-qualityconceptontologyfromWikipediaandusingitsentitysurfaceformstodetectconceptsinhumandiscourse.Wethenfindconceptflowsbycomputingsentencesimilaritiesusingajointtextandconceptsimilarity.Thecodeanddataareavailableathttps://github.com/bxshi/DiscourseVisualization.2DISCOURSEGRAPHIFICATIONInthepresentwork,weassumeeachWikipediaarticlerepresentsauniqueconceptandfurthertreatthecategoriesthatanarticlebelongstoasmoregeneralconcepts.ThissolutionassumesthattheWikipediacategoryhierarchyisacleanontology.Thisisnotthecase.Sothefirststepistoperformsomepre-processingtotransformtheWikipediacategoryhierarchyintoausefulontology.WeusetheOctober2017EnglishdumpofallWikipediaarticlesandcategories.Webeginbyremovingallmaintenance,tracking,chronologicalandlist-likepagessuchasArticlestobesplitand1880deaths,etc.Thisresultsinagraphrootedatthecategory-pageMainTopicClassificationswith976,163categorynodes,1,901,706fine-to-coarseconceptedges,and11,967,618uniqueleaf-conceptscorrespondingtoWikipediaarticles.Eacharticlebe-longsto4.75categoriesonaverage(mean).AsnippetofthisconceptontologyisillustratedinFig.1.Thenextstepistoextractconceptsfromtranscriptsofgroupconversationsandlinkthesentencestoformconceptflowsovertheontology.Toextractconceptsfromthediscoursetext,wesimplymatchthesurfaceformsofconceptsEifromtheithsentenceSiwithinintranscriptDagainsttheWikipediaarticletitles(leavesintheWikipediaconceptontology).Becauseeachconcept-leafisassociatedwithoneormoreparentandancestorconcepts,wesayMain TopicClassificationsFood and DrugAdministration (FDA)SocietyHealthPoliticsScience &TechnologyHealthcareindustryPharmacyDrugsMarketingProductionEconomicsDrugpricingNational agenciesfor drug regulationCostsPublicadministrationTherapyHealthpolicyBusinessInnovationSocial EventsGovernmentHealthcareHealtheconomicsScience &Technology StudiesEconomyCompetition(economics)PharmaceuticalspolicyPharmaceuticalsindustryPricingCompetitionEconomicsof regulationPharmacologyBusinessEconomicsInnovationEconomics012345678depthFigure1:Illustrationofasnippetoftheconceptgraph.BoldtextsareextractedconceptsrecognizedasimportantintheIntelligence2debatereferencedinFig.2. Sentenceif you think of how many times you've taken antibiotics, casually saving yourself from death by infection.if you think about vaccines and the way they have shielded you against deadly and disabling disease, if you think about the fact that hiv infection is no longer a death sentence,some patients, particularly those with serious chronic illnesses, are paying too much out of pocket for their medicines, and we need to find a solution for thatbut we don't want those drug prices of $150,000 per year to take those drugsit took a disease that was a chronic disease – but blasted off and killed people in six months and basically made people live a very long time with the disease.there are multiple drugs out there on the market that are about $150,000 per year, don't cure anyone, ameliorate the disease, but are hugely expensive.today, it's chronic disease and treating patients with chronic disease that are responsible for 90 percent of all healthcare costs.the problem is we have these super high drug prices, 150,000, $300,000 drugs that don't cure anyone, and they're still exorbitantly expensive.micromanage who gets what price and who can do what, and that is one of the biggest things standing in front of us, especially the fda's drug regulations that make it so difficult to innovate and so expensive to innovate.and if we change pricing without changing how we innovate, all we're going to wind up is with fewer drugs and a drug that you don't have for a serious disease is infinitely expensive because you can't buy it.we're here to debate drug pricing and drugs outrageously high prices.SpeakerJ. DonvanJ. DonvanP. HowardE. EmanuelE. EmanuelE. EmanuelL. ReillyE. EmanuelP. HowardP. HowardE. EmanuelSeqA1A2B1C1B2C2B3C3C4C5C6↑DebateSnippetConversationDiagram↓C5C6price, innovate drug regulations, fda, expensiveC4C1C3C2drug,drug price,$150,000drug, $150,000cure, diseaseexpensivedrug price, $150,000cure, expensivepricing, innovate,druge, expensive,diseasedrug pricing,drugs, pricesFigure2:ApartialexampleoftheIntelligenceSquaredde-bateBlameBigPharmaforOut-of-ControlHealthCareCosts.Sentencesarecolor-codedbyspeakerandhaveassignedlabels.BoldtextsareextractedconceptsshowninFig.1.Atbottomisaflowdiagramoverconceptsmentionedduringthedebate.thateachsentenceisassociatedwithaconcepttreeasaninducedsubgraphCifromtheconceptontology.Nextweneedtolinkconceptsacrosssentencesinthediscourse.Thisrequiressomenotionofconceptsimilarity.Therearemanywaystodothis.WeinitiallytriedtoadapttheJaccardcoefficient,butthisdidnotworkwellbecauseitfailstoconsidertheconceptgranularityandinsteadtreatsallconcepts,regardlesstheirpositionintheontology,equally.Toproperlyweighttheconcepts,weapplyTF-IDFweightingtotheextractedconceptsbytreatingthemas"words"andthesentencesas"documents".WefurtherdefinetheconceptfeaturevectorVioftheithsentenceasVi=(I(ck∈Ci)× 1+logNNj=1I(ck∈Cj)!(cid:12)(cid:12)(cid:12)(cid:12)k∈{1...m}),(1)inwhichmandNarethetotalnumberofconceptsandsentencesrespectively.WecangetthewordfeaturevectorUiusingthesamemethod.Puttingthesetogether,wenowdefinethesentencesimilarityasthecombinationofthewordandconceptcosinesimilarities:sim(Si,Sj)=θ(Vi,Vj)+θ(Ui,Uj).(2)UsingEq.2wecannowconstructconceptflowsbylinkingsimilarsentencestogetherandhighlightingimportantwordsandconceptsinthesentences.ForeachsentenceSi∈D,wefindthemostsimilarsentenceSjinwhichi<jandillustratetheconceptrelationshipsusingaconceptnetworkasshowninFig.2.3EXPERIMENTSWeperformedauserstudytoevaluatehowwellthismodelcapturessentence-levelsemanticsimilarities.WecomparedourmodelwiththeresultsofTopicFlow(LDA)[3],wordoverlapbaseline,averagedsentenceembeddingsfromGloVe[4],andatext-onlyversionofourmodelusingonlyθ(Ui,Uj)fromEq.2.Ourdatasetconsistedoffourdebatesfromintelligence2coveringPolitics,Health,ScienceandEconomics.Werandomlyselected20sentencesfromeachdebateandusedthemethodsmentionedabovetofindthemostsimilarsentenceforeachselectedsentence.Thenforeachsentencepair,weasked10humanannotatorstorankthesimilarityona0to4LikertScale.TheresultsareinFig.3with95%confidenceintervals.LDAWordGloVeTF-IDFConcept0.811.21.41.61.8ModelsAnnotatedScoreFigure3:Annotatedsentencesemanticsimilarityscores.Itisclearthattheproposedmethod(ConceptinFig.3)canfindmorecoherentsentencepairscomparedtoothermethods.Webelievethisisbecauseconcept-basedmatchingsystemcanbetterdistinguishconcept-levelsimilarity.Forexample,TF-IDFreturnsSowhatiswrongwiththatargument?asthemostsimilarsentencetoSo,whatiswrongwiththeFDA...,whichignoresthewordFDA,whereasourmodelreturnsLook,theFDAisthebiggestbarrierhere.instead.LDAperformspoorlybecausethecorpussizeislimited.Anotherinterestingfindingisthataveragedwordembeddingsperformthesameasthesimplewordoverlapbaseline.4CONCLUSIONSInthiswork,wereleaseaWikipedia-basedconceptontologynet-workanddescribeamethodtofindsemanticallysimilarsentences.Wefurtherpresentapreliminaryvisualizationusingtheproposedmethodtodiscoverconceptflowsindebates.Asforfuturework,wewillemployentitydisambiguationintothismodeltoimprovetheentitydetectionaccuracy,createaninteractivevisualizationtool,andinvestigatehowtomodelconceptshiftsindiscourse.5ACKNOWLEDGEMENTThisworkissponsoredbytheArmyResearchOfficeundercontractW911NF-17-1-0448.REFERENCES[1]MauroDragoni,CéliaDaCostaPereira,AndreaGBTettamanzi,andSerenaVillata.2016.Smack:Anargumentationframeworkforopinionmining.InInternationalJointConferenceonArtificialIntelligence(IJCAI).IJCAI/AAAIPress,4242–4243.[2]VinodhKrishnanandJacobEisenstein.2016.NonparametricBayesianStorylineDetectionfromMicrotexts.InEMNLPWorkshoponComputingNewsStorylines.[3]SanaMalik,AlisonSmith,TimothyHawes,PanagisPapadatos,JianyuLi,CodyDunne,andBenShneiderman.2013.TopicFlow:visualizingtopicalignmentoftwitterdataovertime.InASONAM.ACM,720–726.[4]JeffreyPennington,RichardSocher,andChristopherManning.2014.GloVe:Globalvectorsforwordrepresentation.InEMNLP.1532–1543.[5]DafnaShahaf,CarlosGuestrin,andEricHorvitz.2012.Trainsofthought:Generat-inginformationmaps.InWWW.ACM,899–908.
1812.06081
1
1812
2018-12-14T18:59:41
A Neural Multi-Task Learning Framework to Jointly Model Medical Named Entity Recognition and Normalization
[ "cs.CL", "cs.IR" ]
State-of-the-art studies have demonstrated the superiority of joint modelling over pipeline implementation for medical named entity recognition and normalization due to the mutual benefits between the two processes. To exploit these benefits in a more sophisticated way, we propose a novel deep neural multi-task learning framework with explicit feedback strategies to jointly model recognition and normalization. On one hand, our method benefits from the general representations of both tasks provided by multi-task learning. On the other hand, our method successfully converts hierarchical tasks into a parallel multi-task setting while maintaining the mutual supports between tasks. Both of these aspects improve the model performance. Experimental results demonstrate that our method performs significantly better than state-of-the-art approaches on two publicly available medical literature datasets.
cs.CL
cs
A Neural Multi-Task Learning Framework to Jointly Model Medical Named Entity Recognition and Normalization Sendong Zhao∗, Ting Liu‡, Sicheng Zhao†, Fei Wang∗ ∗ Weill Cornell Medical College, Cornell University, USA † Department of Electrical Engineering and Computer Sciences, University of California Berkeley, USA ‡ Research Center for Social Computing and Information Retrieval, Harbin Institute of Technology, China {sez4001,few2001}@med.cornell.edu, [email protected], [email protected] 8 1 0 2 c e D 4 1 ] L C . s c [ 1 v 1 8 0 6 0 . 2 1 8 1 : v i X r a Abstract State-of-the-art studies have demonstrated the superiority of joint modeling over pipeline implementation for medical named entity recognition and normalization due to the mutual benefits between the two processes. To exploit these benefits in a more sophisticated way, we propose a novel deep neural multi-task learning framework with explicit feedback strate- gies to jointly model recognition and normalization. On one hand, our method benefits from the general representations of both tasks provided by multi-task learning. On the other hand, our method successfully converts hierarchical tasks into a parallel multi-task setting while maintaining the mutual supports between tasks. Both of these aspects improve the model performance. Experimental results demonstrate that our method performs significantly better than state-of-the- art approaches on two publicly available medical literature datasets. Introduction Due to the large amount of electronically-available medical publications stored in databases such as PubMed, there has been an increasing interest in applying text mining and infor- mation extraction to the medical literature. Those techniques can generate tremendous benefits for both medical research and applications. Among the medical literature mining tasks, medical named entity recognition and normalization are the most fundamental tasks. The goal of medical named entity recognition and nor- malization is to find the boundaries of mentioning from the medical text and map them onto a controlled vocabulary. State-of-the-art studies have demonstrated the superiority of joint modeling of medical named entity recognition and normalization compared to the pipeline implementation due to mutual benefits between them. There are two main lim- itations of pipeline models: (1) errors from the recognition tagging cascade into normalization errors, and (2) recogni- tion and normalization are mutually useful to each other, but pipeline models cannot utilize these potential benefits. Joint modeling recognition and normalization can naturally alleviate these limitations and achieve better performance. For example, Leaman and Lu (2016) leveraged a joint scoring function for medical named entity recognition and Copyright c(cid:13) 2019, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. normalization. Lou et al. (2017) proposed a transition-based model to jointly perform medical named entity recognition and normalization, casting the output construction process into an incremental state transition process. However, these existing joint modeling methods (1) rely heavily on hand- crafted features and task specific resources thus fail to encode complicated and general features such as character- level and semantic-level features; (2) use simplistic ways to jointly model medical named entity recognition and nor- malization, which cannot provide essential mutual supports between these two. To improve the joint modeling medical named entity recognition and normalization (MER and MEN), we pro- pose a novel deep neural multi-task learning (MTL) frame- work with two explicit feedback strategies, which can make use of the mutual benefits between recognition and normal- ization in a more advanced and intelligent way. First, our method benefits from general representations of both tasks provided by multi-task learning, which enjoys a regulariza- tion effect (Collobert et al. 2011; Ruder 2017) that leads to more general representations to help both tasks. Specifically, it minimizes over-fitting to any specific tasks, thus makes the learned representations universal across tasks. Second, our method can successfully convert hierarchical tasks into a parallel multi-task setting while maintaining mutual sup- ports between tasks. Although the general concept of deep neural multi-task learning is not new, the innovation of our method is that it incorporates both the feedback strategies from the low-level task to the high-level task and vice versa, as shown in Figure 1. These two feedback strategies exploit the output of entity recognition to improve entity normalization and vice versa. In addition, our method uses Bi-LSTM to boost the sequential modeling of text and CNN to encode clues hidden in character-level features such as Zolmitriptan, Zomig and Zomigon. We evaluate our models across two corpora (the BioCre- ative V Chemical Disease Relation (BC5CDR) task corpus (Li et al. 2016) and the NCBI Disease corpus (Doan, Leaman, and Lu 2014)) of medical articles and outperform the state-of-the-art study by up to 4.53% F1 on medical named entity recognition and 5.61% F1 on medical named entity normalization. Contribution. To make use of the mutual benefits in a more sophisticated way, we propose a novel deep neural multi- all the tasks. It has been used successfully across many tasks of NLP (Collobert et al. 2011). In the context of deep learning for NLP, the most notable work was proposed by Collobert and Weston (2008), which aims at solving multiple NLP tasks within one framework by sharing com- mon word embeddings. In recent years, the idea of neural deep multi-task learning becomes popular to sequence-to- sequence problems with LSTM (Dong et al. 2015; Luong et al. 2016; Liu et al. 2016; Augenstein and Søgaard 2017). There are also a few studies which make use of multi-task learning for biomedical named entity recognition, such as cross-type biomedical named entity recognition (Wang et al. 2018) and multiple independent tasks modeling with MER involved (Crichton et al. 2017). Problem Definition This section gives formal definitions of the two tasks to be investigated: MER and MEN. Medical Named Entity Recognition The medical named entity recognition (MER) task is to find the boundaries of mentions from medical text. It differs from general NER in several ways. A large number of synonyms and alternate spellings of an entity cause explosion of word vocabulary sizes and reduce the efficiency of dictionary of medicine. Entities often consist of long sequences of tokens, making harder to detect boundaries exactly. It is very common to refer to entities also by abbreviations, some- times non-standard and defined inside the text. Polysemy or ambiguity is pronounced: proteins (normally class GENE) are also chemical components and depending on the context occasionally should be classified as class CHEMICAL; tokens that are sometimes of class SPECIES can be part of a longer entity of class DISEASE referring to the disease caused by the organism or the specialization of disease on the patient species. In this work, we follow the setup of the shared subtasks of BioCreative (Wei et al. 2015). Given a sentence s, i.e., a word sequence w1, ..., wn, each word is annotated with a predicated MER tag (e.g., "B-DISEASE"). Therefore, we consider MER as a sequence-labeling task. Medical Named Entity Normalization Medical named entity normalization (MEN) is to map ob- tained medical named entities into a controlled vocabulary. It is usually considered as a follow-up task of MER because MEN is usually conducted on the output of MER. In other words, MER and MEN are usually considered as hierarchi- cal tasks in previous studies. In this paper, we consider MEN and MER as parallel tasks. MEN takes the same input with MER and have different output, i.e., for each word sequence w1, ..., wn, MEN outputs a sequence of tags from a different tag set. Therefore, we also consider MEN as a sequence- labeling task with the same input with MER. MER and MEN are not independent. MER and MEN are essentially hierarchical tasks but their outputs potentially have mutual enhancement effects for each other. Specifi- cally, the output of MER, such as "B-DISEASE", is a clear signal indicating the beginning of a disease entity, making Figure 1: From hierarchical tasks to parallel multi-task mode by incorporating explicit feedback strategies among tasks. task learning framework with explicit feedback strategies to jointly model named medical entity recognition and normalization. This method incorporates both the feedback strategies from the low-level task to the high-level task and vice versa, which makes it possible to convert hierarchical tasks, i.e. MER and MEN, into parallel multi-task mode while maintaining mutual supports between tasks. Related Work MER and MEN. Several existing studies typically run a medical named entity recognition model to extract entity names first, then run a medical named entity normalization model to link extracted names to a controlled vocabu- lary (Doan and Xu 2010; Sahu and Anand 2016). Such decoupled approaches used pipeline models to implement MER and MEN separately, leading to errors cascade and absence of mutual benefits. There has been a line of research on joint modeling MER and MEN, which has demonstrated the superiority over pipeline implementation. For example, semi-CRF has been used for joint entity recognition and disambiguation (Luo et al. 2015). Leaman and Lu (2016) leverage a joint scoring function for MER and MEN. Lea- man, Wei, and Lu (2015) developed a chemical named entity recognizer and normalizer created by combining two inde- pendent machine learning models in an ensemble. Lou et al. (2017) propose a transition-based model to jointly perform disease named entity recognition and normalization. (Klein et approaches Methodology of NER. Traditional to NER include handcrafted features for Maximum Entropy models (Curran and Clark 2003), Conditional Random Fields (McCallum and Li 2003), and Hidden Markov Models al. 2003). State-of-the-art neural NER techniques use a combination of pre-trained word embeddings and character embeddings derived from a convolutional neural network (CNN) layer or bidirectional long short-term memory (Bi-LSTM) layer. These features are passed to a Bi-LSTM layer, which may be followed by a CRF layer (Lample et al. 2016; Ma and Hovy 2016; Chiu and Nichols 2016). Strubell et al. (2017) proposed a faster alternative to Bi-LSTMs for NER: Iterated Dilated Convolutional Neural Networks (ID-CNNs), which have better capacity than traditional CNNs for large context and structured prediction. Neural Multi-Task Learning. Multi-Task Learning is a learning paradigm in machine learning and its aim is to leverage useful information contained in multiple related tasks to help improve the generalization performance of MERMENMERMENShared RepresentationParallel Multi-task Mode with Explicit FeedbackHierarchical Tasks MEN to map the code of a disease. Conversely, the output of MEN, such as "D054549-P" which is a disease code tag, is very helpful to recognize it as a part of a disease named entity. Our Method Medical named entity recognition and normalization (MER and MEN) are hierarchical tasks and their outputs poten- tially have mutual benefits for each other as well. Specif- ically, the output of MER, such as "B-DISEASE", is a clear signal indicating the beginning of a disease entity, leading to reducing the searching space of MEN and vice versa. Therefore, we propose to incorporate two explicit feedback strategies into multi-task learning framework to model mutual enhancement effects between tasks 1. In addition, we exploit Bi-LSTM to power the sequential modeling of the text and CNN to encode clues hidden in character-level features such as Zolmitriptan, Zomig and Zomigon. Notation. We use x1:n to denote a sequence of n vectors x1, ..., xn. Fθ(·) is a Bi-LSTM parameterized with param- eters θ. We use FL(·) as a forward LSTM and FR(·) as a backward LSTM with specific sets of parameters θL and θR. M ER(w1:n, i) is the function to represent medical named entity recognition taking word sequence w1:n and index i as input and output the corresponding named entity tag yi M ER. M EN (w1:n, i) is the function to represent medical named entity normalization taking word sequence w1:n and index i as input and output the corresponding controlled vocabulary M EN . We use ◦ to denote a vector concatenation tag yi operation. U and V are matrices to map the feedback of one task to the other. In this paper, we denote scalars by lowercase letters, such as x; vectors by boldface lowercase letters, such as x; and matrices by boldface uppercase letters, such as X. CNN for Character-level Representation Previous studies (Chiu and Nichols 2016) have shown that CNN is an effective approach to extract morphological information (like the prefix or suffix of a word) from char- acters of words and encode it into neural representations. Figure 2 shows the CNN we use to extract character-level representation of a given word. The CNN is similar to the one in Chiu and Nichols (2016) except that we use only character embeddings as the inputs to CNN, without character type features. A dropout layer is applied before character embeddings are fed into CNN. Sequence-labeling with Bi-LSTM The extracted features of each word, including pre-trained word embeddings from Word2Vec and character-level word representation from CNN, are fed into a forward LSTM and a backward LSTM. The output of each network at each time step is decoded by a linear layer and a log-softmax layer into log-probabilities for each tag category. These two vectors are then simply added together to produce the final output. 1Our code is at GitHub (https://github.com/SendongZhao/Multi- Task-Learning-for-MER-and-MEN). Figure 2: The CNN layer for extracting character-level word representation of word Zomig (another name of the DRUG Zolmitriptan and Zomigon). Dashed arrows indicate a dropout layer applied before character embeddings are fed into CNN. We view LSTM as a parameterized function Fθ(x1:n) mapping a sequence of n input vectors x1:n, xi ∈ Rdin to output n vectors h1:n, hi ∈ Rdout. A Bi-LSTM is composed of two LSTMs, denoted as functions FL and FR. One reading the sequence in its regular order, and the other reading it in reverse. Concretely, given a sequence x1:n and a desired index i, the function Fθ(x1:n, i) is defined as: Fθ(x1:n, i) = vi = hL,i ◦ hR,i hL,i = FL(x1, x2, ..., xi) hR,i = FR(xn, xn−1, ..., xi) R,i. The vector vi = Fθ(x1:n, i) is then a representation of the ith item in x1:n, taking into account both the entire history x1:i and the entire future xi:n. Finally, in a deep Bi-LSTM, both FL and FR are k-layer LSTMs, and F (cid:96) θ (x1:n, i) = vi = L,i ◦ h(cid:96) h(cid:96) In a sequence tagging task, we are given an input w1, ..., wn and need to predict an output y1, ..., yn, yi ∈ yi 1:L, where L is a label set of interest; i.e., in a medical named entity recognition task, L is the named entity tag set, and yi is the named entity tag for word wi such as "B-DISEASE". If we take the inputs x1:n to represent a sequence of sentence words w1, ..., wn, we can think of vi = Fθ(x1:n, i) as inducing an infinite window around a focus word wi. We can then use vi as an input to a multi-class classification function f (vi), to assign a tag yi to each input location i. The tagger is greedy: the tagging decisions are independent of each other. Alternatively, we can also feed the output vectors of Bi-LSTM to the CRF layer to jointly decode the best tag sequence. Note that dropout layers are applied on both the input and output vectors of Bi-LSTM. PaddingPaddingZomigCharacterEmbeddingConvolutionLayerMax PoolingLayerChar-levelWord Representation Figure 3: The main architecture of our neural multi-task learning model with two explicit feedback strategies for MER and MEN. The character embedding is computed by CNN in Figure 2. Then the character representation vector is concatenated with the word embedding before feeding into the Bi-LSTM. Dashed arrows from the left to the right is the feedback from MER to MEN. Dashed arrows from the right to the left is the feedback from MEN to MER. Orange arrows indicate dropout layers applied on both the input and output vectors of Bi-LSTM. For a k-layer Bi-LSTM tagger for MER and MEN we get: M ER(w1:n, i) = yi M ER = arg max yi M ER = fM ER(vk i ) M EN (w1:n, i) = yi M EN = arg max yi M EN = fM EN (vk i ) θ (x1:n, i) vk i = F k x1:n = E(w1), E(w2), ..., E(wn) M ER is the output tag of MER, yi where E as an embedding function mapping each word M ER is in the vocabulary into a d-dimensional vector, yi the log-probabilities vector with the length of MER tag M EN is the space, yi log-probabilities vector with the length of MEN tag space, M EN is the output tag of MEN, and vk is the output of yi the kth Bi-LSTM layer as defined above. All the parameters are trained separately for MER and MEN because we model MER and MEN as different sequence labeling tasks. i Multi-task Mode with Explicit Feedback Strategies The dependencies between MER and MEN inspire us to explore their potential mutual benefits. In order to make the most of the mutual benefits between MER and MEN, we propose to feed the above mentioned Bi-LSTM and its variants into multi-task learning framework with two explicit feedback strategies, as shown in Figure 3. This method (1) is able to convert hierarchical tasks into parallel multi-task mode while maintaining mutual supports between tasks; (2) benefits from general representations of both tasks provided by multi-task learning; (3) is effective in determining boundaries of medical named entities through explicit feedback strategies thus improves the performance of both MER and MEN. We experiment with a multi-task learning architecture based on stacked Bi-LSTM, CNNs and CRF. Multi-task learning can be seen as a way of regularizing model in- duction by sharing representations with other inductions. We use stacked Bi-LSTM-CNNs-CRF with task supervision from multiple tasks, sharing Bi-LSTM-CNNs layers among the tasks. MER and MEN are hierarchical tasks and their outputs potentially have mutual benefits for each other as well. It means MEN can take MER results as input, while the results of MEN can be also useful for MER. However, MER and MEN can be implemented independently as different sequence tagging tasks. Therefore, we 1) follow the popu- lar strategy of multi-task learning to share representations between MER and MEN; and 2) propose to use mutual feedback between MER and MEN, i.e., the result of MER is fed into the MEN as part of the input and the result of MEN is fed into the MER as part of the input. The multi- task learning with two explicit feedback strategies for MER and MEN is defined as: M ER(w1:n, i) = yi M ER = arg max yi M ER = fM ER(vM ER i ) M EN (w1:n, i) = yi M EN = arg max yi M EN i ) = vk = vk = fM EN (vM EN i ◦ (vk i ◦ (vk θ (x1:n, i) vM ER vM EN i vk i = F k x1:n = E(w1), E(w2), ..., E(wn) M EN U) M ERV) i i + yi i + yi i i i ) is the MER multi-class classifica- where fM ER(vM ER ) the MEN multi-class tion function and fM EN (vM EN i classification function. vM ER is the input of MER multi- class classification function, which combines the output of the shared stacked Bi-LSTM-CNNs and the explicit feedback from MEN. vM EN is the input of MEN multi- class classification function, which combines the output of the shared Bi-LSTM-CNNs and the explicit feedback from MER. U is the matrix to map the feedback from MEN to MER, V maps the feedback from MER to MEN. You can M ERV) as a modification according to the consider (vk i a better vector feedback from MER, which could make vk to get the correct label, the same as vk M EN U. i + yi In the multi-task learning setting, we have two prediction tasks over the same input vocabulary space. These two prediction tasks share k-layer Bi-LSTM-CNNs (i.e., hard i + yi Takotsubo syndrome secondary to ZolmitriptanEmbedding layer (word + character)B-DISEASED054549-P∑∑UVI-DISEASED054549-P∑∑UVONULL∑∑UVONULL∑∑UVB-CHEMICALC089750∑∑UV parameter sharing). Each task has its own output vocabulary (a task-specific tag set), but all of them map the length n input sequence into a length n output tag sequence. The Multi-task training protocol. We assume to sepa- rate training set into T different subsets corresponding to T different tasks. We label T different subsets as D1, ..., DT , where each Dt contains pairs of input-output sequences i ∈ Lt. The input sets of words (w1:n, yt W is shared across tasks, but the output sets (tag set) Lt are task dependent. 1:n), wi ∈ W , yt At each step in the training process we choose a random 1:n) ∈ task t, followed by a random training instance (w1:n, yt Dt. We use the tagger of task t to predict the labels yt i, suffer a loss with respect to the true labels yt i and update the output log-probabilities vector yt i of w1:n as well as the model parameters. If we choose MER at the very first step, we take the feedback from MEN as a log-probabilities vector with the initialization of each element having the same value 1Lt and vice versa, where Lt is the length of the tag set of task t. Notice that a task t (eg. MER and MEN in this paper) is associated with the stacked Bi-LSTM-CNNs. The update for a sample from task t affects the parameters of ft and the shared k-layer functions F 1 θ , but not the parameters of ft(cid:48)(cid:54)=t. This asynchronous training protocol makes it possible to implement our model in distributed way. We tried a synchronized way of training as well but did not lead to any difference in results. θ , .., F k Experiments Datasets We evaluate the performance of the MTL models on two corpora: BC5CDR task corpus (Li et al. 2016) and the NCBI Disease corpus (Doan, Leaman, and Lu 2014). The BC5CDR corpus contains 1500 PubMed abstracts, which are equally partitioned into three sections for training, de- velopment and test, respectively. A disease mention in each abstract is manually annotated with the concept identifier to which it refers to a controlled vocabulary. The NCBI Disease corpus consists of 793 PubMed abstracts, which are also separated into training (593), development (100) and test (100) subsets. The NCBI Disease corpus is annotated with disease mentions, using concept identifiers from either MeSH or OMIM. Table 1 gives the statistics of the two cor- pora. Due to the limit of the vocabulary of chemical, we only consider mapping disease mentions to a controlled vocabu- lary of diseases. To map disease mentions to MeSH/OMIM concepts (IDs), we use the Comparative Toxicogenomics Database (CTD) MEDIC disease vocabulary, which consists of 9700 unique diseases described by more than 67 000 terms (including synonyms). Pre-trained word embeddings We initialized the word embedding matrix with four types of publicly available pre-trained word embeddings respectively. The first is Word2Vec 50-dimensional embeddings trained on the PubMed abstracts together with all the full-text articles from PubMed Central (PMC) (Pyysalo et al. 2013). The second is GloVe 100-dimensional embeddings trained on 6 billion words from Wikipedia and web text (Pennington, Socher, and Manning 2014). The third is Senna 50-dimensional embeddings trained on Wikipedia and Reuters RCV-1 corpus (Collobert et al. 2011). The fourth is the randomly initialized 100- dimensional embeddings which are uniformly sampled from dim ], where dim is the dimension of range [−(cid:113) 3 (cid:113) 3 dim , + embeddings (He et al. 2015). Evaluation Metrics and Settings We perform experiments for both medical named entity recognition and medical named entity normalization. We utilize the evaluation kit2 for evaluating model performances. Metrics measured concept-level precision, recall and F1. are dim , + (cid:113) 3 uniform samples from [−(cid:113) 3 Our single- and multi-task networks are 3-layer, Bi- LSTM-CNNs with pre-trained word embeddings. For the neural multi-task learning model, we follow the training procedure outlined in Section . We use the word embeddings setup in Section . Character embeddings are initialized with dim ], where we set dim = 30. We follow (Søgaard and Goldberg 2016) in using the same dimension for the hidden layers. We use a dropout rate of 0.5 and train these architectures with momentum SGD with the initial learning rate of 0.001 and momentum of 0.9 for 20 epochs. Main Results The first part of Table 2 illustrates the results of 5 previous top-performance systems for (medical) named entity recog- nition and normalization. Among these previous studies, LeadMine and IDCNN are pipeline models, while Dnorm, TaggerOne, and Transition-based Model are joint models. From the first part, it is clear that the joint models perform better than the pipeline models on both corpora. The second part of the table presents comparisons of Bi-LSTM and its variants for MER and MEN. Adding CRF layer on both Bi-LSTM and Bi-LSTM-CNNs can not bring significant improvements. It might because the most of entity mentions in our data sets are single-word entities, i.e., entity with one word. CNN layer for char-level representation causes signif- icant improvements on Bi-LSTM and its variants for both MER and MEN. Bi-LSTM-CNNs and Bi-LSTM-CNNs- CRF significantly outperform Bi-LSTM and Bi-LSTM-CRF respectively, showing that character-level word representa- tions are important for both recognition and normalization. The improvents rely on two clues, 1) different medical enti- ties usually have the same prefix and suffix, such as acetate, acetone, antritis and pharyngitis. Modeling such character- level information can benefit recognition; 2) different names which refer to the same medical entity usually share the same character fragments, such as Zolmitriptan, Zomig and Zomigon. Modeling such character-level information can benefit normalization. From the third part of Table 2, we can see that MTL framework with Bi-LSTM and its variants significantly 2http://www.biocreative.org/tasks/biocreative-v/track-3-cdr Corpus BC5CDR NCBI Entity Types and Counts # of Articles # of Disease Mentions # of Chemical Mention 1,500 793 Table 1: Overall statistics of BC5CDR and the NCBI. 12,852 6,881 15,935 0 # of Concepts 5,818 1,049 BC5CDR NCBI Recognition Normalization Recognition Normalization Method LeadMine (Lowe, OBoyle, and Sayle 2015) Dnorm (Leaman, Islamaj Doan, and Lu 2013) TaggerOne (Leaman and Lu 2016) Transition-based Model (Lou et al. 2017) IDCNN (Strubell et al. 2017) Bi-LSTM Bi-LSTM-CRF Bi-LSTM-CNNs Bi-LSTM-CNNs-CRF MTL +Bi-LSTM +Bi-LSTM-CRF +Bi-LSTM-CNNs +Bi-LSTM-CNNs-CRF MTL-MEN feedback +Bi-LSTM +Bi-LSTM-CRF +Bi-LSTM-CNNs +Bi-LSTM-CNNs-CRF MTL-MER feedback +Bi-LSTM +Bi-LSTM-CRF +Bi-LSTM-CNNs +Bi-LSTM-CNNs-CRF MTL-MEN&MER feedback +Bi-LSTM +Bi-LSTM-CRF +Bi-LSTM-CNNs +Bi-LSTM-CNNs-CRF - 0.7980 0.8290 0.8205 0.7983 0.8075 0.8077 0.8246 0.8248 - 0.7820 0.8070 0.8262 0.7425 0.7934 0.7933 0.8059 0.8061 - - 0.8260 0.8382 0.8011 0.8060 0.8062 0.8464 0.8466 0.8612 0.8064 0.8370 0.8562 0.8107 0.8136 0.8136 0.8447 0.8449 0.8532 0.8532 0.8647 0.8648 0.8574 0.8575 0.8653 0.8654 0.8637 0.8638 0.8723 0.8725 0.8699 0.8699 0.8743 0.8743 0.8435 0.8436 0.8693 0.8693 0.8542 0.8542 0.8706 0.8709 0.8608 0.8609 0.8731 0.8733 0.8657 0.8658 0.8823 0.8823 0.8321 0.8321 0.8632 0.8632 0.8419 0.8420 0.8642 0.8645 0.8474 0.8477 0.8736 0.8739 0.8538 0.8539 0.8762 0.8763 0.8440 0.8442 0.8720 0.8722 0.8530 0.8532 0.8813 0.8813 0.8576 0.8576 0.8821 0.8822 0.8645 0.8647 0.8917 0.8917 Table 2: F1 score of medical named entity recognition and normalization on two corpora. outperforms the pipeline use of Bi-LSTM and its variants, which indicates the contribution of general representations of MER and MEN provided by MTL. The fourth part and fifth part of Table 2 present the improvements by incorpo- rating the feedback from MEN and the feedback from MER. Both feedback strategies can improve the performance of MER and MEN on both corpora, but the feedback from MER performs better. It makes sense because the original order of task hierarchy is from MER to MEN. Therefore, it is very natural that MEN needs more supports from MER than MER needs from MEN. The last part of Table 2 presents the results of Bi-LSTM and its variants in the MTL framework with both feedback of MEN and MER. This feedback-based MTL framework achieves the best result on each Bi-LSTM based models, indicating it is the best MTL framework on Bi-LSTM based models for MER and MEN. Effect of Dropout Table 3 compares the results with and without dropout layers for training sets. All other hyper-parameters and features remain the same as our best model in Table 2. We observe slightly improvements for the two tasks on both corpora. It confirms the function of dropout in reducing over-fitting reported by Srivastava et al. (2014). NCBI MER 0.8669 0.8743 MEN 0.8713 0.8823 BC5CDR MER 0.8722 0.8763 MEN 0.8821 0.8917 No Yes Table 3: Results with and without dropout on two tasks (F1 score for both MER and MEN). Influence of Word Embeddings As mentioned in Section , in order to test the importance of pre-trained word embeddings, we performed experiments with different sets of publicly published word embeddings, as well as a random sampling method, to initialize our model. Table 4 gives the performance of three different word embeddings, as well as the randomly sampled one. According to the results in Table 4, models using pre- trained word embeddings achieve a significant improvement as opposed to the ones using random embeddings. Both MER and MEN rely heavily on pre-trained embeddings. This is consistent with results of previous work (Huang, Xu, and Yu 2015; Chiu and Nichols 2016). NCBI BC5CDR Recognition Normalization Embedding Dimension Random Senna GloVe Word2Vec Table 4: Results with different choices of word embeddings on the two tasks (F1 score). Recognition Normalization 0.7665 0.7911 0.8009 0.8763 0.7725 0.7966 0.8062 0.8917 0.7746 0.8016 0.8042 0.8823 0.7532 0.7944 0.7963 0.8743 100 50 100 50 For different pre-trained embeddings Word2Vec 50 dimensional embeddings achieve best results on both tasks. This is different from the results reported by (Ma and Hovy 2016), where Glove achieved significantly better performance on NER than Word2Vec embedding. Senna 50-dimensional embeddings obtain similar performance with Glove on MER and MEN, also significant behind Word2Vec. One possible is significantly better than the other two embeddings on MER and MEN is using domain related text for training embeddings. Word2Vec embeddings were trained on PubMed abstracts and the full-text articles. The other two embeddings which were trained on other domain text, leading to vocabulary mismatch of entities. reason that Word2Vec Boundary Inconsistency Error Analysis Since we model MER and MEN as different sequence labeling tasks, the result of MER likely have different boundary with the result of MEN. Table 5 compares the ratios of boundary inconsistency of MER and MEN on each test set of both corpora. It is clear that our proposed MTL framework with two feedback strategies on MER and MEN can significantly alleviate the boundary inconsistency of MER and MEN thus improve the performance. Bi-LSTM-CNNs-CRF MTL +Bi-LSTM-CNNs-CRF MTL-MEN&MER feedback +Bi-LSTM-CNNs-CRF NCBI 0.0635 0.0412 0.0134 BC5CDR 0.0563 0.0383 0.0114 Table 5: Ratios of the boundary inconsistency of MER and MEN on two test sets. OOV Entities Error Analysis To better understand the behavior of our model, we per- form error analysis on Out-of-Vocabulary words (OOV). Specifically, we partition each data set into four subsets in-vocabulary words (IV), out-of-training-vocabulary words (OOTV), out-of-embedding-vocabulary words (OOEV) and out-of-both-vocabulary words (OOBV). A word is con- sidered IV if it appears in both the training and embed- ding vocabulary, while OOBV if neither. OOTV words are the ones do not appear in training set but in embedding vocabulary, while OOEV are the ones do not appear in embedding vocabulary but in training set. An entity is considered as OOBV if there exists at lease one word not in training set and at least one word not in embedding vocabulary, and the other three subsets can be done in similar manner. Table 6 presents the statistics of the partition on each corpus. The embedding we used is pre-trained 50- dimensional embeddings in (Pyysalo et al. 2013), the same as Section . IV OOTV OOEV OOBV NCBI 987 33 16 10 BC5CDR 5,421 127 33 142 Table 6: Statistics of the partition on each test set. It lists the number of unique entities. Table 7 illustrates the performance of our best model on different subsets of entities. The largest improvements appear on the IV and OOTV subsets of both the two corpora on both tasks. This demonstrates that by feeding into multi- task learning framework with explicit feedback, our model is more powerful on entities that appear in pre-trained embedding sets, which shows the superiority of our model to make better use of pre-trained word embeddings and deal with entities which do not appear in training set. BC5CDR NCBI MER MEN MEN 0.8254 0.8094 0.8064 0.7354 MER Bi-LSTM-CNNs-CRF 0.8738 0.8279 0.7835 0.6937 0.8451 IV OOTV 0.8046 OOEV 0.7776 OOBV 0.7221 MTL-MEN&MER feedback+Bi-LSTM-CNNs-CRF 0.8931 IV OOTV 0.8667 OOEV 0.8053 OOBV 0.7668 0.9136 0.8832 0.82217 0.7804 0.8677 0.8354 0.7821 0.7223 0.9017 0.8753 0.8132 0.7713 0.9042 0.8661 0.8163 0.7345 Table 7: Comparison of performance of our model on different subsets of entities (F1 score). Conclusion We study the practical valuable task of MER and MEN. They are fundamental tasks in medical literature mining because many developments in this area are related to these two tasks. Previous state-of-the-art studies have demon- strated that the mutual benefits between medical named entity recognition and normalization are very useful. To make use of the mutual benefits in a more advanced and intelligent way, we proposed a novel deep neural multi-task learning framework with two explicit feedback strategies to jointly model MER and MEN. Our method can convert hierarchical tasks, i.e., MER and MEN, into parallel multi- task mode while maintaining mutual supports between tasks. Experimental results indicate that our model outperforms previous state-of-the-art studies. Acknowledgments We thank anonymous reviewers for their insightful com- ments and suggestions. This work is supported by NSF IIS- 1716432 and IIS-1750326. References 2016. lstm-cnns. A unified architecture for natural [Augenstein and Søgaard 2017] Augenstein, I., and Søgaard, A. 2017. Multi-task learning of keyphrase boundary classification. In Proc. of 55th ACL, 341 -- 346. [Chiu and Nichols 2016] Chiu, J., and Nichols, E. Named entity recognition with bidirectional TACL 4:357 -- 370. [Collobert and Weston 2008] Collobert, R., and Weston, J. 2008. language processing: deep neural networks with multitask learning. In Proc. of 25th ICML, 160 -- 167. [Collobert et al. 2011] Collobert, R.; Weston, J.; Bottou, L.; Karlen, M.; Kavukcuoglu, K.; and Kuksa, P. 2011. Natural language processing (almost) from scratch. JMLR 12:2493 -- 2537. [Crichton et al. 2017] Crichton, G.; Pyysalo, S.; Chiu, B.; and Korhonen, A. 2017. A neural network multi-task learning approach to biomedical named entity recognition. BMC Bioinformatics 18(1):368. [Curran and Clark 2003] Curran, J., and Clark, S. 2003. Language independent ner using a maximum entropy tagger. In Proc. of NAACL-HLT-2003, 164 -- 167. [Doan and Xu 2010] Doan, S., and Xu, H. 2010. Rec- ognizing medication related entities in hospital discharge In Proc. of summaries using support vector machine. COLING-2010, 259 -- 266. [Doan, Leaman, and Lu 2014] Doan, R. I.; Leaman, R.; and Lu, Z. 2014. Ncbi disease corpus: A resource for disease Journal of name recognition and concept normalization. Biomedical Informatics 47(2):1. [Dong et al. 2015] Dong, D.; Wu, H.; He, W.; Yu, D.; and Wang, H. 2015. Multi-task learning for multiple language translation. In Proc. of 53rd ACL, 1723 -- 1732. [He et al. 2015] He, K.; Zhang, X.; Ren, S.; and Sun, J. 2015. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proc. of ICCV- 2015, 1026 -- 1034. Washington, DC, USA: IEEE Computer Society. [Huang, Xu, and Yu 2015] Huang, Z.; Xu, W.; and Yu, K. 2015. Bidirectional LSTM-CRF models for sequence tagging. CoRR abs/1508.01991. [Klein et al. 2003] Klein, D.; Smarr, J.; Nguyen, H.; and Manning, C. D. 2003. Named entity recognition with character-level models. In Proc. of NAACL-HLT-2003, 180 -- 183. [Lample et al. 2016] Lample, G.; Ballesteros, M.; Subrama- nian, S.; Kawakami, K.; and Dyer, C. 2016. Neural In Proc. of architectures for named entity recognition. NAACL-HLT-2016, 260 -- 270. 2016. 2015. 2015. [Leaman and Lu 2016] Leaman, R., and Lu, Z. 2016. Tag- gerone: joint named entity recognition and normalization with semi-markov models. Bioinformatics 32(18):2839. R.; [Leaman, Islamaj Doan, and Lu 2013] Leaman, Islamaj Doan, R.; and Lu, Z. 2013. Dnorm: disease name normalization with pairwise learning to rank. Bioinformatics 29(22):2909 -- 2917. [Leaman, Wei, and Lu 2015] Leaman, R.; Wei, C. H.; and Lu, Z. tmchem: a high performance approach for chemical named entity recognition and normalization. Journal of Cheminformatics 7(S1):S3. [Li et al. 2016] Li, J.; Sun, Y.; Johnson, R. J.; Sciaky, D.; Wei, C. H.; Leaman, R.; Davis, A. P.; Mattingly, C. J.; Wiegers, T. C.; and Lu, Z. Biocreative v cdr task corpus: a resource for chemical disease relation extraction. Database: The Journal of Biological Databases and Curation 2016:baw068. [Liu et al. 2016] Liu, Y.; Li, S.; Zhang, X.; and Sui, Z. 2016. Implicit discourse relation classification via multi- task neural networks. In Proc. of 30th AAAI, 2750 -- 2756. [Lou et al. 2017] Lou, Y.; Zhang, Y.; Qian, T.; Li, F.; Xiong, S.; and Ji, D. 2017. A transition-based joint model for disease named entity recognition and normalization. Bioinformatics 33(15):2363. [Lowe, OBoyle, and Sayle 2015] Lowe, D. M.; OBoyle, N. M.; and Sayle, R. A. Leadmine: Disease identification and concept mapping using wikipedia. In the Fifth BioCreative Challenge Evaluation Workshop. [Luo et al. 2015] Luo, G.; Huang, X.; Lin, C. Y.; and Nie, Z. 2015. Joint entity recognition and disambiguation. In Proc. of EMNLP-2015, 879 -- 888. [Luong et al. 2016] Luong, M.-T.; Le, Q. V.; Sutskever, I.; Vinyals, O.; and Kaiser, L. 2016. Multi-task sequence to sequence learning. In Proc. of ICLR-2016. [Ma and Hovy 2016] Ma, X., and Hovy, E. H. 2016. End- to-end sequence labeling via bi-directional lstm-cnns-crf. In Proc. of 54th ACL, 1064 -- 1074. [McCallum and Li 2003] McCallum, A., and Li, W. 2003. Early results for named entity recognition with conditional random fields, feature induction and web-enhanced lexi- cons. In Proc. of NAACL-HLT-2003, 188 -- 191. J.; [Pennington, Socher, and Manning 2014] Pennington, Socher, R.; and Manning, C. Glove: Global vectors for word representation. In Proc. of EMNLP-2004, 1532 -- 1543. [Pyysalo et al. 2013] Pyysalo, S.; Ginter, F.; Moen, H.; Salakoski, T.; and Ananiadou, S. 2013. Distributional semantics resources for biomedical text processing. In Proc. of Languages in Biology and Medicine, 39 -- 44. [Ruder 2017] Ruder, S. 2017. An overview of multi-task learning in deep neural networks. CoRR abs/1706.05098. [Sahu and Anand 2016] Sahu, S., and Anand, A. 2016. Re- current neural network models for disease name recognition using domain invariant features. In Proc. of 54th ACL, 2216 -- 2225. 2014. N.; Hinton, Deep multi-task learning with low level [Søgaard and Goldberg 2016] Søgaard, A., and Goldberg, Y. 2016. tasks supervised at lower layers. In Proc. of 54th ACL, 231 -- 235. [Srivastava et al. 2014] Srivastava, G.; Krizhevsky, A.; Sutskever, I.; and Salakhutdinov, R. 2014. Dropout: a simple way to prevent neural networks from overfitting. JMLR 15(1):1929 -- 1958. [Strubell et al. 2017] Strubell, E.; Verga, P.; Belanger, D.; Fast and accurate entity and McCallum, A. In Proc. of recognition with iterated dilated convolutions. EMNLP-2017, 2670 -- 2680. [Wang et al. 2018] Wang, X.; Zhang, Y.; Ren, X.; Zhang, Y.; Zitnik, M.; Shang, J.; Langlotz, C.; and Han, J. 2018. Cross- type biomedical named entity recognition with deep multi- task learning. CoRR abs/1801.09851. [Wei et al. 2015] Wei, C. H.; Peng, Y.; Leaman, R.; Davis, A. P.; Mattingly, C. J.; Li, J.; Wiegers, T. C.; and Lu, Z. 2015. Overview of the biocreative v chemical disease relation (cdr) task. In Biocreative Challenge Evaluation Workshop, 154 -- 166. 2017.
1704.00898
2
1704
2017-06-21T06:59:17
Interpretation of Semantic Tweet Representations
[ "cs.CL" ]
Research in analysis of microblogging platforms is experiencing a renewed surge with a large number of works applying representation learning models for applications like sentiment analysis, semantic textual similarity computation, hashtag prediction, etc. Although the performance of the representation learning models has been better than the traditional baselines for such tasks, little is known about the elementary properties of a tweet encoded within these representations, or why particular representations work better for certain tasks. Our work presented here constitutes the first step in opening the black-box of vector embeddings for tweets. Traditional feature engineering methods for high-level applications have exploited various elementary properties of tweets. We believe that a tweet representation is effective for an application because it meticulously encodes the application-specific elementary properties of tweets. To understand the elementary properties encoded in a tweet representation, we evaluate the representations on the accuracy to which they can model each of those properties such as tweet length, presence of particular words, hashtags, mentions, capitalization, etc. Our systematic extensive study of nine supervised and four unsupervised tweet representations against most popular eight textual and five social elementary properties reveal that Bi-directional LSTMs (BLSTMs) and Skip-Thought Vectors (STV) best encode the textual and social properties of tweets respectively. FastText is the best model for low resource settings, providing very little degradation with reduction in embedding size. Finally, we draw interesting insights by correlating the model performance obtained for elementary property prediction tasks with the highlevel downstream applications.
cs.CL
cs
Interpretation of Semantic Tweet Representations ∗IIIT Hyderabad, India. [email protected]; {manish.gupta,vv}@iiit.ac.in Ganesh J∗, Manish Gupta∗†, Vasudeva Varma∗ †Microsoft, Hyderabad, India. [email protected] 7 1 0 2 n u J 1 2 ] L C . s c [ 2 v 8 9 8 0 0 . 4 0 7 1 : v i X r a Abstract-Research in analysis of microblogging platforms is experiencing a renewed surge with a large number of works applying representation learning models for applications like sen- timent analysis, semantic textual similarity computation, hashtag prediction, etc. Although the performance of the representation learning models has been better than the traditional baselines for such tasks, little is known about the elementary properties of a tweet encoded within these representations, or why particular representations work better for certain tasks. Our work presented here constitutes the first step in opening the black-box of vector embeddings for tweets. Traditional feature engineering methods for high-level applica- tions have exploited various elementary properties of tweets. We believe that a tweet representation is effective for an ap- plication because it meticulously encodes the application-specific elementary properties of tweets. To understand the elementary properties encoded in a tweet representation, we evaluate the representations on the accuracy to which they can model each of those properties such as tweet length, presence of particular words, hashtags, mentions, capitalization, etc. Our systematic extensive study of nine supervised and four unsu- pervised tweet representations against most popular eight textual and five social elementary properties reveal that Bi-directional LSTMs (BLSTMs) and Skip-Thought Vectors (STV) best encode the textual and social properties of tweets respectively. FastText is the best model for low resource settings, providing very little degradation with reduction in embedding size. Finally, we draw interesting insights by correlating the model performance obtained for elementary property prediction tasks with the high- level downstream applications. I. INTRODUCTION Research on Twitter has focused on various kinds of business applications such as opinion mining, semantic textual similar- ity, user profiling, hashtag identification, microblog retrieval, etc. Central to the performance of these applications [10] is the question of tweet representation: How to best capture the essential meaning of a tweet in a machine-understandable format (or "representation")? Challenges like short length, informal words, misspellings and unusual grammar make it difficult to obtain a good representation to capture these text aspects. Further, tweets also have social network-oriented properties, and hence a good representation should also capture social aspects. Traditionally, tweets have been modeled using Bag-Of-Words (BOW) [11] and Latent Dirichlet Allocation (LDA) [11]. Recently there has been a paradigm shift in machine learning towards using distributed representations for words [12] and sentences [3], [6], [13]. Though these representations are hard to interpret, they have the following advantages: (1) in practice, they are highly effective across multiple applications, and (2) they reduce the dependence on domain level experts. Researchers in Twitter analytics have found these representa- tion learning models to be very effective for several critical tasks such as sentiment analysis [4], [14], semantic textual similarity computation [8], hashtag identification [9], etc. How- ever, little is known about the elementary tweet properties encoded by the representations generated from these models, knowing which will allow us to make generalizable conclu- sions. Our work presented here constitutes the first step in opening the black-box of vector embeddings for tweets. Essentially we ask the following question: "what are the core properties encoded in the given tweet representation?" We explicitly group the set of these properties into two categories: textual and social. Textual category includes properties such as tweet length, the order of words in it, words, slang words, hashtags, named entities, and capitalization in the tweet. On the other hand, properties such as mention count, first mention position, is reply, reply time and repeating word from a conversation fall under the social category. We investigate the degree to which the tweet representations encode these properties. We assume that if we cannot train a classifier to predict a property based on its tweet representation, then this property is not encoded in this representation. For example, the model which preserves the tweet length should perform well in predicting the length given the representation generated from the model. Though these elementary property prediction tasks are not directly related to any downstream application, knowing that is good at modeling a particular property (e.g., social properties) indicates that it could excel in correlated applications (e.g., user profiling). In this work we perform an extensive evaluation of nine unsupervised and four supervised tweet representation models, using 13 different properties. the model Our main contributions are summarized below. • Our work is the first towards fine-grained interpretation of tweet embeddings. To this end, we propose a set of 13 tweet-specific elementary property prediction tasks which help in unearthing both the textual as well as social aspects of different tweet representations. • We perform extensive comparison of 13 different vari- ous tweet representations with respect to such properties across two dimensions: tweet length and sensitivity to representation size. • We draw interesting insights by correlating the model performance obtained for elementary property prediction tasks with multiple downstream applications. • Extensive experiments show that bi-directional LSTMs and Skip-Thought vectors (STV) best encode the tex- tual and social properties of tweets respectively. Para- graph2Vec performs the worst while FastText performs best when embedding size needs to be very small. The paper is organized as follows. Section II presents the related work. Sections III and IV discuss the set of proposed Table I: Survey of Unsupervised Representation Learning Models Model DSSM [1] CDSSM [2] Architecture Deep Feed Forward network Learn a common mapping for query and document Deep Feed Forward Convolu- Learn a common mapping for query and document tional network Core Idea Paragraph2Vec [3] Word2Vec network Simple Feed Forward network Learn sentiment specific word embeddings using distant Applications Considered in the Paper Document ranking Document ranking Sentiment analysis, Document retrieval Sentiment analysis Semantic relatedness, Paraphrase detection, Image-sentence ranking, Sentence classification including sentiment analysis Semantic relatedness, Sentence classification tasks used in Skip thought vectors Semantic relatedness, Sentence classification tasks used in Skip thought vectors Semantic relatedness Hashtag prediction SSWE [4] Skip-Thought vec- tors [5] SDAE [6] FastSent [6] Unit Recurrent Gated Encoder-Decoder network LSTM [7] Encoder-Decoder network Word2Vec network Siamese CBOW [8] Siamese network Tweet2Vec [9] Bi-GRU Encoder network Learn document embedding which are good in predicting the words within it supervision (emoticons) Learn sentence embedding which are good in predicting the surrounding sentences (sentential context) Predict the source sentence given the corrupted version of the source sentence Learn sentence embedding which are good in predicting the surrounding sentences (sentential context) Learn sentence embedding which are good in predicting the surrounding sentences (sentential context) Learn tweet embedding directly from characters using hash- tags for supervision elementary property prediction tasks and the models consid- ered for this study. Sections V and VI present the experiment setup and result analysis respectively. We conclude the work with a brief summary in Section VII. II. RELATED WORK A. Summary of Existing Models Tables I and II summarize the core idea and the architecture of the existing unsupervised and supervised models respectively. Based on the network architecture, neural network models can be classified into one or more of the following categories: Feed Forward, Word2Vec, Encoder-Decoder, Siamese, Con- volutional Neural Network (CNN), Recurrent Neural Network (RNN), and Recursive Neural Network (ReNN). ReNNs work with parse trees, and hence are ill-suited for representing tweets, as parse tree construction is not only computation intensive but also expects the input sentences to be gram- matically well-formed unlike most tweets. Hence we do not consider ReNNs for our study. B. Understanding Sentence Representations In a recent work, Hill et al. [6] perform a comparison of different sentence representation models by evaluating them for different high-level semantic tasks such as paraphrase iden- tification, sentiment classification, etc. Our work is different from their work in two ways: (1) They analyze sentences while we work with tweets. Naturally, they ignore social aspects. (2) They survey representations and their effectiveness for various applications; while we perform analysis of representations, and try to estimate their effectiveness for various applications. The most relevant work to ours is that of [17], which investigates three sentence properties in comparing two models: average of words vectors and LSTM auto-encoders. Our work differs from their work in two ways: (1) While they focus on sentences, we focus on tweets which opens up the challenge of understanding how well these representations capture multiple tweet-specific salient textual properties like slang words, hashtag and unre- liable capitalization, and social properties like mentions and conversations. (2) While they work with only 3 properties for 2 models, we provide a more comprehensive analysis by considering 13 properties for 13 different models. III. ELEMENTARY PROPERTY PREDICTION TASKS In this section we list down the set of proposed elementary property prediction tasks to test the characteristics of a tweet embedding. These properties correspond to the most popular features used in multiple papers using feature engineering for various microblog applications. Since tweets are pieces of text in a network context, we naturally categorized the properties into two types: textual and social. Note that we use a neural network to build the elementary property prediction task classifier which has the following two layers in order: the representation layer, and the softmax layer on top whose size varies according to the specific task. When there are more than one input for a task, we concatenate embeddings for each input. Table III presents the dataset statistics for each task. A. Textual Tasks Unlike sentences, tweets have slang words, entities, hashtags, unreliable capitalization, etc. We evaluate tweet representations against the following tasks to check their robustness against this noise. (a) Length Task: Tweet length is a useful feature for detecting spam tweets, news-worthy tweets, etc. This task measures the extent to which the tweet representation encodes the length of the tweet. Given a tweet embedding, the task is to predict the number of words in the tweet. We use binned length to do multi-class classification. After varying bin size in a reasonable range (3–6), we did not observe much change in the results, hence we show results for bin size set as 4. (b) Content Task: Words in a tweet is a useful feature for sentiment analysis, paraphrase detection, response prediction, etc. This task measures the extent to which the tweet repre- sentation encodes the identities of words present in it. Given a tweet embedding and a word embedding, the task is to predict whether the word is in the tweet or not. This is posed as binary classification task where we inject randomly selected words not appearing in the tweet to generate negative samples. (c) Word Order Task: Word order is a useful feature in textual tasks like parsing. This task measures the extent to which the tweet representation preserves the word order. Given a tweet embedding, the embeddings of two words, w1 and w2 that appear in the tweet, the task is to predict whether the word w1 appears before the word w2 in the tweet or not. This is Model CNN [15] Tree-LSTM [13] FastText [16] Task Length Content Word Order Slang Words Hashtag Named Entities Cap. Count Informative Cap. Mention Count Mention Position Is Reply Reply Time Word Repetition in Conversation Dataset name Sentiment140 [18] Sentiment140 [18] Sentiment140 [18] https://noisy-text.github.io/norm-shared-task.html User Profiling [19] Twitter NER [20] User Profiling [19] Twitter NER [20] User Profiling [19] User Profiling [19] Conversation [21] Conversation [21] Conversation [21] Dataset size 1,98,440 1,98,083 1,94,720 3,120 2,00,000 2,394 2,00,000 400 2,00,000 2,00,000 75,008 31,669 37,504 Table III: Dataset Statistics solved as a binary classification task, where the order of words are flipped to generate negative samples. (d) Slang Words Task: Slang word is a useful feature in tasks such as sentiment analysis, paraphrase detection, etc. This task measures the extent to which the tweet representation is robust to the non-standard spellings (e.g., 'toook' for 'took'), informal abbreviations (e.g., 'tmrw' for 'tomorrow'), etc., which are ubiquitous on Twitter. Given a tweet embedding, and the embeddings of two words (w1 , w2 ), the task is to predict whether the word w2 is the canonical form of the word w1 (which is present in the tweet) or not. This is also posed as a binary classification task, where the word w2 is randomly sampled to generate negative samples. (e) Hashtag Task: Hashtag is a useful feature in tasks such as sentiment analysis, hashtag prediction, response prediction, etc. This task measures the extent to which the tweet represen- tation encodes the identities of hashtags present in the tweet. Given a tweet embedding and an embedding of the word that appears in the tweet, the task is to predict whether the word is a hashtag or not. This is solved as a binary classification task, where the negative samples are generated by randomly sampling words from the tweet which are not hashtags. (f) Named Entity (NE) Task: Named entities are a useful feature in detecting paraphrases, etc. This task measures the extent to which the tweet representation encodes the identities of the named entities present in the tweet. Given a tweet embedding and an embedding of the n-gram that appears in the tweet, the task is to predict whether the n-gram is a NE or not. This is solved as a binary classification task, where the negative samples are generated by randomly sampling n-grams from the tweet which are not NEs. (g) Capitalization Count Task: Capitalization count is a use- ful feature in detecting named entities, paraphrases and so on. This task measures the extent to which the tweet representation encodes the number of capitalized words present in the tweet. Given a tweet embedding, the task is to predict the number of words starting with a capital letter in the tweet. (h) Informative Capitalization Task: Capitalization is a key orthographic feature for recognizing NE. Unlike in curated text, non-entity words in some tweets are capitalized just Table II: Survey of Supervised Representation Learning Models Architecture Simple CNN Recursive Network Simple Feed Forward Network Classify using the average of word vectors Core Idea Classify using a CNN on top of pre-trained word vectors Generalization of LSTMs to model recursive nature of sentences Semantic relatedness, Sentiment classification Applications Considered in the Paper Sentiment analysis, Question classification Sentiment analysis, Tag prediction for emphasis and could confuse a naıve named entity rec- ognizer. In this task, we measure the extent to which the tweet representation encodes the capitalized word which are informative in identifying the named entity mention. Given a tweet embedding and an embedding of the capitalized word that appears in the tweet, the task is to predict whether the word in the tweet is informative for identifying NE mention or not. This is also framed as a binary classification task. B. Social Tasks Besides the textual properties, a good representation should be able to explain the following social properties of tweets. (i) Mention Count Task: Mention count is a useful feature in tasks such as sentiment analysis, response prediction, etc. This task measures the extent to which the tweet representation encodes the number of mentions present in it. Given a tweet embedding, the task is to predict the number of user mentions (words starting with the letter '@') in the tweet. We use the raw frequency and pose it as a classification problem. (j) Mention Position Task: Mention position is a useful fea- ture in tasks such as sentiment analysis, response prediction, etc. This task measures the extent to which the represen- tation encodes the position of the first user mention in the tweet. (k) Is Reply Task: This task measures the extent to which the tweet representation encodes the salient properties of a reply tweet. Given a tweet embedding, the task is to predict whether the tweet is a reply tweet or not. To generate the negative instances for this binary task, we randomly choose a tweet that is a conversation starter. (l) Reply Time Task: Reply time is a useful feature in modeling the conversation, predicting responses, etc. This task measures the extent to which the tweet representation encodes the temporal aspects of a reply tweet. Given a tweet embedding, the task is to predict the number of minutes taken to get a reply for the tweet. For simplicity, we consider only the tweets which get a reply within an hour. (m) Word Repetition in Conversation Task: Word repeti- tion in a conversation is a useful feature in modeling the conversation, predicting responses, etc. This task measures the extent to which the tweet representation encodes the frequent words in a conversation. Given a tweet embedding and an embedding for a word, the task is to predict whether the word will be used the most in the ensuing conversation thread from the tweet that is a conversation starter. We randomly choose the word that is never used later in the conversation in order to generate negative samples. IV. REPRESENTATION LEARNING MODELS In this section we list down popular models for learning tweet representations. A. Unsupervised Models We experiment with the following unsupervised representation learning models. These models require an additional classifier to do the final classification. lutional variant of DSSM. • Bag Of Words (BOW) [11] - This simple representation captures the TF-IDF value of an n-gram. We pick top 50K n-grams, with the value of 'n' going upto 5. • Latent Dirichlet Allocation (LDA) [11] - We use the topic distribution resulting by running LDA with number of topics as 200, as the tweet representation. We varied number of topics as 100, 200, 500 but found best results at 200. • Bag Of Means (BOM) - We take the average of the word embeddings obtained by running the GloVe [22] model on 2B tweets with embedding size as 200 1. We varied embedding size as 25, 50, 100, 200 (since these are the available sizes) but found best results at 200. • Deep Structured Semantic Models (DSSM) [1] - This is a deep encoder trained to represent query and document in common space, for the document ranking task. We use the publicly available pre-trained encoder to encode the tweets 2. • Convolutional DSSM (CDSSM) [2] - This is the convo- • Paragraph2Vec (PV) - This model based on Word2Vec [12] learns embedding for a document which is good in predicting the words within it. We use the BOW variant with the recommended embedding size and window size of 200 and 10 respectively. • Skip-Thought Vectors (STV) [5] - This is a Gated Recurrent Unit (GRU) encoder trained to predict adjacent sentences in a books corpus. We use the recommended combine-skip (4800-dimensional) vectors from the pub- licly available encoder 3. • Tweet2Vec (T2V) [9] - This is a character composition model working directly on the character sequences to predict the user-annotated hashtags in a tweet. We use publicly available encoder, which was trained on 2M tweets 4. • Siamese CBOW (SCBOW) [8] - This model uses av- eraging of word vectors to represent a sentence, and the objective and data used here is same as that for STV. Note that this is different from BOW because the word vectors here are optimized for sentence representation. [3] B. Supervised Models Below we list the set of supervised representation learning models which we use for end-to-end classification. CNN proposed in [15]. • Convolutional Neural Network (CNN) - This is a simple • Long Short Term Memory Network (LSTM) [7] - This is a vanilla LSTM based recurrent model, applied from start to the end of a tweet, and the last hidden vector is used as tweet representation. We use the optimal hyper- parameter settings as proposed in [13]. 1http://nlp.stanford.edu/projects/glove/ 2https://www.microsoft.com/en-us/research/project/dssm/ 3https://github.com/ryankiros/skip-thoughts 4https://github.com/bdhingra/tweet2vec • Bi-directional LSTM (BLSTM) [7] - This extends LSTM by using two LSTM networks, processing a tweet left-to- right and right-to-left respectively. A tweet is represented by concatenating the last hidden vector of both LSTMs. We use the optimal hyper-parameter settings proposed in [13]. • FastText (FT) [16] - This is a simple architecture which averages the n-gram vectors to represent a tweet, followed by the softmax in the final layer. V. EXPERIMENTS We perform an extensive evaluation of all the models in an attempt to find the significance of different representation models. Essentially we study every model (with optimal set- tings reported in the corresponding paper) with respect to the following perspectives. (1) Property prediction task accuracy - When the accuracy of the model for a property is high, it is more likely to encode the property. This test identifies the model with the best F1- score for each elementary property prediction task. (a) Best model: Tasks for which this model has outperformed all the other models. (b) Best unsupervised model: Tasks for which this model has outperformed all the other unsupervised models. (c) Best supervised model: Tasks for which this model has outperformed all the other supervised models. (2) Property prediction task accuracy versus Tweet length - Some representation learning models are biased towards mod- eling shorter or longer tweets. This test helps to compare the performance of the model for shorter vs. longer tweets. (a) Positively correlated tasks: Tasks for which the perfor- mance of the model increases as tweet length increases. (b) Negatively correlated tasks: Tasks for which the perfor- mance of the model decreases as tweet length increases. (3) Property prediction task accuracy versus Representa- tion size - Embedding size is an important hyper-parameter to tune the performance of the representation learning model. This test captures the sensitivity of each model with respect to the embedding size. (a) Invariant tasks: Tasks for which the model performance is invariant with increase in embedding size. (b) Positively correlated tasks: Tasks for which the model performance increases with increase in embedding size. (c) Negatively correlated tasks: Tasks for which the model performance decreases with increase in embedding size. VI. RESULTS AND ANALYSIS Detailed analysis of various supervised and unsupervised mod- els discussed in Section IV, across various dimensions (1, 2, and 3) discussed in Section V, is presented in Table IV. Thus, e.g., the "task accuracy (1)" column entry for STV tells us that STV is "best model (a)" for Content, Mention Count, Is Reply, Word Repeat tasks, and "best unsupervised model (b)" for Content, Capt. Count, Mention Count, Mention Pos., Is Reply, Word Repeat tasks. We discuss these in detail in this section. We have made the code publicly available at http://tinyurl.com/mysteriousTweetReps. In this section, we analyze the results in detail. Table IV: Detailed Analysis of Unsupervised and Supervised Models Model BOW Task Accuracy (1) (a): Reply Time (b): Slang Words, Reply Time Tweet Length (2) (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. Representation Size (3) (a): Word Repeat (b): Content, Word Order, Slang Word, NE, Capt. Count, Mention Count, Mention Pos., Is Reply, Reply Time (c): Length, Hashtag (a): Length, Hashtag, Capt. Count, Reply Time (b): Content, Word Order, Slang Word, NE, Info. Cap., Mention Count, Mention Pos., Word Repeat (c): Is Reply (a): Content, Word Order, Hashtag, NE, Word Repeat (b): Length, Capt. Count, Mention Count, Mention Pos, Is Reply Used pre-trained embeddings and so did not study this effect. Used pre-trained embeddings and so did not study this effect. Used pre-trained embeddings and so did not study this effect. Used pre-trained embeddings and so did not study this effect. LDA (a): Hashtag (b): Hashtag BOM DSSM (a): Word Order, NE (b): Word Order, NE Best in none CDSSM (a): Hashtag (b): Hashtag Best in none PV STV T2V (a): Content, Mention Count, Is Reply, Word Repeat (b): Content, Capt. Count, Men- tion Count, Mention Pos., Is Re- ply, Word Repeat (b): Length, Info. Capt CNN SCBOW (a): Hashtag (b): Hashtag (a): Info. Capt (c): Content, Word Order, Hash- tag, NE, Info. Capt, Mention Count, Reply Time (a): Length (c): Length LSTM BLSTM (a): Slang Words, Capt. Count, Mention Pos. (c): Slang Words, Capt. Count, Mention Pos., Is Reply (c) Word Repeat FastText d e s i v r e p u s n U d e s i v r e p u S (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Count, Mention Pos. Used pre-trained embeddings and so did not study this effect. Used pre-trained embeddings and so did not study this effect. (b): Length, Content, Word Order, Slang Words, Hashtag, NE, Capt. Count, Mention Count, Reply Time, Word Repeat, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Word Order, Capt. Count, Mention Count, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Word Order, Capt. Count, Mention Pos. (b): Content, Word Order, Slang Words, Hashtag, NE, Capt. Count, Mention Count, Is Reply, Reply Time, Word Repeat, Mention Pos. (b): Content, Word Order, Slang Words, Hashtag, NE, Capt. Count, Mention Count, Reply Time, Word Repeat, Mention Pos. (a): Is Reply, Reply Time, Word Repeat (b): Length, Word Order, Capt. Count, Mention Pos. (a): Length, Slang Words, Hashtag, NE, Capt. Count, Info. Capt, Mention Count, Is Reply, Word Repeat, Mention Pos. (b): Content Table V: Elementary Property Prediction Task F1-Score (%) - Performance Comparison / d e s i v r e p u s n U Model Task 37.83 BOW 25.11 LDA 47.64 BOM DSSM 57.76 CDSSM 47.75 13.58 PV STV 71.85 T2V 73.58 SCBOW 32.13 d CNN 59.48 99.79 LSTM BLSTM 98.72 FastText 24.56 Length Content Word Order 60.36 60.62 61.25 59.01 57.66 60.92 57.7 60.62 58.39 61.13 60.74 60.85 60.06 97.37 97.72 98.67 98.57 98.09 94.9 98.85 98.36 97.94 97.71 97.39 97.47 92.15 e s i v r e p u S Slang Words 78.13 76.82 75.26 76.89 69.8 76.09 76.66 62.34 74.24 77.42 76.24 80.52 67.48 Hash tag 99.28 99.35 99.33 99.33 99.35 85.61 99.32 99.32 99.35 99.31 99.28 99.28 89.11 Named Entity 89.66 97.24 98.06 97.16 97.41 98.02 97.92 92.93 97.79 91.38 90.36 90.89 78.89 Capitalization Count 37.59 55.25 59.1 69.57 62.42 33.14 72.28 71.81 43.32 86.32 89.23 89.73 76.14 A. Property Prediction Task Accuracy We summarize the results of all the property prediction tasks in Table V. For the textual tasks, we observe the following. (1) Length prediction turns out to be a difficult task for most of the models. Models which rely on the recurrent architectures such as LSTM, STV, T2V have sufficient capacity to perform well in modeling the tweet length. PV performs the worst due to the simple Word2Vec structure on this complex task. FastText expectedly loses the length information and performs as the worst supervised model. (2) BLSTM is the best in modeling slang words. BLSTM outperforms the LSTM variant in all the tasks except 'Content', which signifies the power of using the information flowing from both the directions of the tweet. (3) STV tops in modeling the content. This is due to the very large embedding size used for every tweet (4800 dimensions). Is Reply 78.14 60.12 66.25 76.47 73.92 54.68 96.41 95.73 60.38 92.66 92.39 92.76 74.08 Reply Time 35.98 28.03 28.43 29.08 28.49 27.58 29.25 31.59 28.39 31.73 28.46 27.99 28.35 Mention Count 87.02 69.31 74.26 78.86 75.48 45.98 98.94 86.5 70.62 91.04 89.49 89.83 83.19 Mention Position 75.2 36.85 45.64 52.46 44.38 21.3 68.46 66.29 33.59 77.15 80.26 91.2 61.31 Word Repetition in Conversation 86.92 91.71 92.26 91.93 92.47 90.71 92.82 89.76 92.49 87.28 85.58 86.43 70.58 Informative Capitalization 72.39 68.66 73.13 71.64 68.66 70.89 70.89 82.84 69.4 88.81 61.19 75.37 57.46 Surprisingly, T2V which is expected to perform well on the 'Content' task because of its ability to work at a finer level, i.e., characters performs the worst. In fact T2V does not outperform other models in any task, which could be mainly due to the fact that the hashtags which are used for supervision in learning tweet representations reduce the generalization capability of the tweets beyond hashtag prediction. Prediction tasks such as 'Content' and 'Hashtag' seem to be less difficult as all the models perform nearly optimal for them. The superior performance of all the models for the 'Content' task in particular is unlike the relatively lower performance reported in [17], mainly because of the short length of the tweets. (4) BOM performed well on identifying the named entities in the tweet. BOM is raised from the generic word-word statistics, which seems to be just enough for remembering NEs. (5) For the capitalization tasks such as 'Capitalization Count' and 'Informative Capitalization', we observe the supervised models perform better than the unsupervised models. For the social tasks we observe the following. (1) On average, supervised models work better than unsupervised ones on Mention Count, Mention Position and Is Reply tasks. For the other two social tasks, unsupervised models are marginally better. (2) STV is good for most of the social tasks including 'Mention Count', 'Is Reply' and 'Word Repetition'. We believe the main reason for STV's performance is two-fold: (a) the inter-sentential features extracted from STV's encoder by the prediction of the surrounding sentences in the books corpus contains rich social elements that are vital for social tasks (e.g., user profiling), and (b) the recurrent structure in both the encoder and decoder persists useful information in the memory nicely. The second claim is further substantiated by observing the poor performance of SCBOW whose objective is also similar to STV, but with a simpler architecture, i.e., word vector averaging. B. Sensitivity to Tweet Length This setup captures the behavior of the model with the increase in the context size, which is defined in terms of number of words. Figure 1 provides the statistics on number of tweets in each bin of tweet length. For tasks such as 'Word Order', 'Mention Position' and 'Capitalization Count', we see the performance of all the models (Figure 2) to be negatively correlated with the tweet length. On the other hand, there is no correlation between the tweet length and the performance of all the models for the tasks such as 'Slang Words', 'Content', 'Hashtag', 'Named Entities', 'Informative Capitalization' and 'Is Reply'. For 'Is Reply' task, we see a positive correlation between the tweet length and the performance of all the models (Figure 2). But there is no such correlation for other social tasks such as 'Reply Time' and 'Word Repetition'. Fig. 1: Statistics on Number of Tweets in each Bin of Tweet Length C. Sensitivity to Representation Size In representation learning, low embedding size results in a poor model performance as the model does not have enough capacity ('underfits') to retain information. On the other hand, high embedding size also results in poor performance as the model has redundant bits of information ('overfits') which has a negative effect. The optimal strategy mostly is to do grid search for the size that gives superior performance. Specifically we build models with the embedding size from {10, 25, 50, 100, 200}. Figure 3 displays the plots for all the models for this setup. We find that performance of all the supervised models except FT is positively correlated with the representation size for most of the property prediction tasks. We discover that FT which relies on a simple operation of word vector average to represent a tweet is invariant to the representation size. This Table VI: BOW versus Paragraph2Vec - Performance Compar- ison (F1-Score (%)) on Multiple Tasks SA Model/Task BOW 62.77 90.44 64.62 80.80 82.06 Paragraph2Vec 52.59 36.05 55.73 77.53 30.34 TP W K EI result is surprising as FT yields good performance with such a small embedding size of 10 (which indeed is the optimal hyper- parameter as suggested by the authors). We suggest to use FT for competitive performance on low-resource applications – less memory (e.g., mobile), and faster computation. D. Connections with the performance on downstream appli- cations In this subsection, we will attempt to establish the correlation between the model performance on the various elementary property prediction tasks and the model performance on the various real applications. Sentiment Analysis: Giachanou et al. [14] showed that sen- timent analysis is typically aided by features such as content, slang words, mention count, hashtags and named entities. We observe that STV is the only unsupervised model to encode all the five task-specific relevant features well thereby outper- forming the other models for this task. On the other hand, PV encodes relatively the least number of relevant features thereby faring poorer than BOW (as we see later) for this task. We find that most of the supervised models (excluding FastText) capture the task-specific features well. Hashtag Prediction: The salient features for hashtag predic- tion [23] include length, slang words and hashtag itself. We observe that none of the unsupervised models is able to encode all the relevant features. Since most of the supervised models are able to encode all the features, we conclude that nature of the task is strictly supervised. Named Entity Recognition: This task is benefitted by fea- tures such as slang words and capitalization [20]. This task also seems to be strictly supervised in nature as none of the unsupervised model is able to encode both the features. The recurrent models are able to capture both features successfully and clearly explains why these models are the state-of-the- art [24] for this task. Response Prediction: This is a social task to identify if a given tweet can receive a response [25]. Content, hashtags and mention count are the vital features for this task. STV which is trained on a conversational context models all the features successfully. It is interesting to see that the recurrent models are also able to encode all the relevant features. This showcases the importance of recurrent models for the social tasks. E. A Case Study of BOW vs Paragraph2Vec Table V shows that Paragraph2Vec is not good at encoding elementary tweet properties. To validate this with respect to high level applications, we compare Paragraph2Vec with BOW for a wide variety of Twitter applications. Specifically, we evaluate the models for five applications: (1) predict whether the sentiment of tweet is positive, negative or neutral (SA) [26], (2) predict the entity the tweet belongs to (EI) [27], (3) predict the priority of the topic the tweet belongs to (TP) [27], 05000100001500020000250003000035000400004500012345678# tweetsbin sizeTrainValTest (a) Length (b) Content (c) Word Order (d) Slang Words (e) Hashtag (f) Named Entities (g) Capitalization Count (h) Informative Capitalization (i) Mention Count (j) Mention Position (k) Is Reply (l) Reply Time (m) Word Repetition in Conversation Fig. 2: Performance of the model w.r.t Tweet Length (4) predict the day of the weather referred in the tweet 5 (W), and (5) predict the kind of the weather referred in the tweet (K). Table VI reports the scores of the best performing Paragraph2Vec with the variant (BOW or Distributed Memory) and representation size ({10, 25, 50, 100, 200}) tuned using the validation set. From the results, we find that Paragraph2Vec has poor performance for all the tasks compared to BOW. Using this pair of models for various tasks, we have shown that performance of the models on the elementary tweet properties can help us estimate the performance of the models on various applications. F. Overall Insights Our extensive experimentation with a large number of models for important textual and social network properties of tweets, provides the following insights. • Length prediction is the most difficult textual task while content prediction is the easiest. Word repetition is the easiest social task while reply time prediction is the most complicated. • Bi-directional LSTMs and Skip-Thought vectors (STV) best encode the textual and social properties of tweets respectively. Paragraph2Vec performs the worst. 5https://www.kaggle.com/c/crowdflower-weather-twitter • FastText is the best model for low resource applications providing very little degradation with reduction in em- bedding size. • Relative performance of the models does not change based on tweet length. All models behave in the same way to variation in tweet length. VII. CONCLUSION In this paper, we tried to interpret multiple tweet representa- tions in terms of the accuracy to which they encode elementary tweet properties (both textual and social). This helped us understand the weaknesses and strengths of such represen- tations in an application independent, fine-grained manner. Based on such an evaluation, we conclude that Bi-directional LSTMs (BLSTMs) and Skip-Thought Vectors (STV) best encode the textual and social properties of tweets respectively. Also, FastText with huge information encoded in its small representation is the best model for low resource applications. In future, we plan to work on interpretation of distributed representations of nodes in a network wrt various interesting network properties. REFERENCES [1] P. Huang, X. He, J. Gao, L. Deng, A. Acero, and L. P. Heck, "Learning Deep Structured Semantic Models for Web Search using Clickthrough Data," in CIKM, 2013, pp. 2333–2338. 00.10.20.30.40.50.60.70.80.911357911131517190.960.9650.970.9750.980.9850.990.9951357911131517190.40.50.60.70.80.9113579111315171900.10.20.30.40.50.60.70.80.911357911131517190.80.820.840.860.880.90.920.940.960.9811357911131517190.70.750.80.850.90.95113579111315171900.10.20.30.40.50.60.70.80.9113579111315171900.10.20.30.40.50.60.70.80.911357911131517190.20.30.40.50.60.70.80.9113579111315171900.10.20.30.40.50.60.70.80.911357911131517190.40.50.60.70.80.911357911131517190.150.20.250.30.350.41357911131517190.60.650.70.750.80.850.90.95113579111315171900.10.20.30.40.50.60.70.80.91135791113151719BOWLDABOMDSSMCDSSMPVSTVT2VSCBOWCNNLSTMBLSTMFT (a) Length (b) Content (c) Word Order (d) Slang Words (e) Hashtag (f) Named Entities (g) Capitalization Count Informative Capitaliza- (h) tion (i) Mention Count (j) Mention Position (k) Is Reply (l) Reply Time (m) Word Repetition in Conversation Fig. 3: Sensitivity of the Models to Representation/Embedding Size [2] Y. Shen, X. He, J. Gao, L. Deng, and G. Mesnil, "A Latent Semantic Model with Convolutional-Pooling Structure for Information Retrieval," in CIKM, 2014, pp. 101–110. [3] Q. V. Le and T. Mikolov, "Distributed Representations of Sentences and Documents," in ICML, 2014, pp. 1188–1196. [4] D. Tang, F. Wei, B. Qin, N. Yang, T. Liu, and M. Zhou, "Sentiment Embeddings with Applications to Sentiment Analysis," TKDE, vol. 28, no. 2, pp. 496–509, 2016. [5] R. Kiros, Y. Zhu, R. Salakhutdinov, R. S. Zemel, R. Urtasun, A. Tor- ralba, and S. Fidler, "Skip-Thought Vectors," in NIPS, 2015, pp. 3294– 3302. [6] F. Hill, K. Cho, and A. Korhonen, "Learning Distributed Representa- tions of Sentences from Unlabelled Data," in NAACL-HLT, 2016, pp. 1367–1377. [7] A. Graves, A. Mohamed, and G. E. Hinton, "Speech Recognition with Deep Recurrent Neural Networks," in ICASSP, 2013, pp. 6645–6649. [8] T. Kenter, A. Borisov, and M. de Rijke, "Siamese CBOW: Optimizing Word Embeddings for Sentence Representations," in ACL, 2016. [9] B. Dhingra, Z. Zhou, D. Fitzpatrick, M. Muehl, and W. W. Cohen, "Tweet2Vec: Character-Based Distributed Representations for Social Media," in ACL, 2016. [10] Y. Bengio, A. C. Courville, and P. Vincent, "Representation Learning: A Review and New Perspectives," TPAMI, vol. 35, no. 8, pp. 1798–1828, 2013. [11] Y. Wang, H. Huang, C. Feng, Q. Zhou, J. Gu, and X. Gao, "CSE: conceptual sentence embeddings based on attention model," in ACL, 2016, pp. 505–515. [12] T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean, "Distributed Representations of Words and Phrases and Their Compositionality," in NIPS, 2013, pp. 3111–3119. [13] K. S. Tai, R. Socher, and C. D. Manning, "Improved semantic repre- sentations from tree-structured long short-term memory networks," in ACL, 2015, pp. 1556–1566. [14] A. Giachanou and F. Crestani, "Like it or not: A Survey of Twitter Sentiment Analysis Methods," CSUR, vol. 49, no. 2, pp. 28:1–28:41, 2016. [15] Y. Kim, "Convolutional Neural Networks for Sentence Classification," in EMNLP, 2014, pp. 1746–1751. [16] A. Joulin, E. Grave, P. Bojanowski, and T. Mikolov, "Bag of Tricks for Efficient Text Classification," CoRR, vol. abs/1607.01759, 2016. [17] Y. Adi, E. Kermany, Y. Belinkov, O. Lavi, and Y. Goldberg, "Fine- grained Analysis of Sentence Embeddings Using Auxiliary Prediction Tasks," CoRR, vol. abs/1608.04207, 2016. [18] A. Go, R. Bhayani, and L. Huang, "Twitter Sentiment Classification using Distant Supervision," Technical Report, Stanford, 2009. J. Li, A. Ritter, and E. H. Hovy, "Weakly Supervised User Profile Extraction from Twitter," in ACL, 2014, pp. 165–174. [19] [20] A. Ritter, S. Clark, Mausam, and O. Etzioni, "Named Entity Recognition in Tweets: An Experimental Study," in EMNLP, 2011, pp. 1524–1534. [21] A. Ritter, C. Cherry, and B. Dolan, "Unsupervised Modeling of Twitter Conversations," in NAACL-HLT, 2010, pp. 172–180. J. Pennington, R. Socher, and C. D. Manning, "GloVe: Global Vectors for Word Representation," in EMNLP, 2014, pp. 1532–1543. [22] [23] O. Tsur and A. Rappoport, "What's in a Hashtag?: Content based Prediction of the Spread of Ideas in Microblogging Communities," in WSDM. ACM, 2012, pp. 643–652. [24] Q. Zhang, Y. Wang, Y. Gong, and X. Huang, "Keyphrase Extraction using Deep Recurrent Neural Networks on Twitter," in EMNLP, 2016, pp. 836–845. [25] Y. Artzi, P. Pantel, and M. Gamon, "Predicting Responses to Microblog Posts," in NAACL-HLT, 2012, pp. 602–606. [26] P. Nakov, A. Ritter, S. Rosenthal, F. Sebastiani, and V. Stoyanov, "SemEval-2016 Task 4: Sentiment Analysis in Twitter," in SemEval, 2016. [27] E. Amig´o, J. Carrillo de Albornoz, I. Chugur, A. Corujo, J. Gonzalo, E. Meij, M. de Rijke, and D. Spina, "Overview of RepLab 2014: Author Profiling and Reputation Dimensions for Online Reputation Management," in CLEF, 2014, pp. 307–322. 0.20.30.40.50.60.70.80.91BOWLDABOMCNNLSTMBLSTMFT0.860.880.90.920.940.960.981BOWLDABOMCNNLSTMBLSTMFT0.50.550.60.650.70.750.8BOWLDABOMCNNLSTMBLSTMFT0.50.550.60.650.70.750.80.850.9BOWLDABOMCNNLSTMBLSTMFT0.880.90.920.940.960.981BOWLDABOMCNNLSTMBLSTMFT0.70.750.80.850.90.951BOWLDABOMCNNLSTMBLSTMFT0.450.50.550.60.650.70.750.80.850.9BOWLDABOMCNNLSTMBLSTMFT0.30.40.50.60.70.80.9BOWLDABOMCNNLSTMBLSTMFT0.60.650.70.750.80.850.90.95BOWLDABOMCNNLSTMBLSTMFT0.20.30.40.50.60.70.80.91BOWLDABOMCNNLSTMBLSTMFT0.50.550.60.650.70.750.80.850.90.95BOWLDABOMCNNLSTMBLSTMFT0.250.270.290.310.330.350.370.39BOWLDABOMCNNLSTMBLSTMFT0.650.70.750.80.850.90.95BOWLDABOMCNNLSTMBLSTMFT00.10.20.30.40.50.60.70.80.91BOWLDABOMCNNLSTMBLSTMFT102550100200250005000075000
1907.10362
1
1907
2019-07-24T11:01:24
Translator2Vec: Understanding and Representing Human Post-Editors
[ "cs.CL" ]
The combination of machines and humans for translation is effective, with many studies showing productivity gains when humans post-edit machine-translated output instead of translating from scratch. To take full advantage of this combination, we need a fine-grained understanding of how human translators work, and which post-editing styles are more effective than others. In this paper, we release and analyze a new dataset with document-level post-editing action sequences, including edit operations from keystrokes, mouse actions, and waiting times. Our dataset comprises 66,268 full document sessions post-edited by 332 humans, the largest of the kind released to date. We show that action sequences are informative enough to identify post-editors accurately, compared to baselines that only look at the initial and final text. We build on this to learn and visualize continuous representations of post-editors, and we show that these representations improve the downstream task of predicting post-editing time.
cs.CL
cs
Translator2Vec: Understanding and Representing Human Post-Editors Ant´onio G´ois Unbabel Lisbon, Portugal Andr´e F. T. Martins Unbabel & Instituto de Telecomunicac¸ oes Lisbon, Portugal [email protected] [email protected] 9 1 0 2 l u J 4 2 ] L C . s c [ 1 v 2 6 3 0 1 . 7 0 9 1 : v i X r a Abstract The combination of machines and humans for translation is effective, with many stud- ies showing productivity gains when hu- mans post-edit machine-translated output instead of translating from scratch. To take full advantage of this combination, we need a fine-grained understanding of how human translators work, and which post-editing styles are more effective than others. In this paper, we release and an- alyze a new dataset with document-level post-editing action sequences, including edit operations from keystrokes, mouse ac- tions, and waiting times. Our dataset com- prises 66,268 full document sessions post- edited by 332 humans, the largest of the kind released to date. We show that ac- tion sequences are informative enough to identify post-editors accurately, compared to baselines that only look at the initial and final text. We build on this to learn and vi- sualize continuous representations of post- editors, and we show that these representa- tions improve the downstream task of pre- dicting post-editing time. Introduction 1 Computer-aided translation platforms for interac- tive translation and post-editing are now com- monly used in professional translation services (Alabau et al., 2014; Federico et al., 2014; Green et al., 2014; Denkowski, 2015; Hokamp, 2018; Sin-wai, 2014; Kenny, 2011). With the in- creasing quality of machine translation (Bahdanau c(cid:13) 2019 The authors. This article is licensed under a Creative Commons 4.0 licence, no derivative works, attribution, CC- BY-ND. et al., 2014; Gehring et al., 2017; Vaswani et al., 2017), the translation industry is going through a transformation, progressively shifting gears from "computer-aided" (where MT is used as an in- strument to help professional translators) towards human-aided translation, where there is a hu- man in the loop who only intervenes when needed to ensure final quality, and whose productivity is to be optimized. A deep, data-driven understand- ing of the human post-editing process is key to achieve the best trade-offs in translation efficiency and quality. What makes a "good" post-editor? What kind of behaviour shall an interface pro- mote? There is a string of prior work that relates the difficulty of translating text with the cognitive load of human translators and post-editors, based on in- dicators such as editing times, pauses, keystroke logs, and eye tracking (O'Brien, 2006; Doherty et al., 2010; Lacruz et al., 2012; Balling and Carl, 2014, see also §6). Most of these studies, however, have been performed in controlled environments on a very small scale, with a limited number of professional translators and only a few sessions. A direct use of human activity data for understand- ing and representing human post-editors, towards improving their productivity, is still missing, ar- guably due to the lack of large-scale data. Under- standing how human post-editors work could open the door to the design of better interfaces, smarter allocation of human translators to content, and au- tomatic post-editing. In this paper, we study the behaviour of hu- man post-editors "in the wild" by automatically examining tens of thousands of post-editing ses- sions at a document level. We show that these detailed editor activities (which we call action se- quences, §2) encode useful additional information besides just the initial machine-translated text and the final post-edited text. This is aligned to re- cent findings in other domains: Yang et al. (2017) and Faruqui et al. (2018) have recently shown that Wikipedia page edits can represent interesting lin- guistic phenomena in language modeling and dis- course. While prior work analyzed the cognitive behaviour of post-editors and their productivity by collecting a few statistics, we take a step forward in this paper, using state-of-the-art machine learning techniques to represent editors in a vector space (§4). These representations are obtained by train- ing a model to identify the editor based on his ac- tion sequences (§3). This model achieves high ac- curacy in predicting the editor's identity, and the learned representations exhibit interesting correla- tions with the editors' behaviour and their produc- tivity, being effective when plugged as features for predicting the post-editing time (§5). Overall, we use our action sequence dataset to address the following research questions: 1. Editor identification (§3): are the post- editors' activities (their action sequences) informative enough to allow discriminating their identities from one another (compared to just using the initial machine-translated text and the final post-edited one)? 2. Editor representation (§4): can the post- editors' activities be used to learn meaningful vector representations, such that similar ed- itors are clustered together? Can we inter- pret these embeddings to understand which activity patterns characterize "good" editors (in terms of translation quality and speed)? 3. Downstream tasks (§5): do the learned ed- itor vector representations provide useful in- formation for downstream tasks, such as pre- dicting the time to translate a document, com- pared to pure text-based approaches that do not use them? We base our study on editor-labeled action se- quences for two language pairs, English-French and English-German, which we make available for future research. In both cases, we obtain positive answers to the three questions above. 2 Post-Editor Action Sequences A crucial part of our work is in converting raw keystroke sequences and timestamps into action Action Replace Insert Delete Insert Block Delete Block Jump Forward Jump Back Jump Sentence Forward Jump Sentence Back Mouse Clicks Mouse Selections Wait Stop Symbol Appended Info R I D BI BD JF JB JSF JSB MC MS W S new word new word old word new block of words old block of words # words # words # sentences # sentences # mouse clicks # mouse selections time (seconds) -- Table 1: Text-editing and non-editing actions. sequences -- sequences of symbols in a finite al- phabet that describe word edit operations (inser- tions, deletions, and replacements), batch opera- tions (cutting and pasting text), mouse clicks or selections, jump movements, and pauses. Each action sequence corresponds to a single post-editing session, in which a human post-edits a document. The starting point is a set of source doc- uments (customer service email messages), which are sent for translation to Unbabel's online trans- lation service. The documents are split into sen- tences and translated by a domain-adapted neu- ral machine translation system based on Marian (Junczys-Dowmunt et al., 2018). Finally, each document is assigned to a human post-editor to correct eventual translation mistakes.1 These post- editing sessions are logged, and all the keystroke and mouse operation events are saved, along with timestamps. A preprocessing script converts these raw keystrokes into word-level action sequences, as we next describe, and a unique identifier is ap- pended that represents the human editor. The preprocessing for converting the raw character-level keystroke data into word-level ac- tions is as follows. We begin with a sequence of all intermediate states of a document between the machine-translated and the post-edited text, containing changes caused by each keystroke. We track the position of the word currently be- ing edited and store one action summarizing the change in that word. A single keystroke may also 1The human post-editors are native or proficient speakers of both source and target languages, although not necessar- ily professional translators. They are evaluated on language skills and subject to periodic evaluations by Unbabel. Editors have access to whole documents when translating, and they are given content-specific guidelines, including style, regis- ter, etc. Source MT PE Actions Hey there, Some agents do speak Spanish, otherwise our system will translate :) Best, <Name> Bonjour, Certains agents parlent espagnol, sinon notre syst`eme se traduira par :) Cordialement, <Name> Bonjour, Certains agents parlent espagnol, sinon notre syst`eme traduit :) Cordialement, <Name> W:23 MC:1 D:se R:traduit JSF:1 MS:1 JF:8 JB:1 W:2 MC:1 JF:1 D:par MS:1 W:2 MS:1 S: -- W:7 Table 2: Example of a document and corresponding action sequence. We mark in red the MT words that have been corrected and in blue their replacement. The actions used here were W (wait), JSF (jump sentence forward), JF (jump forward), D (delete), MC (mouse clicks), MS (mouse selections), JB (jump back), R (replace) and S (stop). cause simultaneous changes to several words (e.g. when pasting text or deleting a selected block), and we reserve separate actions for these. Overall, five text-editing actions are considered: inserting (I), deleting (D), and replacing (R) a single word, and inserting (BI) and deleting (BD) a block of words. Each action is appended with the corresponding word or block of words, as shown in Table 1. Other actions, dubbed non-editing actions, do not change the text directly. Jump-forward (JF) and jump-backward operations (JB) count the dis- tance in words between two consecutive edits. An- other pair of actions informs when a new sen- tence is edited: a sentence jump (JSF/JSB) indi- cates that we moved a certain number of sentences forth/back since the previous edit. Mouse clicks (MC) and mouse selections (MS) count their occur- rences between two consecutive edits. Wait (W) counts the seconds between the beginning of two consecutive edits. Finally, stop (S) marks the end of the post-editing session. Since we do not want to rely on lexical informa- tion to identify the human post-editors, only the 50 most frequent words were kept (most containing punctuation symbols and stop-words), with the re- maining ones converted to a special unknown sym- bol (UNK). Moreover, the first waiting time is split in two: the time until the first keystroke occurs and, in case the first keystroke is not part of the first ac- tion (e.g. a mouse click), a second waiting time until the first action begins. Table 2 shows an example of a small document, along with the editor's action sequence. The edi- tor began on sentence 2 ("Certains agents...") and the word on position 9, since there was a jump for- ward of 1 sentence and 8 words. After deleting "se", position 9 became "traduira". Since the edi- tor opted to delete "par" (using a mouse selection) before changing the verb, there is a jump forward of 1 word to position 10. Then we have a jump back of 1 before changing the verb to "traduit". Datasets. We introduce two datasets for this task, one for English-French (En-Fr) and an- other for English-German (En-De). For each dataset, we provide the action sequences for full documents, along with an editor identifier. To ensure reproducibility of our results, we release both datasets as part of this paper, avail- able in https://github.com/Unbabel/ translator2vec/releases/download/ v1.0/keystrokes_dataset.zip. For anonymization purposes, we convert all editor names and the 50 tokens in the word vocabulary to numeric identifiers. Statistics of the dataset are shown in Table 3: it is the largest ever released dataset with post-editing action sequences, and the only one we are aware of with document-level information.2 Each document corresponds to a customer service email with an average of 116.6 tokens per document. Each sentence has an average length of 9.4 tokens. 2The closest comparable dataset was released by Specia et al. (2017) in the scope of the QT21 project, containing 176,476 sentences spanning multiple language pairs (about 4 times less), with raw keystroke sequences being available by re- quest. In contrast to ours, their units are sentences and not full documents, which precludes studying how human post- editors jump between sentences when translating a document. Figure 1: Left: our Action Seq model for editor identification. Right: our model for post-editing time prediction. train dev test train dev test En-Fr En-De Total # docs 17,464 5,514 9,441 17,403 6,722 9,724 66,268 # sents 154,026 52,366 86,111 169,478 66,521 98,920 627,422 # words 1,895,389 659,675 1,072,807 2,053,407 826,791 1,221,319 7,729,388 Table 3: Number of documents, sentences, and words in En- glish source text per dataset. There are 149 unique editors across all En-Fr datasets, and 183 in En-De. 3 Editor Identification We now make use of the dataset just described to answer the three research questions stated at the end of §1, starting with editor identification. 3.1 Data Preparation For this experiment, we took the action sequence dataset described in §2 and selected a small num- ber of human translators for both language pairs who post-edited a number of documents above a threshold: this yielded 6 editors for En-Fr and 7 editors for En-De. To ensure balanced datasets, we filtered them to contain the same number of samples per selected editor. This filtering yielded a total of 998/58/58 training/dev/test documents per editor for En-Fr, and 641/128/72 for En-De. A random baseline for this dataset would obtain an editor identification accuracy of 1/6 = 16.7% for En-Fr and 1/7 = 14.3% for En-De. 3.2 A Model for Editor Identification Let (cid:104)x1, . . . , xL(cid:105) be an action sequence produced by a post-editor y. To identify the editor of a task, we build a model P (y x1, . . . , xL) using a neural network as we next describe (shown in Figure 1). Each action xi is first associated to a one-hot vector. All numeric actions are grouped into bins -- e.g. waiting times of 200 seconds and higher all correspond to the same one-hot repre- sentation. Bins were defined manually, providing higher granularity to small values than to larger ones.3 Each one-hot is then mapped to a learn- able embedding, and the sequence of embeddings is fed to a 2-layer bidirectional LSTM (biLSTM; Hochreiter and Schmidhuber (1997); Graves and Schmidhuber (2005)), resulting in two final states ←− −→ h . Then we concatenate both, apply dropout h , (Srivastava et al., 2014) and feed them to a feed- forward layer with a ReLU activation (Glorot et al., 2011) to form a vector h. This vector is taken as the representation of the action sequence. Finally, we define P (y x1, . . . , xL) = softmax(W h + b). We call this model Action Seq, since it exploits information from the action sequences. 3.3 Baselines To assess how much information action sequences provide about human editors beyond the initial (machine translation) and final (post-edited) text, we implemented various baselines which do not use fine-grained information from the action se- quences. All use pre-trained text embeddings from FastText (Joulin et al., 2017), and they are all tuned for dropout and learning rate: • One using the machine-translated text only (MT). Since this text has not been touched by the human post-editor, we expect this system to perform similarly to the random baseline. The goal of this baseline is to control whether there is a bias in the content each editor receives that could discriminate her identity. It uses word embeddings as input to a biLSTM, followed by feed-forward and softmax layers. 3We used {0, . . . , 5, 7, 10, 15, 20, 30, 50, 75, 100, 150, 200+} for wait and jump events (in seconds and word positions, respectively); and {0, . . . , 5, 7, 10+} for sentence jumps and mouse events (in sentence positions and clicks). • Another one using the posted-edited text only (PE). This is used to control for the linguistic style of the post-editor. We expect this to be a weak baseline, since although there are positive results on translator stylometry (El-Fiqi et al., 2019), the task of post-editing provides less op- portunity to leave a fingerprint than if writing a translation from scratch. The architecture is the same as in the MT baseline. • A baseline combining both MT and PE using a dual encoder architecture (MT + PE), inspired by models from dialogue response (Lowe et al., 2015; Lu et al., 2017). This baseline is stronger than the previous two, since it is able to look at the differences between the initial and final text produced by the post-editor, although it ig- nores the process by which these differences have been generated. Two separate biLSTMs encode the two sequences of word embeddings, the final encoded states are concatenated and fed to a feed-forward and a softmax layer to provide the editors' probabilities. • Finally, a stronger baseline (MT + PE + Att) that is able to "align" the MT and PE, by aug- menting the dual encoder above with an atten- tion mechanism, inspired by work in natural lan- guage inference (Rocktaschel et al., 2016). The model resembles the one in Figure 1 (right), with a softmax output layer and without the editor representation layer. Two separate biL- STMs are used to encode the machine-translated and the post-edited text. The final state of the MT is used to compute attention over the PE, then this attention-weighted PE is concate- nated with MT's final state and passed through a feed-forward layer. Symmetrically we obtain a representation from PE's final state and an attention-weighted MT. Finally both vectors are concatenated and turned into editors' probabili- ties through another feed-forward layer. Additionally, we prepare another baseline (Delta) as a tuple with meta information contain- ing statistics about the difference between the ini- tial and final text (still not depending on the ac- tion sequences). This tuple contains the following 5 elements: a count of sentences in the document, minimum edit distance between MT and PE, count of words in the original document, in MT and in PE. Each of these elements is binned and mapped to a learnable embedding. The 5 embeddings are En-De (%) En-Fr (%) Delta MT PE MT + PE MT + PE + Att Action Seq 16.15 18.21 27.38 26.63 30.12 84.37 26.09 16.44 30.00 31.78 35.06 67.07 Table 4: Results of model and baselines for editor identifica- tion. Reported are average test set accuracies of 5 runs, with 7 editors for En-De and 6 editors for En-Fr. En-De (%) En-Fr (%) Action Seq w/out editing actions w/out mouse info w/out waiting time w/out 1st waiting time only editing actions only mouse info only waiting time only 1st waiting time 83.31 80.60 75.49 80.42 78.60 60.20 56.43 53.53 24.22 73.16 69.37 66.38 70.92 71.15 59.08 55.06 44.02 23.11 Table 5: Ablations studies for editor identification. Reported are average development set accuracies of 5 runs, with 7 edi- tors for En-De and 6 editors for En-Fr. concatenated into a vector e, followed by a feed- forward layer and a softmax activation. 3.4 Editor Identification Accuracy Table 4 compares our system with the baselines above. Among the baselines, we observe a grad- ual improvement as models have access to more information. The fact that the MT baseline per- forms closely to the random baseline is reassuring, showing that there is no bias in the type of text that each editor receives. As expected, the dual en- coder model with attention, being able to attend to each word of the MT and post-edited text, is the one which performs the best, surpassing the ran- dom baseline by a large margin. However, none of these baselines have a satisfactory performance on the editor identification task. By contrast, the accuracies achieved by our pro- posed model (Action Seq) are striking: 84.37% in En-De and 67.07% in En-Fr, way above the closest baselines. This large gap confirms our hypothesis that the editing process itself contains informa- tion which is much richer than the initial and final text only. Ablation studies. To understand the importance of each action type in predicting the editor's iden- tity, we conduct a series of ablation studies and re- port development set accuracies in Table 5. These experiments involve removing mouse information, time information, initial waiting time or editing ac- tions. Also, we try keeping only each of the previ- ous four. We find that all action types contribute to the global accuracy, although to different extents. Also, some action types achieve high performance on their own. Somewhat surprisingly, mouse infor- mation alone achieves remarkably high accuracy. Although waiting times also perform well on their own, removing them has little impact on the final score. 4 Editor Representation The previous section has shown how the action se- quences are very effective for identifying editors. As a by-product, the Action Seq model used for that task produced an internal vector h that repre- sents the full post-editing session. This suggests a strategy for obtaining editor representations: simply average all such vectors from each editor. One way of looking at this is regarding editor iden- tification as an auxiliary task that assists us in find- ing good editor representations. This draws inspi- ration from previous work, such as Mikolov et al. (2013), as well as its applications to recommenda- tion systems (Grbovic et al., 2015, 2016). In the last two works, an auxiliary task also helps to pro- vide a latent representation of an object of interest. Visualization of translation sessions. To visu- alize the vectors h produced during our auxiliary task, we use Parametric t-SNE (Maaten, 2009) for dimensionality reduction. Unlike the original t- SNE (Maaten and Hinton, 2008), the parametric version allows to reapply a learned dimensional- ity reduction to new data. This way it is possible to infer a 2D structure using the training data, and check how well it fits the test data. In Figure 2 we show a projection of vectors h for both language pairs, using a t-SNE model learned on the training set vectors; each color cor- responds to a different editor. In the training set (used to train both the editor identification model and the Parametric t-SNE) there is one clear clus- ter for each editor, in both languages. Using test set data, new tasks also form clusters which are closely related to the editors' identity. Some clus- ters are isolated while others get mixed near their (a) En-De training set (b) En-Fr training set (c) En-De test set (d) En-Fr test set Figure 2: Embeddings of each translation session in the edi- tor identification train and test sets, with editors identified by different colors. For each language, the dimensionality re- duction was learned by training parametric t-SNE (Maaten, 2009) on the train data, and then applying it to both train and test data. En-De contains 7 editors, each with 641 train and 72 test samples per editor. En-Fr contains 6 editors, each with 998 train and 58 test samples per editor. borders, possibly meaning that some editors be- have in a more distinctive manner than others. Visualization of editor representations. To represent an editor with a single vector, we aver- age the h's of all tasks of a given editor to obtain his representation. Figure 3 contains representa- tions for En-Fr editors (similar results have been achieved for En-De editors), using the exact same model as in Figure 2b to produce session embed- dings, and the same t-SNE model for visualization. To reduce noise we discard editors with less than 10 samples, keeping 117 out of 149 editors. In Fig- ure 3 we show percentiles for 3 editor features, us- ing one point per editor and setting color to repre- sent a different feature in each panel. In Figure 3a, color represents percentiles of average initial wait- ing time, and in Figure 3b, percentiles of counts of jump-backs per MT token. We can observe that the model learned to map high waiting times to the left and high counts of jump-backs to the right. In Fig- ure 3c we have mouse activity per user (percentiles of counts of mouse clicks and selections). Here we can see a distribution very similar to that of count of jump-backs. Mouse and JB (%) En-Fr En-De 80.75 59.62 1st WT and JB (%) −39.65 −31.11 Table 6: Pearson correlation between two pairs of variables: mouse actions / jump backs and first waiting time / jump backs. We hypothesize that there are two types of hu- man editors: those who first read the full document and then post-edit it left to right; and those who read as they type, and go back and forth. To check these hypothesis, we measure the Pearson correla- tion between two pairs of variables in Table 6. In- deed, there is a slight negative correlation between the average initial pause and the count of jump backs per word. This matches intuition, since a person who waited longer before beginning a task will probably have a clearer idea of what needs to be done in the first place. We also present the cor- relation between the count of mouse events (clicks and selections) and count of jump backs, which we observe to be very high. This may be due to the need to move between distant positions of the document, which is more commonly done with the mouse than with the keyboard. 5 Prediction of Post-Editing Time Finally, we design a downstream task with the goal of assessing the information contained in each translator's vector h and observing its applicability in a real-world setting. The task consists in predict- ing the post-editing time of a given job, which has been used as a quality estimation task in previous work (Cohn and Specia, 2013; Specia, 2011). As a baseline, we use the previously described dual en- coder with attention (Figure 1, right). The inputs are the word embeddings of the original document and of the machine translation. In the output layer, instead of predicting each editor's logit, we predict the logarithm of the post-editing time per source word, following Cohn and Specia (2013). We use mean squared error as the loss. For our proposed model, we augment this baseline by providing a "dynamic" representation of the human post-editor as described below. Dynamic editor representations. In order to obtain an editor's embedding in a real-time setting we do the following: For each new translation ses- sion, we store its corresponding embedding, keep- ing a maximum of 10 previous translations per ed- (a) First wait time (b) Jump-Backs (c) Mouse Events Figure 3: Embeddings of each En-Fr editor, mapped using the same parametric t-SNE as in Figure 2. In 3a we have average pause before beginning for each editor, in percentile. In 3b we have the count of jump-backs per MT token of each editor, also in percentile. In 3c we have percentiles of counts of mouse clicks and selections per editor. itor. Whenever an editor's embedding is required, we compute the average of his stored translations into a single vector. This allows updating the ed- itors' representations incrementally in a dynamic fashion, coping with the fact that editors change their behaviour over time as they learn to use the translation interface. To introduce a translator vector h into the pre- viously described baseline, we increase the input size of the feed-forward layer which receives both encoders' outputs, and we introduce h in this step by concatenating it to the encoders' outputs. Results. Both models are evaluated using Pear- son correlation between the predicted and real log- times. Results in Table 7 confirm our hypothesis that editor representations can be very effective for predicting human post-editing time, with consistent gains in Pearson correlation (+30.11% in En-Fr and +15.05% in En-De) over the base- line that does not use any editor information. Our approach also allows for initializing and updating editor embeddings dynamically, i.e. without hav- ing to retrain the time-prediction model.4 4This experiment also reveals that previous work on transla- tion quality estimation (Specia et al., 2018) using time predic- tions can have biased results if different types of translators 0.10.20.30.40.50.60.70.80.91.0 Using source text and MT (%) Adding dynamic editor embedding (%) En-Fr En-De dev test dev test 19.53 17.58 27.62 23.67 42.98 47.69 47.40 38.72 Table 7: Pearson correlation between real and predicted log- arithm of time per word in source text. 6 Related Work There is a long string of work studying the cog- nitive effort in post-editing machine translation. One of the earliest instances is O'Brien (2006), who investigates the relationship between pauses and cognitive effort in post-editing. This corre- lation has also been studied by examination of keystroke logs (Lacruz et al., 2012; Lacruz and Shreve, 2014). Our results further confirm this, and also identify other characteristics as a finger- print of the editors: mouse information and jumps. More recently, Moorkens and O'Brien (2015) compare novice and professional post-editors in terms of their suitability as research participants when testing new features of post-editing envi- ronments. They conclude that professionals are more efficient but less flexible to interface changes, which confirms the existence of several editor pro- files, not necessarily ones better than the others. Other small-scale studies identify editor be- haviour during translation. Asadi and S´eguinot (2005) distinguish between translators who plan ahead and those who type as they think. Daems and Macken (2019) identify personal prefer- ences between usage of mouse vs. keyboard. De Almeida (2013) studies differences and simi- larities in editor behaviour for two language pairs, regarding types of edits, keyboard vs. mouse usage and Web searches. Carl et al. (2011) have shown that human trans- lators are more productive and accurate when post- editing MT output than when translating from scratch. This has recently been confirmed by Toral et al. (2018), who have shown further gains with neural MT compared to phrase-based MT. Kopo- nen et al. (2012) show HTER (Snover et al., 2006) is limited to measure cognitive effort, and suggest post-editing time instead. On the other hand, Her- big et al. (2019) measure cognitive effort subjec- tively by directly inquiring translators, and then edit different documents. Our editor representations can be potentially useful for removing this bias. use a combination of features to predict this cog- nitive effort -- such task could potentially be im- proved by including translator representations as an additional feature. Blain et al. (2011) take a more qualitative approach to understanding post- editing by introducing a measure based on post- editing actions. Specia (2011) attempts to predict the post-editing time using quality estimation, and Koehn and Germann (2014); Sanchez-Torron and Koehn (2016) study the impact of machine trans- lation quality in post-editor productivity. Tatsumi et al. (2012) study the effect of crowd-sourced post-editing of machine translation output, find- ing that larger pools of non-experts can frequently produce accurate translations as quickly as experts. Aziz et al. (2012) developed a tool for post-editing and assessing machine translation which records data such as editing time, keystrokes, and transla- tor assessments. A similar tool has been developed by Denkowski and Lavie (2012); Denkowski et al. (2014b), which is able to learn from post-editing with model adaptation (Denkowski et al., 2014a). Our encouraging results on time prediction using editor representations suggests that these represen- tations may also be useful for learning personal- ized translation models. Yin et al. (2019) learn representations of sin- gle edits, and include a downstream task: apply- ing these edits to unseen sentences. Wikipedia ed- its have been studied by Yang et al. (2017) and Faruqui et al. (2018). The latter study what can be learned about language by observing the editing process that cannot be readily learned by observ- ing only raw text. Likewise, we study what can be learned about the translation process by observing how humans type, which cannot be readily learned by observing only the initial and final text. Our work makes a bridge between the earli- est studies on the cognitive effort of human post- editors and modern representation learning tech- niques, towards embedding human translators on a vector space. We draw inspiration on tech- niques for learning distributed word representa- tions (Mikolov et al., 2013; Pennington et al., 2014), which have also been extended for learn- ing user representations for recommendation sys- tems (Grbovic et al., 2015, 2016). These tech- niques usually obtain high-quality embeddings by tuning the system for an auxiliary task, such as predicting a word given its context. In our case, we take editor identification as the auxiliary task, given a sequence of keytrokes as input. A related problem (but with a completely different goal) is the use of keystroke dynamics for user authenti- cation (Monrose and Rubin, 2000; Banerjee and Woodard, 2012; Kim and Kang, 2018). Unlike this literature, our paper is focused on post-editing of machine-translated text. This is more similar to El-Fiqi et al. (2019), who focus on identifying the translator of a book from his translation style. However, we are not interested in the problem of editor identification per se, but only as a means to obtain good representations. 7 Conclusions We introduced and analyzed the largest public dataset so far containing post-editing information retrieved from raw keystrokes. We provided strong evidence that these intermediate steps contain pre- cious information unavailable in the initial plus fi- nal translated document, by formulating and pro- viding answers to three research questions: (i) that action sequences can be used to perform accu- rate editor identification; (ii) that they can be used to learn human post-editor vector representations that cluster together similar editors; and (iii) that these representations help downstream tasks, such as predicting post-editing time. In sum, we showed that fine-grained post-editing information is a rich and untapped source of information, and we hope that the dataset we release can foster further re- search in this area. Acknowledgments We would like to thank Carla Parra, Alon Lavie, Ricardo Rei, Ant´onio Lopes, and the anonymous reviewers for their insightful comments. This work was partially supported by the EU/FEDER programme under PT2020 (contracts 027767 and 038510) and by the European Research Council (ERC StG DeepSPIN 758969). References Alabau, Vicent, Christian Buck, Michael Carl, Francisco Casacuberta, Mercedes Garc´ıa- Mart´ınez, Ulrich Germann, Jes´us Gonz´alez- Rubio, Robin Hill, Philipp Koehn, Luis Leiva, et al. 2014. Casmacat: A computer-assisted In Proceedings of the translation workbench. Demonstrations at the 14th Conference of the European Chapter of the Association for Computational Linguistics, pages 25 -- 28. Asadi, Paula and Candace S´eguinot. 2005. Short- cuts, strategies and general patterns in a pro- cess study of nine professionals. Meta: Jour- nal des traducteurs/Meta: Translators' Journal, 50(2):522 -- 547. Aziz, Wilker, Sheila Castilho, and Lucia Specia. 2012. Pet: a tool for post-editing and assess- ing machine translation. In LREC, pages 3982 -- 3987. Bahdanau, Dzmitry, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. Balling, Laura Winther and Michael Carl. 2014. Post-editing of machine translation: Processes and applications. Cambridge Scholars Publish- ing. Banerjee, Salil P and Damon L Woodard. 2012. Biometric authentication and identification us- ing keystroke dynamics: A survey. Journal of Pattern Recognition Research, 7(1):116 -- 139. Blain, Fr´ed´eric, Jean Senellart, Holger Schwenk, Mirko Plitt, and Johann Roturier. 2011. Qual- itative analysis of post-editing for high qual- ity machine translation. MT Summit XIII: the Thirteenth Machine Translation Summit [orga- nized by the] Asia-Pacific Association for Ma- chine Translation (AAMT), pages 164 -- 171. Carl, Michael, Barbara Dragsted, Jakob Elm- ing, Daniel Hardt, and Arnt Lykke Jakobsen. 2011. The process of post-editing: a pilot study. Copenhagen Studies in Language, 41:131 -- 142. Cohn, Trevor and Lucia Specia. 2013. Modelling annotator bias with multi-task gaussian pro- cesses: An application to machine translation In Proceedings of the 51st quality estimation. Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), volume 1, pages 32 -- 42. Daems, Joke and Lieve Macken. 2019. Interactive adaptive smt versus interactive adaptive nmt: a user experience evaluation. Machine Transla- tion, pages 1 -- 18. De Almeida, Giselle. 2013. Translating the post- editor: an investigation of post-editing changes and correlations with professional experience across two Romance languages. Ph.D. thesis, Dublin City University. Denkowski, Michael. 2015. Machine translation for human translators. Ph.D. thesis, Ph. D. the- sis, Carnegie Mellon University. Denkowski, Michael, Chris Dyer, and Alon Lavie. 2014a. Learning from post-editing: Online model adaptation for statistical machine trans- In Proceedings of the 14th Conference lation. of the European Chapter of the Association for Computational Linguistics, pages 395 -- 404. Denkowski, Michael and Alon Lavie. 2012. Tran- scenter: Web-based translation research suite. In AMTA 2012 Workshop on Post-Editing Technol- ogy and Practice Demo Session, page 2012. Denkowski, Michael, Alon Lavie, Isabel Lacruz, and Chris Dyer. 2014b. Real time adaptive ma- chine translation for post-editing with cdec and transcenter. In Proceedings of the EACL 2014 Workshop on Humans and Computer-assisted Translation, pages 72 -- 77. Doherty, Stephen, Sharon OBrien, and Michael Carl. 2010. Eye tracking as an mt evaluation technique. Machine translation, 24(1):1 -- 13. El-Fiqi, Heba, Eleni Petraki, and Hussein A. Network motifs for trans- PloS ONE, Abbass. 2019. lator stylometry identification. 14(2):e0211809. Faruqui, Manaal, Ellie Pavlick, Ian Tenney, and Dipanjan Das. 2018. Wikiatomicedits: A mul- tilingual corpus of wikipedia edits for modeling language and discourse. In Proc. of EMNLP. Federico, Marcello, Nicola Bertoldi, Mauro Cet- tolo, Matteo Negri, Marco Turchi, Marco Trom- betti, Alessandro Cattelan, Antonio Farina, Domenico Lupinetti, Andrea Martines, et al. 2014. The matecat tool. In Proceedings of COL- ING 2014, the 25th International Conference on Computational Linguistics: System Demonstra- tions, pages 129 -- 132. Gehring, Jonas, Michael Auli, David Grangier, and Yann Dauphin. 2017. A convolutional en- coder model for neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), volume 1, pages 123 -- 135. Glorot, Xavier, Antoine Bordes, and Yoshua Ben- gio. 2011. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statis- tics, pages 315 -- 323. Graves, Alex and Jurgen Schmidhuber. 2005. Framewise phoneme classification with bidirec- tional lstm and other neural network architec- tures. Neural Networks, 18(5-6):602 -- 610. Grbovic, Mihajlo, Nemanja Djuric, Vladan Ra- dosavljevic, Fabrizio Silvestri, Ricardo Baeza- Yates, Andrew Feng, Erik Ordentlich, Lee Yang, and Gavin Owens. 2016. Scalable semantic matching of queries to ads in sponsored search advertising. In Proceedings of the 39th Interna- tional ACM SIGIR conference on Research and Development in Information Retrieval, pages 375 -- 384. ACM. Grbovic, Mihajlo, Vladan Radosavljevic, Nemanja Jaikit Savla, Djuric, Narayan Bhamidipati, Varun Bhagwan, and Doug Sharp. 2015. E- commerce in your inbox: Product recommenda- tions at scale. In Proceedings of the 21th ACM SIGKDD International Conference on Knowl- edge Discovery and Data Mining, KDD '15, pages 1809 -- 1818, New York, NY, USA. ACM. Green, Spence, Sida I Wang, Jason Chuang, Jef- frey Heer, Sebastian Schuster, and Christo- pher D Manning. 2014. Human effort and ma- chine learnability in computer aided translation. In Proceedings of the 2014 Conference on Em- pirical Methods in Natural Language Process- ing (EMNLP), pages 1225 -- 1236. Herbig, Nico, Santanu Pal, Mihaela Vela, Antonio Kruger, and Josef van Genabith. 2019. Multi- modal indicators for estimating perceived cogni- tive load in post-editing of machine translation. Machine Translation, pages 1 -- 25. Hochreiter, Sepp and Jurgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735 -- 1780. Hokamp, Christopher M. 2018. Deep interactive text prediction and quality estimation in trans- lation interfaces. Ph.D. thesis, Dublin City Uni- versity. Joulin, Armand, Edouard Grave, Piotr Bo- janowski, and Tomas Mikolov. 2017. Bag of In Pro- tricks for efficient text classification. ceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 427 -- 431. Association for Computational Linguistics. Junczys-Dowmunt, Marcin, Roman Grund- kiewicz, Tomasz Dwojak, Hieu Hoang, Kenneth Heafield, Tom Neckermann, Frank Seide, Ulrich Germann, Alham Fikri Aji, Nikolay Bogoychev, Andr´e F. T. Martins, and Alexandra Birch. 2018. Marian: Fast neural In Proceedings machine translation in c++. of ACL 2018, System Demonstrations, pages 116 -- 121. Kenny, Dorothy. 2011. Electronic tools and re- sources for translators. In The Oxford handbook of translation studies. Kim, Junhong and Pilsung Kang. 2018. Recur- rent neural network-based user authentication for freely typed keystroke data. arXiv preprint arXiv:1806.06190. Koehn, Philipp and Ulrich Germann. 2014. The impact of machine translation quality on human post-editing. In Proceedings of the EACL 2014 Workshop on Humans and Computer-assisted Translation, pages 38 -- 46. Koponen, Maarit, Wilker Aziz, Luciana Ramos, and Lucia Specia. 2012. Post-editing time as a measure of cognitive effort. Proceedings of WPTP, pages 11 -- 20. Lacruz, Isabel and Gregory M. Shreve. 2014. Pauses and cognitive effort in post-editing. Post- editing of machine translation: Processes and applications, page 246. Lacruz, Isabel, Gregory M Shreve, and Erik An- gelone. 2012. Average pause ratio as an indi- cator of cognitive effort in post-editing: A case study. In AMTA 2012 Workshop on Post-Editing Technology and Practice (WPTP 2012), pages 21 -- 30. AMTA. Lowe, Ryan, Nissan Pow, Iulian Serban, and Joelle Pineau. 2015. The ubuntu dialogue corpus: A large dataset for research in unstructured multi- turn dialogue systems. CoRR, abs/1506.08909. Lu, Yichao, Phillip Keung, Shaonan Zhang, Jason Sun, and Vikas Bhardwaj. 2017. A practical ap- proach to dialogue response generation in closed domains. arXiv preprint arXiv:1703.09439. Maaten, Laurens. 2009. Learning a parametric em- bedding by preserving local structure. In Artifi- cial Intelligence and Statistics, pages 384 -- 391. Maaten, Laurens van der and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579 -- 2605. Mikolov, Tomas, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed repre- sentations of words and phrases and their com- positionality. In Advances in neural information processing systems, pages 3111 -- 3119. Monrose, Fabian and Aviel D Rubin. 2000. Keystroke dynamics as a biometric for authen- tication. Future Generation computer systems, 16(4):351 -- 359. Moorkens, Joss and Sharon O'Brien. 2015. Post- editing evaluations: Trade-offs between novice and professional participants. In Proceedings of the 18th Annual Conference of the European As- sociation for Machine Translation. O'Brien, Sharon. 2006. Pauses as indicators of cognitive effort in post-editing machine trans- lation output. Across Languages and Cultures, 7(1):1 -- 21. Pennington, Jeffrey, Richard Socher, and Christo- pher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural lan- guage processing (EMNLP), pages 1532 -- 1543. Edward Grefenstette, Karl Moritz Hermann, Tom´as Kocisk`y, and Phil Blunsom. 2016. Reasoning about entailment with neural attention. In Proc. of International Conference on Learning Representations. Rocktaschel, Tim, Sanchez-Torron, Marina and Philipp Koehn. 2016. Machine translation quality and post-editor pro- ductivity. AMTA 2016, Vol., page 16. Sin-wai, Chan. 2014. The development of trans- lation technology. Routledge Encyclopedia of Translation Technology, page 3. Snover, Matthew, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. 2006. A study of translation edit rate with targeted hu- man annotation. In Proceedings of association for machine translation in the Americas, volume 200. Specia, Lucia. 2011. Exploiting objective annota- tions for measuring translation post-editing ef- fort. In Proceedings of the 15th Conference of the European Association for Machine Transla- tion, pages 73 -- 80. Specia, Lucia, Kim Harris, Fr´ed´eric Blain, Aljoscha Burchardt, Viviven Macketanz, Inguna Skadina, Matteo Negri, , and Marco Turchi. 2017. Translation quality and productivity: A In Ma- study on rich morphology languages. chine Translation Summit XVI, pages 55 -- 71, Nagoya, Japan. Specia, Lucia, Carolina Scarton, and Gustavo Hen- rique Paetzold. 2018. Quality estimation for ma- chine translation. Synthesis Lectures on Human Language Technologies, 11(1):1 -- 162. Ilya Sutskever, Srivastava, Nitish, Geoffrey Hinton, Alex Krizhevsky, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929 -- 1958. Tatsumi, Midori, Takako Aikawa, Kentaro Ya- mamoto, and Hitoshi Isahara. 2012. How good is crowd post-editing? its potential and limita- tions. In AMTA 2012 Workshop on Post-Editing Technology and Practice (WPTP 2012), pages 69 -- 77. Toral, Antonio, Martijn Wieling, and Andy Way. 2018. Post-editing effort of a novel with statisti- cal and neural machine translation. Frontiers in Digital Humanities, 5:9. Vaswani, Ashish, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. At- tention is all you need. In Advances in Neural Information Processing Systems, pages 6000 -- 6010. Yang, Diyi, Aaron Halfaker, Robert Kraut, and Ed- uard Hovy. 2017. Identifying semantic edit in- In Pro- tentions from revisions in wikipedia. ceedings of the 2017 Conference on Empiri- cal Methods in Natural Language Processing, pages 2000 -- 2010. Yin, Pengcheng, Graham Neubig, Miltiadis Alla- manis, Marc Brockschmidt, and Alexander L. Gaunt. 2019. Learning to represent edits. In In- ternational Conference on Learning Represen- tations (ICLR), New Orleans, LA, USA.
1804.10911
2
1804
2018-05-18T01:13:09
A Tree Search Algorithm for Sequence Labeling
[ "cs.CL", "cs.IR" ]
In this paper we propose a novel reinforcement learning based model for sequence tagging, referred to as MM-Tag. Inspired by the success and methodology of the AlphaGo Zero, MM-Tag formalizes the problem of sequence tagging with a Monte Carlo tree search (MCTS) enhanced Markov decision process (MDP) model, in which the time steps correspond to the positions of words in a sentence from left to right, and each action corresponds to assign a tag to a word. Two long short-term memory networks (LSTM) are used to summarize the past tag assignments and words in the sentence. Based on the outputs of LSTMs, the policy for guiding the tag assignment and the value for predicting the whole tagging accuracy of the whole sentence are produced. The policy and value are then strengthened with MCTS, which takes the produced raw policy and value as inputs, simulates and evaluates the possible tag assignments at the subsequent positions, and outputs a better search policy for assigning tags. A reinforcement learning algorithm is proposed to train the model parameters. Our work is the first to apply the MCTS enhanced MDP model to the sequence tagging task. We show that MM-Tag can accurately predict the tags thanks to the exploratory decision making mechanism introduced by MCTS. Experimental results show based on a chunking benchmark showed that MM-Tag outperformed the state-of-the-art sequence tagging baselines including CRF and CRF with LSTM.
cs.CL
cs
A Tree Search algorithm For Sequence Labeling Yadi Lao, Jun Xu∗, Yanyan Lan, Jiafeng Guo, Sheng Gao, Xueqi Cheng, Jun Guo Beijing University of Posts and Telecommunications CAS Key Lab of Network Data Science and Technology Institute of Computing Technology, Chinese Academy of Science 8 1 0 2 y a M 8 1 ] L C . s c [ 2 v 1 1 9 0 1 . 4 0 8 1 : v i X r a ABSTRACT In this paper we propose a novel reinforcement learning based model for sequence tagging, referred to as MM-Tag. Inspired by the success and methodology of the AlphaGo Zero, MM-Tag for- malizes the problem of sequence tagging with a Monte Carlo tree search (MCTS) enhanced Markov decision process (MDP) model, in which the time steps correspond to the positions of words in a sentence from le‰ to right, and each action corresponds to assign a tag to a word. Two long short-term memory networks (LSTM) are used to summarize the past tag assignments and words in the sentence. Based on the outputs of LSTMs, the policy for guiding the tag assignment and the value for predicting the whole tagging accuracy of the whole sentence are produced. OEe policy and value are then strengthened with MCTS, which takes the produced raw policy and value as inputs, simulates and evaluates the possible tag assignments at the subsequent positions, and outputs a beŠer search policy for assigning tags. A reinforcement learning algo- rithm is proposed to train the model parameters. Our work is the first to apply the MCTS enhanced MDP model to the sequence tag- ging task. We show that MM-Tag can accurately predict the tags thanks to the exploratory decision making mechanism introduced by MCTS. Experimental results show based on a chunking bench- mark showed that MM-Tag outperformed the state-of-the-art se- quence tagging baselines including CRF and CRF with LSTM. ACM Reference format: Yadi Lao, Jun Xu∗, Yanyan Lan, Jiafeng Guo, Sheng Gao, Xueqi Cheng, Jun Guo. 2016. A Tree Search algorithm For Sequence Labeling. In Proceed- ings of ACM Conference, Washington, DC, USA, July 2017 (Conference'17), 5 pages. DOI: 10.1145/nnnnnnn.nnnnnnn 1 INTRODUCTION Sequence tagging, including POS tagging, chunking, and name en- tity recognition, has gained considerable research aŠention for a few decades. Using the chunking as an example, given a sentences of text (e.g., a sentence), each of the word in a sequence receives a "tag" (class label) that expresses its phrase type. Existing sequence tagging models are be categorized into the statistical models and the deep neural networks based models. Tra- ditional research on sequence tagging focus on the linear statistical models, including the maximum entropy (ME) classifier [10] and maximum entropy Markov models (MEMMs) [7]. OEese models Conference'17, Washington, DC, USA 2016. 978-x-xxxx-xxxx-x/YY/MM. . . $15.00 DOI: 10.1145/nnnnnnn.nnnnnnn predict a distribution of tags for each time step and then use beam- like decoding to find optimal tag sequences. Lafferty et al. pro- posed conditional random fields (CRF) [4] to leverage global sen- tence level feature and solve the label bias problem in MEMM. All the linear statistical models rely heavily on hand-cra‰ed features, e.g., the word spelling features for the task of part-of-speech. Moti- vated by the success of deep learning, deep neural networks based models have been proposed for sequence tagging in recent years. Most of them directly combine the deep neural networks with CRF. For example, Huang [3] used a bidirectional LSTM to automati- cally extract word-level representations and then combined with CRF for jointly label decoding. Ma [5] introduced a neural network architecture that both word level and character level features are used, in which bidirectional LSTM, CNN, and CRF are combined. In recent years, reinforcement learning is also proposed for the task. For example, Maes et al. formalized the sequence tagging task as a Markov decision process (MDP) and used the reinforcement learning algorithm SARSA to construct optimal sequence directly in a greedy manner [6]. Feng et al. proposed a novel model to address the noise problem of relation classification task caused by distant supervision, in which an instance selector designed with REINFORCE algorithm is used to assign select or delete action (la- bel) for every sentence Feng et al. [2]. Inspired by the reinforcement learning model of AlphaGO [11] and AlphaGO Zero [12] programs designed for the Game of Go, in this paper we propose to solve the sequence tagging with a Monte Carlo tree search (MCTS) enhanced Markov decision pro- cess (MDP). OEe new sequence tagging model, referred to as MM- Tag (MCTS enhanced MDP for Tagging), makes use of an MDP to model the sequential tag assignment process in sequence tagging. At each position (corresponding to a ranking position), based on the past words and tags, two long short-term memory networks (LSTM) are used to summarize the past words and tags, respec- tively. Based on the outputs of these two LSTMs, a policy function (a distribution over the valid tags) for guiding the tag assignment and a value function for estimating the accuracy of tagging are pro- duced. To avoid the problem of assigning tags without utilizing the whole sentence level tags, in stead of choosing a tag directly with the raw policy predicted by the policy function, MM-Tag explores more possibilities in the whole space. OEe exploration is conducted with the MCTS guided by the produced policy function and value function, resulting a strengthened search policy for the tag assign- ment. Moving to the next iteration, the algorithm moves to the next position and continue the above process until at the end of the sentence. Reinforcement learning is used to train the model parameters. In the training phase, at each learning iteration and for each train- ing sentence (and the corresponding labels), the algorithm first conducts an MCTS inside the training loop, guided by the current Conference'17, July 2017, Washington, DC, USA Yadi Lao, Jun Xu∗, Yanyan Lan, Jiafeng Guo, Sheng Gao, Xueqi Cheng, Jun Guo policy function and value function. OEen the model parameters are adjusted to minimize the loss function. OEe loss function consists of two terms: 1) the squared error between the predicted value and the final ground truth accuracy of the whole sentence tagging; and 2) the cross entropy of the predicted policy and the search proba- bilities for tags selection. Stochastic gradient descent is utilized for conducting the optimization. To evaluate the effectiveness of MM-Tag, we conducted exper- iments on the basis of CoNLL 2000 chunking dataset. OEe experi- mental results showed that MM-Tag can significantly outperform the state-of-the-art sequence tagging approaches, including the lin- ear statistical models of CRF and neural network-based models of BI-LSTM-CRF. We analyzed the results and showed that MM-Tag improved the performances through conducting lookahead MCTS to explore in the whole tagging space. 2 MDP FORMULATION OF SEQUENCE TAGGING In this section, we introduce the proposed MM-Tag model. 2.1 Sequence tagging as an MDP Suppose that X = {x1, · · · , xM } is a sequence of words (sentence) to be labeled, and Y = {y1, · · · , yM } is the corresponding ground truth tag sequence. All components xi of X are the L-dimensional preliminary representations of the words, i.e., the word embedding. All components yi of Y are assumed to be selected from a finite tag set Y. From example, Y may be the set of possible part-of-speech tags. OEe goal of sequence tagging is to construct a model that can automatically assign a tag to each word in the input sentence X. MM-Tag formulates the assignment of tags to sentences as a process of sequential decision making with an MDP in which each time step corresponds to a position in the sentence. OEe states, actions, transition function, value function, and policy function of the MDP are set as: States S: We design the state at time step t as a pair st = [Xt = {x1, · · · , xt }, Yt = {y1, · · · , yt−1}], where Xt is the preliminary representation of the prefix of the input sentence of length t. Yt is the prefix of the label sequence of length t − 1. At the beginning (t = 1), the state is initialized as s1 = [{x1}, {∅}], where ∅ is the empty sequence. Actions A: At each time step t, the A(st) ⊆ Y is the set of ac- tions the agent can choose. OEat is, the action at ∈ A(st) actually chooses a tag yt ∈ Y for word xt . Transition function T : T : S × A → S is defined as st +1 = T(st , at) = T([Xt , Yt], at) = [Xt ⊕ {xt +1}, Yt ⊕ {at }] where ⊕ appends xt +1 and at to Xt and Yt , respectively. At each time step t, based on state st the system chooses an action (tag) at for the word position t. OEen, the system moves to time step t + 1 and the system transits to a new state st +1: first, the word sequence Xt is updated by concatenating the next word xt +1; second, the system appends the selected tag to the end of Yt , generating a new tag sequence. Value function V : OEe state value function V : S → R is a scalar evaluation, predicting the accuracy of the tag assignments for the whole sentence (an episode), on the basis of the input state. OEe value function is learned so as to fit the real tag assignment accuracies of the training sentences. In this paper, we use two LSTMs to respectively map the word sequence Xt and tag sequence Yt in the state st to two real vectors, and then define the value function as nonlinear transformation of the weighted sum of the LSTM's outputs: V(s) = σ (hw, g(s)i + bv) (1) where w and bv are the weight vector and the bias to be learned during training, σ(x) = 1+e−x is the nonlinear sigmoid function, and g(s) is a concatenation of the outputs from the word LSTM LSTMX and tag LSTM LSTMY : 1 g(s) = hLSTMX (Xt)T , LSTMY (Yt−1)TiT . (2) i xk + UX i hk−1 + bX i ), f xk + UX o xk + UX OEe two LSTM networks are defined as follows: given s = [Xt = {x1, · · · , xt }, Yt = {y1, · · · , yt−1}], where xk(k = 1, · · · , t) is the word at k-th position, represented with its word embedding. yk(k = 1, · · · , T − 1) is the label at k-th position, represented with one hot vector. LSTMX outputs a representation hk for position k: f hk−1 + bX f ), ik = σ(WX fk =σ(WX ok =σ(WX o hk−1 + bX o ), ck =fk ◦ ck−1 + ik ◦ tanh(WX c xk + UX hk =ok ◦ tanh(ck), where h and c are initialized with zero vector; operator "◦" de- notes the element-wise product and "σ " is applied to each of the en- tries; the variables fk , ik , ok , ck and hk denote the forget gate's ac- tivation vector, input gate's activation vector, output gate's activa- tion vector, cell state vector, and output vector of the LSTM block, respectively. WX o are weight f matrices and bias vectors need to be learned during training. OEe output vector and cell state vector at the t-th cell are concatenated as the output of LSTM, that is c hk−1 + bX c ), o , UX f , WX i , WX , UX i , UX o , bX f , bX i , bX LSTMX (Xt) = hht TiT . T , ct OEe function LSTMY (Yt−1), which used to map the tag sequence Yt−1 into a real vector, is defined similarly to that of for LSTMX . Policy function p: OEe policy p(s) defines a function that takes the state as input and output a distribution over all of the possible actions a ∈ A(s). Specifically, each probability in the distribution is a normalized so‰-max function whose input is the bilinear prod- uct of the state representation in Equation (2) and the selected tag: exp(cid:8)Φ(a)T Up g(s)(cid:9) a′∈A(s) exp(cid:8)Φ(a′)T Up g(s)(cid:9) , p(as) = where Φ(a) is the one hot vector for representing the tag a and Up is the parameter in bilinear product. OEe policy function p(s) is: p(s) = hp(a1s), · · · , p(aA(s)s)i. (3) 2.2 Strengthening raw policy with MCTS Tagging directly with the predicted raw policy p in Equation (3) may lead to suboptimal results because the policy is calculated based on the past tags. OEe raw policy has no idea about the tags that will be assigned for the future words. To alleviate the problem, following the practices in AlphaGo [11] and AlphaGo Zero [12], we propose to conduct lookahead search with MCTS. OEat is, at each A Tree Search algorithm For Sequence Labeling Conference'17, July 2017, Washington, DC, USA position t, an MCTS search is executed, guided by the policy func- tion p and the value function V , and output a strengthened new search policy π . Usually, the search policy π has high probability to select a tag with higher accuracy than the raw policy p defined in Equation (3). Algorithm 1 shows the details of the MCTS in which each tree node corresponds to an MDP state. It takes a root node sR , value function V and policy function p as inputs. OEe algorithm iterates K times and outputs a strengthened search policy π for selecting a tag for the root node sR . Suppose that each edge e(s, a) (the edge from state s to the state T(s, a)) of the MCTS tree stores an action value Q(s, a), visit count N(s, a), and prior probability P(s, a). At each of the iteration, the MCTS executes the following steps: Selection: Each iterations starts from the root state sR and iter- atively selects the documents that maximize an upper confidence bound: at = arg max a (Q(st , a) + λU(st , a)), (4) √a′∈A(st ) N(st , a′) where λ > 0 is the tradeoff coefficient, and the bonus U(st , a) = . U(st , a) is proportional to the prior prob- p(ast) ability but decays with repeated visits to encourage exploration. 1+N(st , a) Evaluation and expansion: When the traversal reaches a leaf node sL, the node is evaluated with the value function V(sL) (Equa- tion (1)). Note following the practices in AlphaGo Zero, we use the value function instead of rollouts for evaluating a node. OEen, the leaf node sL may be expanded. Each edge from the leaf position sL (corresponds to each action a ∈ A(sL)) is initialized as: P(sL, a) = p(asL) (Equation (3)), Q(sL, a) = 0, and N(sL, a) = 0. In this paper all of the available actions of sL are expanded. Back-propagation and update: At the end of evaluation, the action values and visit counts of all traversed edges are updated. For each edge e(s, a), the prior probability P(s, a) is kept unchanged, and Q(s, a) and N(s, a) are updated: Q(s, a) × N(s, a) + V(sL) (5) ; N(s, a) ← N(s, a) + 1. Q(s, a) ← N(s, a) + 1 Calculate the strengthened search policy: Finally a‰er iterat- ing K times, the strengthened search policy π for the root node sR can be calculated according to the visit counts N(sR , a) of the edges starting from sR : π(asR) = N(sR , a) a′∈A(sR) N(sR , a′) , (6) for all a ∈ A(sR). 2.3 Learning and inference algorithms 2.3.1 Reinforcement learning of the parameters. OEe model has parameters Θ (including w, bv , Up , and parameters in LSTMX and LSTMY ) to learn. In the training phase, suppose we are given N labeled sentence D = {(X(n), Y(n))}N n=1. Algorithm 2 shows the training procedure. First, the parameters Θ is initialized to random weights in [−1, 1]. At each subsequent iteration, for each tagged sentence (X, Y), a tag sequence is predicted for X with current pa- rameter seŠing: at each position t, an MCTS search is executed, using previous iteration of value function and policy function, and a tag at is selected according to the search policy πt . OEe ranking terminates at the end of the sentence and achieved a predicted tag Algorithm 1 TreeSearch Input: root sR , value V , policy p, search times K Output: Search policy π 1: for k = 0 to K − 1 do 2: sL ← sR {Selection} 3: 4: while sL is not a leaf node do 5: a ← arg maxa∈A(sL) Q(sL, a) + λ · U(sL, a){Eq. (4)} sL ← child node pointed by edge (sL, a) end while {Evaluation and expansion} v ← V(sL) {simulate v with value function V } for all a ∈ A(sL) do Expand an edge e to node s = [sL .Xt , sL .Yt ⊕ {a}] e .P ← p(asL); e .Q ← 0; e .N ← 0{init edge properties} 6: 7: 8: 9: 10: 11: 12: 13: 17: 18: end for {Back-propagation} 14: 15: while sL , sR do 16: s ← parent of sL; e ← edge from s to sL e .Q ← e .Q×e .N +v e .N ← e .N + 1; sL ← s {Eq. (5)} e .N +1 end while 19: 20: end for 21: {Calculate tree search policy. Eq. (6)} 22: for all a ∈ A(sR) do e(sR , a).N a′∈A(sR) e(sR , a′).N 23: π(asR) ← 24: end for 25: return π sequence (a1, · · · , aM). Given the ground truth tag sequence Y, the overall prediction accuracy of the sentence X is calculated, denoted as r . OEe data generated at each time step E = {(st , πt )}M t =1 and the final evaluation r are utilized as the signals in training for adjust- ing the value function. OEe model parameters are adjusted to min- imize the error between the predicted value V(st) and the whole sentence accuracy r , and to maximize the similarity of the policy p(st) to the search probabilities πt . Specifically, the parameters Θ are adjusted by gradient descent on a loss function ℓ that sums over the mean-squared error and cross-entropy losses, respectively: ℓ(E, r) = t =1©(cid:173)«(V(st) − r)2 +  E  a∈A(st) πt (ast) log . (7) 1 p(ast)ª®¬ OEe model parameters are trained by back propagation and sto- chastic gradient descent. Specifically, we use AdaGrad [1] on all parameters in the training process. 2.3.2 Inference. OEe inference of the tag sequence for a sen- tence is shown in Algorithm 3. Given a sentence X, the system state is initialized as s1 = [{x1},∅]. OEen, at each of the time steps t = 1, · · · , M, the agent receives the state st = [Xt , Yt] and search the policy π with MCTS, on the basis of the value function V and policy function p. OEen, it chooses an action a for the word at position t. Moving to the next iteration t + 1, the state becomes st +1 = [Xt +1, Yt +1]. OEe process is repeated until the end of the sentence is reached. Conference'17, July 2017, Washington, DC, USA Yadi Lao, Jun Xu∗, Yanyan Lan, Jiafeng Guo, Sheng Gao, Xueqi Cheng, Jun Guo Algorithm 2 Train MM-Tag model Input: Labeled data D = {(X(n), Y(n))}N ber of search K n=1, learning rate η, num- Output: Θ 1: Initialize Θ ← random values in [−1, 1] 2: repeat 3: for all (X, Y) ∈ D do s ← [x1, ∅]; M ← X; E ← ∅ for t = 1 to M do 4: 5: 6: 7: 8: 9: π ← TreeSearch(s, V , p, K) {Alg. (1)} a = arg maxa∈A(s) π(as) {select the best tag} E ← E ⊕ {(s, π)} s ← [s .Xt ⊕ {xt +1}, s .Yt ⊕ {a}] 10: 11: 12: end for r ← Acccuracy(Y, s .YM){overall accuracy} ∂Θ {ℓ is defined in Eq. (7)} Θ ← Θ − η 13: 14: until converge 15: return Θ ∂ℓ(E,r) end for tion p, and search times K , Algorithm 3 MM-Tag Inference Input: sentence X = {x1, · · · , xM }, value function V , policy func- Output: label sequence Y 1: s ← [{x1},∅]; M ← X 2: for t = 1 to M do 3: π ← TreeSearch(s,V , p, K) a ← arg maxa∈A(s) π(as) s ← [s .X ⊕ {xt +1}, s .Y ⊕ {a}] 4: 5: 6: end for 7: return s .Y Table 1: Performance comparison of all methods. Precision Recall F1 Accuracy CRF LSTM+CRF BiLSTM+CRF MM-Tag 93.98% 88.04% 89.57% 95.75% 94.47% 88.43% 89.81% 95.47% 94.13% 88.17% 89.65% 94.82% 94.54% 89.99% 90.61% 95.77% We compare MM-Tag with linear statistical models of CRF im- plemented with an open so‰ware CRFsuite2 [8] and neural mod- els of LSTM-CRF and BI-LSTM-CRF, following the configurations in [3]. For CRF, 935 spelling features and context features were extracted. OEe features including word identity, word suffix, word shape, word POS tag from current and nearby words etc. For MM-Tag, the number of search times K , the learning rate η, the tree search trade-off parameter λ, and the number of hidden units in LSTM h were set to K = 4000, η = 0.001, λ = 0.25, and h = 200. Table 1 reports the performances of MM-Tag and baseline meth- ods in terms of tagging precision, recall, F1, and accuracy. Boldface indicates the highest scores among all runs. From the result we can see that, MM-Tag outperformed all of the baseline methods in terms of all of the evaluation metrics, indicating the effective- ness of the proposed MM-Tag model. We note that neural methods (LSTM+CRF and BiLSTM+CRF) were underperformed the CRF and MM-Tag. OEe reason may because the short sentence subset is not sufficient enough to learn the large amount of parameters in neural networks. 4 CONCLUSION In this paper we have proposed a novel approach to sequence tag- ging, referred to as MM-Tag. MM-Tag formalizes the tagging of a sentence as a sequence of decision-making with MDP. OEe looka- head MCTS is used to strengthen the raw predicted policy so that the search policy has high probability to select the correct for each word. Reinforcement learning is utilized to train the model param- eters. MM-Tag enjoys several advantages: tagging with the shared policy and the value functions, end-to-end learning, and high ac- curacy in tagging. Experimental results show that MM-Tag outper- formed the baselines of CRF, LSTM-CRF, and BI-LSTM-CRF. REFERENCES [1] John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research 12, Jul (2011), 2121–2159. [2] Jun Feng, Minlie Huang, Li Zhao, Yang Yang, and Xiaoyan Zhu. 2018. Reinforce- ment Learning for Relation Classification from Noisy Data. (2018). [3] Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional LSTM-CRF models for sequence tagging. arXiv preprint arXiv:1508.01991 (2015). [4] John Lafferty, Andrew McCallum, and Fernando CN Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. (2001). [5] Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi- directional lstm-cnns-crf. arXiv preprint arXiv:1603.01354 (2016). [6] Francis Maes, Ludovic Denoyer, and Patrick Gallinari. 2007. Sequence labeling with reinforcement learning and ranking algorithms. In European Conference on Machine Learning. Springer, 648–657. [7] Andrew McCallum, Dayne Freitag, and Fernando CN Pereira. 2000. Maximum We implemented the MM-Tag model based on TensorFlow and the code can be found at the Github repository hŠp://hide for anonymous review. 3 EXPERIMENTS We tested the performances of MM-Tag on subsets of CoNLL 2000 chunking set1. In chunking task, each word is tagged with its phrase type, e.g., tag "B-NP" indicates a word starting a noun phrase. Considering MM-Tag is time consuming for parsing the long sen- tences, we constructed a short sentence subset which was ran- domly selected from the whole CoNLL 2000 chunking set and the sentences longer than 13 words were removed. OEe final short sen- tence subset consists of 1000 sentences and the average sentence length is 9 words. Among them, 900 were used for training and 100 were used for testing. All of the words in the sentences were rep- resented with the word embeddings. In the experiments, we used the publicly available GloVe 100-dimensional embeddings trained on 6 billion words from Wikipedia and Gigaword [9]. 1hŠps://www.clips.uantwerpen.be/conll2000/chunking/ 2hŠp://www.chokkan.org/so‰ware/crfsuite/ A Tree Search algorithm For Sequence Labeling Conference'17, July 2017, Washington, DC, USA Entropy Markov Models for Information Extraction and Segmentation.. In Icml, Vol. 17. 591–598. [8] Naoaki Okazaki. 2007. CRFsuite: a fast implementation of Conditional Random Fields. (2007). [9] Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In EMNLP 2014. 1532–1543. [10] Adwait Ratnaparkhi. 1996. A maximum entropy model for part-of-speech tag- ging. In Conference on Empirical Methods in Natural Language Processing. [11] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian SchriŠwieser, Ioannis Antonoglou, Veda Panneer- shelvam, Marc Lanctot, et al. 2016. Mastering the game of Go with deep neural networks and tree search. nature 529, 7587 (2016), 484–489. [12] David Silver, Julian SchriŠwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, OEomas Hubert, Lucas Baker, MaŠhew Lai, Adrian Bolton, et al. 2017. Mastering the game of go without human knowledge. Nature 550, 7676 (2017), 354.
1808.10122
3
1808
2019-06-17T17:42:49
Learning Neural Templates for Text Generation
[ "cs.CL", "cs.LG" ]
While neural, encoder-decoder models have had significant empirical success in text generation, there remain several unaddressed problems with this style of generation. Encoder-decoder models are largely (a) uninterpretable, and (b) difficult to control in terms of their phrasing or content. This work proposes a neural generation system using a hidden semi-markov model (HSMM) decoder, which learns latent, discrete templates jointly with learning to generate. We show that this model learns useful templates, and that these templates make generation both more interpretable and controllable. Furthermore, we show that this approach scales to real data sets and achieves strong performance nearing that of encoder-decoder text generation models.
cs.CL
cs
Learning Neural Templates for Text Generation Sam Wiseman Stuart M. Shieber Alexander M. Rush School of Engineering and Applied Sciences Harvard University Cambridge, MA, USA {swiseman,shieber,srush}@seas.harvard.edu 9 1 0 2 n u J 7 1 ] L C . s c [ 3 v 2 2 1 0 1 . 8 0 8 1 : v i X r a Abstract While neural, encoder-decoder models have had significant empirical success in text gener- ation, there remain several unaddressed prob- lems with this style of generation. Encoder- decoder models are largely (a) uninterpretable, and (b) difficult to control in terms of their phrasing or content. This work proposes a neural generation system using a hidden semi- markov model (HSMM) decoder, which learns latent, discrete templates jointly with learning to generate. We show that this model learns useful these templates make generation both more interpretable and controllable. Furthermore, we show that this approach scales to real data sets and achieves strong performance nearing that of encoder- decoder text generation models. templates, and that Introduction 1 With the continued success of encoder-decoder models for machine translation and related tasks, there has been great interest in extending these methods to build general-purpose, data-driven nat- ural language generation (NLG) systems (Mei et al., 2016; Dusek and Jurcıcek, 2016; Lebret et al., 2016; Chisholm et al., 2017; Wiseman et al., 2017). These encoder-decoder models (Sutskever et al., 2014; Cho et al., 2014; Bahdanau et al., 2015) use a neural encoder model to represent a source knowledge base, and a decoder model to emit a textual description word-by-word, condi- tioned on the source encoding. This style of gen- eration contrasts with the more traditional division of labor in NLG, which famously emphasizes ad- dressing the two questions of "what to say" and "how to say it" separately, and which leads to sys- tems with explicit content selection, macro- and micro-planning, and surface realization compo- nents (Reiter and Dale, 1997; Jurafsky and Martin, 2014). Source Entity: Cotto type[coffee shop], rating[3 out of 5], food[English], area[city centre], price[moderate], near[The Portland Arms] System Generation: Cotto is a coffee shop serving English food in the moderate price range. is located near The Portland Arms. Its customer rating is 3 out of 5. It Neural Template: The ... food cuisine foods located in the located near ... near ... is a is an ... is an expensive in the with a and has a ... . ... price range providing serving offering . Its customer rating is Their customer rating is Customers have rated it price bracket pricing ... ... It's It is ... The place is . Figure 1: An example template-like generation from the E2E Generation dataset (Novikova et al., 2017). Knowledge base x (top) contains 6 records, and y (middle) is a system gen- eration; records are shown as type[value]. An induced neural template (bottom) is learned by the system and em- ployed in generating y. Each cell represents a segment in the learned segmentation, and "blanks" show where slots are filled through copy attention during generation. Encoder-decoder generation systems appear to have increased the fluency of NLG outputs, while reducing the manual effort required. However, due to the black-box nature of generic encoder- decoder models, these systems have also largely sacrificed two important desiderata that are often found in more traditional systems, namely (a) in- terpretable outputs that (b) can be easily controlled in terms of form and content. This work considers building interpretable and controllable neural generation systems, and pro- poses a specific first step: a new data-driven gen- eration model for learning discrete, template-like structures for conditional text generation. The core system uses a novel, neural hidden semi- markov model (HSMM) decoder, which provides a principled approach to template-like text gener- ation. We further describe efficient methods for training this model in an entirely data-driven way by backpropagation through inference. Generat- ing with the template-like structures induced by the neural HSMM allows for the explicit repre- sentation of what the system intends to say (in the form of a learned template) and how it is attempt- ing to say it (in the form of an instantiated tem- plate). We show that we can achieve performance com- petitive with other neural NLG approaches, while making progress satisfying the above two desider- ata. Concretely, our experiments indicate that we can induce explicit templates (as shown in Figure 1) while achieving competitive automatic scores, and that we can control and interpret our gener- ations by manipulating these templates. Finally, while our experiments focus on the data-to-text regime, we believe the proposed methodology rep- resents a compelling approach to learning discrete, latent-variable representations of conditional text. 2 Related Work A core task of NLG is to generate textual descrip- tions of knowledge base records. A common ap- proach is to use hand-engineered templates (Ku- kich, 1983; McKeown, 1992; McRoy et al., 2000), but there has also been interest in creating tem- plates in an automated manner. For instance, many authors induce templates by clustering sen- tences and then abstracting templated fields with hand-engineered rules (Angeli et al., 2010; Kon- dadadi et al., 2013; Howald et al., 2013), or with a pipeline of other automatic approaches (Wang and Cardie, 2013). There has also been work in incorporating prob- abilistic notions of templates into generation mod- els (Liang et al., 2009; Konstas and Lapata, 2013), which is similar to our approach. However, these approaches have always been conjoined with dis- criminative classifiers or rerankers in order to ac- tually accomplish the generation (Angeli et al., 2010; Konstas and Lapata, 2013). In addition, these models explicitly model knowledge base field selection, whereas the model we present is fundamentally an end-to-end model over genera- tion segments. Recently, a new paradigm has emerged around neural text generation systems based on machine translation (Sutskever et al., 2014; Cho et al., 2014; Bahdanau et al., 2015). Most of this work has used unconstrained black-box encoder- decoder approaches. There has been some work on discrete variables in this context, including ex- tracting representations (Shen et al., 2018), incor- porating discrete latent variables in text model- ing (Yang et al., 2018), and using non-HSMM seg- mental models for machine translation or summa- rization (Yu et al., 2016; Wang et al., 2017; Huang et al., 2018). Dai et al. (2017) develop an approx- imate inference scheme for a neural HSMM using RNNs for continuous emissions; in contrast we maximize the exact log-marginal, and use RNNs to parameterize a discrete emission distribution. Finally, there has also been much recent interest in segmental RNN models for non-generative tasks in NLP (Tang et al., 2016; Kong et al., 2016; Lu et al., 2016). The neural text generation community has also recently been interested in "controllable" text gen- eration (Hu et al., 2017), where various aspects of the text (often sentiment) are manipulated or transferred (Shen et al., 2017; Zhao et al., 2018; Li et al., 2018). In contrast, here we focus on control- ling either the content of a generation or the way it is expressed by manipulating the (latent) template used in realizing the generation. 3 Overview: Data-Driven NLG Our focus is on generating a textual description of a knowledge base or meaning representation. Following standard notation (Liang et al., 2009; Wiseman et al., 2017), let x ={r1 . . . rJ} be a collection of records. A record is made up of a type (r.t), an entity (r.e), and a value (r.m). For example, a knowledge base of restaurants might have a record with r.t = Cuisine, r.e = Denny's, and r.m = American. The aim is to generate an adequate and fluent text description y1:T = y1, . . . , yT of x. Concretely, we consider the E2E Dataset (Novikova et al., 2017) and the WikiBio Dataset (Lebret et al., 2016). We show an example E2E knowledge base x in the top of Figure 1. The top of Figure 2 shows an exam- ple knowledge base x from the WikiBio dataset, where it is paired with a reference text y = y1:T at the bottom. The dominant approach in neural NLG has been the records in Figure 2: "frederick parker-rhodes (21 november 1914 - 2 march 1987) was an en- glish mycology and plant pathology, mathematics at the university of uk." In addition to not being fluent, it is unclear what the end of this sentence is even attempting to convey: it may be attempt- ing to convey a fact not actually in the knowledge base (e.g., where Parker-Rhodes studied), or per- haps it is simply failing to fluently realize infor- mation that is in the knowledge base (e.g., Parker- Rhodes's country of residence). Traditional NLG systems (Kukich, 1983; McK- eown, 1992; Belz, 2008; Gatt and Reiter, 2009), in contrast, largely avoid these problems. Since they typically employ an explicit planning component, which decides which knowledge base records to focus on, and a surface realization component, which realizes the chosen records, the intent of the system is always explicit, and it may be modified to meet constraints. The goal of this work is to propose an approach to neural NLG that addresses these issues in a prin- cipled way. We target this goal by proposing a new model that generates with template-like ob- jects induced by a neural HSMM (see Figure 1). Templates are useful here because they represent a fixed plan for the generation's content, and be- cause they make it clear what part of the genera- tion is associated with which record in the knowl- edge base. 4 Background: Semi-Markov Models What does it mean to learn a template? It is nat- ural to think of a template as a sequence of typed text-segments, perhaps with some segments acting as the template's "backbone" (Wang and Cardie, 2013), and the remaining segments filled in from the knowledge base. A natural probabilistic model conforming with this intuition is the hidden semi-markov model (HSMM) (Gales and Young, 1993; Ostendorf et al., 1996), which models latent segmentations in an output sequence. Informally, an HSMM is much like an HMM, except emissions may last multiple time-steps, and multi-step emissions need not be independent of each other conditioned on the state. We briefly review HSMMs following Murphy (2002). Assume we have a sequence of ob- served tokens y1 . . . yT and a discrete, latent state zt ∈{1, . . . , K} for each timestep. We addition- Frederick Parker-Rhodes (21 March 1914 - 21 November 1987) was an English linguist, plant pathologist, computer scientist, mathematician, mystic, and mycologist. Figure 2: An example from the WikiBio dataset (Lebret et al., 2016), with a database x (top) for Frederick Parker- Rhodes and corresponding reference generation y (bottom). to use an encoder network over x and then a condi- tional decoder network to generate y, training the whole system in an end-to-end manner. To gener- ate a description for a given example, a black-box network (such as an RNN) is used to produce a dis- tribution over the next word, from which a choice is made and fed back into the system. The entire distribution is driven by the internal states of the neural network. While effective, relying on a neural decoder makes it difficult to understand what aspects of x are correlated with a particular system output. This leads to problems both in controlling fine- grained aspects of the generation process and in interpreting model mistakes. As an example of why controllability is im- portant, consider the records in Figure 1. Given these inputs an end-user might want to generate an output meeting specific constraints, such as not mentioning any information relating to customer rating. Under a standard encoder-decoder style model, one could filter out this information either from the encoder or decoder, but in practice this would lead to unexpected changes in output that might propagate through the whole system. As an example of the difficulty of interpret- ing mistakes, consider the following actual gen- eration from an encoder-decoder style system for sopoulos,2007;Turneretal.,2010).Generationisdividedintomodular,yethighlyinterdependent,de-cisions:(1)contentplanningdefineswhichpartsoftheinputfieldsormeaningrepresentationsshouldbeselected;(2)sentenceplanningdetermineswhichselectedfieldsaretobedealtwithineachoutputsentence;and(3)surfacerealizationgeneratesthosesentences.Data-drivenapproacheshavebeenproposedtoautomaticallylearntheindividualmodules.Oneap-proachfirstalignsrecordsandsentencesandthenlearnsacontentselectionmodel(DuboueandMcK-eown,2002;BarzilayandLapata,2005).Hierar-chicalhiddensemi-Markovgenerativemodelshavealsobeenusedtofirstdeterminewhichfactstodis-cussandthentogeneratewordsfromthepredi-catesandargumentsofthechosenfacts(Liangetal.,2009).Sentenceplanninghasbeenformulatedasasupervisedsetpartitioningproblemoverfactswhereeachpartitioncorrespondstoasentence(BarzilayandLapata,2006).End-to-endapproacheshavecombinedsentenceplanningandsurfacerealiza-tionbyusingexplicitlyalignedsentence/meaningpairsastrainingdata(Ratnaparkhi,2002;WongandMooney,2007;Belz,2008;LuandNg,2011).Morerecently,contentselectionandsurfacerealizationhavebeencombined(Angelietal.,2010;KimandMooney,2010;KonstasandLapata,2013).Attheintersectionofrule-basedandstatisti-calmethods,hybridsystemsaimatleveraginghu-mancontributedrulesandcorpusstatistics(Langk-ildeandKnight,1998;SoricutandMarcu,2006;MairesseandWalker,2011).Ourapproachisinspiredbytherecentsuccessofneurallanguagemodelsforimagecaptioning(Kirosetal.,2014;KarpathyandFei-Fei,2015;Vinyalsetal.,2015;Fangetal.,2015;Xuetal.,2015),ma-chinetranslation(Devlinetal.,2014;Bahdanauetal.,2015;Luongetal.,2015),andmodelingconver-sationsanddialogues(Shangetal.,2015;Wenetal.,2015;Yaoetal.,2015).OurmodelismostsimilartoMeietal.(2016)whouseanencoder-decoderstyleneuralnetworkmodeltotackletheWEATHERGOVandROBOCUPtasks.TheirarchitecturereliesonLSTMunitsandanattentionmechanismwhichreducesscalabilitycomparedtooursimplerdesign.Figure1:WikipediainfoboxofFrederickParker-Rhodes.Theintroductionofhisarticlereads:"FrederickParker-Rhodes(21March1914 -- 21November1987)wasanEnglishlinguist,plantpathologist,computerscientist,mathematician,mystic,andmycologist.".3LanguageModelingforConstrainedSentencegenerationConditionallanguagemodelsareapopularchoicetogeneratesentences.Weintroduceatable-conditionedlanguagemodelforconstrainingtextgenerationtoincludeelementsfromfacttables.3.1LanguagemodelGivenasentences=w1,...,wTwithTwordsfromvocabularyW,alanguagemodelestimates:P(s)=TYt=1P(wtw1,...,wt−1).(1)Letct=wt−(n−1),...,wt−1bethesequenceofn−1contextwordsprecedingwt.Ann-gramlan-guagemodelmakesanordernMarkovassumption,P(s)≈TYt=1P(wtct).(2)3.2LanguagemodelconditionedontablesAtableisasetoffield/valuepairs,wherevaluesaresequencesofwords.Wethereforeproposelanguagemodelsthatareconditionedonthesepairs.Localconditioningreferstotheinformationfromthetablethatisappliedtothedescriptionofthewordswhichhavealreadygenerated,i.e.theprevi-ouswordsthatconstitutethecontextofthelanguage2 ally use two per-timestep variables to model multi- step segments: a length variable lt ∈{1, . . . , L} specifying the length of the current segment, and a deterministic binary variable ft indicating whether a segment finishes at time t. We will consider in particular conditional HSMMs, which condition on a source x, essentially giving us an HSMM de- coder. An HSMM specifies a joint distribution on the observations and latent segmentations. Letting θ denote all the parameters of the model, and using the variables introduced above, we can write the corresponding joint-likelihood as follows p(y, z, l, f x; θ) = p(zt+1, lt+1 zt, lt, x)ft T−1(cid:89) × T(cid:89) t=0 p(yt−lt+1:t zt, lt, x)ft, t=1 where we take z0 to be a distinguished start- state, and the deterministic ft variables are used for excluding non-segment log probabilities. We further assume p(zt+1, lt+1 zt, lt, x) factors as p(zt+1 zt, x) × p(lt+1 zt+1). Thus, the likeli- hood is given by the product of the probabilities of each discrete state transition made, the proba- bility of the length of each segment given its dis- crete state, and the probability of the observations in each segment, given its state and length. 5 A Neural HSMM Decoder We use a novel, neural parameterization of an HSMM to specify the probabilities in the likeli- hood above. This full model, sketched out in Fig- ure 3, allows us to incorporate the modeling com- ponents, such as LSTMs and attention, that make neural text generation effective, while maintaining the HSMM structure. 5.1 Parameterization Since our model must condition on x, let rj ∈ Rd represent a real embedding of record rj ∈ x, and let xa ∈ Rd represent a real embedding of the en- tire knowledge base x, obtained by max-pooling coordinate-wise over all the rj. It is also useful to have a representation of just the unique types of records that appear in x, and so we also define xu ∈ Rd to be the sum of the embeddings of the unique types appearing in x, plus a bias vector and followed by a ReLU nonlinearity. z1 T z4 x RNN RNN y1 y2 y3 y4 Figure 3: HSMM factor graph (under a known segmenta- tion) to illustrate parameters. Here we assume z1 is in the "red" state (out of K possibilities), and transitions to the "blue" state after emitting three words. The transition model, shown as T , is a function of the two states and the neural en- coded source x. The emission model is a function of a "red" RNN model (with copy attention over x) that generates words 1, 2 and 3. After transitioning, the next word y4 is generated by the "blue" RNN, but independently of the previous words. Transition Distribution The transition distribu- tion p(zt+1 zt, x) may be viewed as a K × K ma- trix of probabilities, where each row sums to 1. We define this matrix to be p(zt+1 zt, x) ∝ AB + C(xu)D(xu), where A∈ RK×m1, B ∈ Rm1×K are state embed- dings, and where C : Rd → RK×m2 and D : Rd → Rm2×K are parameterized non-linear func- tions of xu. We apply a row-wise softmax to the resulting matrix to obtain the desired probabilities. Length Distribution We simply fix all length probabilities p(lt+1 zt+1) to be uniform up to a maximum length L.1 Emission Distribution The emission model models the generation of a text segment condi- tioned on a latent state and source information, and so requires a richer parameterization. Inspired by the models used for neural NLG, we base this model on an RNN decoder, and write a segment's probability as a product over token-level probabil- ities, p(yt−lt+1:t zt = k, lt = l, x) = lt(cid:89) × p(</seg> yt−lt+1:t, zt = k, x) × 1{lt = l}, 1We experimented with parameterizing the length distri- bution, but found that it led to inferior performance. Forcing the length probabilities to be uniform encourages the model to cluster together functionally similar emissions of differ- ent lengths, while parameterizing them can lead to states that specialize to specific emission lengths. p(yt−lt+i yt−lt+1:t−lt+i−1, zt = k, x) i=1 5.2 Learning The model requires fitting a large set of neu- ral network parameters. Since we assume z, l, and f are unobserved, we marginalize over these variables to maximize the log marginal-likelihood of the observed tokens y given x. The HSMM marginal-likelihood calculation can be carried out efficiently with a dynamic program analogous to either the forward- or backward-algorithm famil- iar from HMMs (Rabiner, 1989). It is actually more convenient to use the backward-algorithm formulation when using RNNs to parameterize the emission distributions, and we briefly review the backward recurrences here, again following Murphy (2002). We have: βt(j) = p(yt+1:T zt = j, ft = 1, x) = t (k) p(zt+1 = k zt = j) β∗ t (k) = p(yt+1:T zt+1 = k, ft = 1, x) β∗ K(cid:88) L(cid:88) k=1 l=1 (cid:104) = βt+l(k) p(lt+1 = l zt+1 = k) p(yt+1:t+l zt+1 = k, lt+1 = l) , (cid:105) the marginal p(y x) =(cid:80)K with base case βT (j) = 1. obtain We can now as where we have used the fact that f0 must be 1, and we therefore train to maximize the log-marginal likelihood of the observed y: 0(k) p(z1 = k), probability k=1 β∗ of y ln p(y x; θ) = ln β∗ 0(k) p(z1 = k). (1) K(cid:88) where </seg> is an end of segment token. The RNN decoder uses attention and copy-attention over the embedded records rj, and is conditioned on zt = k by concatenating an embedding corre- sponding to the k'th latent state to the RNN's in- put; the RNN is also conditioned on the entire x by initializing its hidden state with xa. i−1 ∈ Rd be the state of an RNN conditioned on x and zt = k (as above) run over the sequence yt−lt+1:t−lt+i−1. We let the model attend over records rj using hk i−1 (in the style of Luong et al. (2015)), producing a context vector ck i−1. We may then obtain scores vi−1 for each word in the output vocabulary, More concretely, let hk vi−1 = W tanh(gk 1 ◦ [hk i−1, ck i−1]), 1 ∈ R2d and W ∈ RV ×2d. Note with parameters gk that there is a gk 1 vector for each of K discrete states. To additionally implement a kind of slot filling, we allow emissions to be directly copied from the value portion of the records rj using copy attention (Gulc¸ehre et al., 2016; Gu et al., 2016; Yang et al., 2016). Define copy scores, ρj = rT j tanh(gk 2 ◦ hk i−1), 2 ∈ Rd. We then normalize the output- where gk vocabulary and copy scores together, to arrive at (cid:101)vi−1 = softmax([vi−1, ρ1, . . . , ρJ ]), and thus p(yt−lt+i = w yt−lt+1:t−lt+i−1, zt = k, x) = (cid:88) (cid:101)vi−1,w + (cid:101)vi−1,V +j. j:rj .m = w k=1 An Autoregressive Variant The model as spec- ified assumes segments are independent condi- tioned on the associated latent state and x. While this assumption still allows for reasonable perfor- mance, we can tractably allow interdependence between tokens (but not segments) by having each next-token distribution depend on all the previ- ously generated tokens, giving us an autoregres- sive HSMM. For this model, we will in fact use p(yt−lt+i = w y1:t−lt+i−1, zt = k, x) in defining our emission model, which is easily implemented by using an additional RNN run over all the pre- ceding tokens. We will report scores for both non-autoregressive and autoregressive HSMM de- coders below. Since the quantities in (1) are obtained from a dynamic program, which is itself differentiable, we may simply maximize with respect to the pa- rameters θ by back-propagating through the dy- namic program; this is easily accomplished with automatic differentiation packages, and we use pytorch (Paszke et al., 2017) in all experiments. 5.3 Extracting Templates and Generating After training, we could simply condition on a new database and generate with beam search, as is stan- dard with encoder-decoder models. However, the structured approach we have developed allows us to generate in a more template-like way, giving us more interpretable and controllable generations. [The Golden Palace]55 [is a]59 [coffee shop]12 [providing]3 [Indian]50 [food]1 [in the]17 [£20- 25]26 [price range]16 [.]2 [It is]8 [located in the]25 [riverside]40 [.]53 [Its customer rating is]19 [high]23 [.]2 Figure 4: A sample Viterbi segmentation of a training text; subscripted numbers indicate the corresponding latent state. From this we can extract a template with S = 17 segments; compare with the template used at the bottom of Figure 1. First, note that given a database x and refer- ence generation y we can obtain the MAP assign- ment to the variables z, l, and f with a dynamic program similar to the Viterbi algorithm familiar from HMMs. These assignments will give us a typed segmentation of y, and we show an example Viterbi segmentation of some training text in Fig- ure 4. Computing MAP segmentations allows us to associate text-segments (i.e., phrases) with the discrete labels zt that frequently generate them. These MAP segmentations can be used in an ex- ploratory way, as a sort of dimensionality reduc- tion of the generations in the corpus. More im- portantly for us, however, they can also be used to guide generation. 1 , . . . z(i) In particular, since each MAP segmentation im- plies a sequence of hidden states z, we may run a template extraction step, where we collect the most common "templates" (i.e., sequences of hid- den states) seen in the training data. Each "tem- plate" z(i) consists of a sequence of latent states, with z(i) = z(i) S representing the S distinct segments in the i'th extracted template (recall that we will technically have a zt for each time-step, and so z(i) is obtained by collapsing adjacent zt's with the same value); see Figure 4 for an example template (with S = 17) that can be extracted from the E2E corpus. The bottom of Figure 1 shows a visualization of this extracted template, where dis- crete states are replaced by the phrases they fre- quently generate in the training data. With our templates z(i) in hand, we can then restrict the model to using (one of) them during generation. In particular, given a new input x, we may generate by computing y(i) = arg max y(cid:48) p(y(cid:48), z(i) x), (2) which gives us a generation y(i) for each extracted template z(i). For example, the generation in Fig- ure 1 is obtained by maximizing (2) with x set to the database in Figure 1 and z(i) set to the template extracted in Figure 4. In practice, the arg max in (2) will be intractable to calculate exactly due to the use of RNNs in defining the emission distribu- tion, and so we approximate it with a constrained beam search. This beam search looks very similar to that typically used with RNN decoders, except the search occurs only over a segment, for a par- ticular latent state k. 5.4 Discussion Returning to the discussion of controllability and interpretability, we note that with the proposed model (a) it is possible to explicitly force the gen- eration to use a chosen template z(i), which is it- self automatically learned from training data, and (b) that every segment in the generated y(i) is typed by its corresponding latent variable. We ex- plore these issues empirically in Section 7.1. We also note that these properties may be use- ful for other text applications, and that they offer an additional perspective on how to approach la- tent variable modeling for text. Whereas there has been much recent interest in learning continuous latent variable representations for text (see Sec- tion 2), it has been somewhat unclear what the la- tent variables to be learned are intended to capture. On the other hand, the latent, template-like struc- tures we induce here represent a plausible, proba- bilistic latent variable story, and allow for a more controllable method of generation. Finally, we highlight one significant possible is- sue with this model -- the assumption that seg- ments are independent of each other given the cor- responding latent variable and x. Here we note that the fact that we are allowed to condition on x is quite powerful. Indeed, a clever encoder could capture much of the necessary interdependence between the segments to be generated (e.g., the correct determiner for an upcoming noun phrase) in its encoding, allowing the segments themselves to be decoded more or less independently, given x. 6 Data and Methods Our experiments apply the approach outlined above to two recent, data-driven NLG tasks. 6.1 Datasets Experiments use the E2E (Novikova et al., 2017) and WikiBio (Lebret et al., 2016) datasets, ex- amples of which are shown in Figures 1 and 2, respectively. The former dataset, used for the 2018 E2E-Gen Shared Task, contains approxi- mately 50K total examples, and uses 945 distinct word types, and the latter dataset contains approx- imately 500K examples and uses approximately 400K word types. Because our emission model uses a word-level copy mechanism, any record with a phrase consisting of n words as its value is replaced with n positional records having a single word value, following the preprocessing of Lebret et al. (2016). For example, "type[coffee shop]" in Figure 1 becomes "type-1[coffee]" and "type- 2[shop]." For both datasets we compare with published encoder-decoder models, as well as with direct template-style baselines. The E2E task is eval- uated in terms of BLEU (Papineni et al., 2002), NIST (Belz and Reiter, 2006), ROUGE (Lin, 2004), CIDEr (Vedantam et al., 2015), and ME- TEOR (Banerjee and Lavie, 2005).2 The bench- mark system for the task is an encoder-decoder style system followed by a reranker, proposed by Dusek and Jurcıcek (2016). We compare to this baseline, as well as to a simple but competitive non-parametric template-like baseline ("SUB" in tables), which selects a training sentence with records that maximally overlap (without including extraneous records) the unseen set of records we wish to generate from; ties are broken at random. Then, word-spans in the chosen training sentence are aligned with records by string-match, and re- placed with the corresponding fields of the new set of records.3 The WikiBio dataset is evaluated in terms of BLEU, NIST, and ROUGE, and we compare with the systems and baselines implemented by Lebret et al. (2016), which include two neural, encoder- decoder style models, as well as a Kneser-Ney, templated baseline. 6.2 Model and Training Details We first emphasize two additional methodological details important for obtaining good performance. Constraining Learning We were able to learn more plausible segmentations of y by constraining the model to respect word spans yt+1:t+l that ap- pear in some record rj ∈ x. We accomplish this by giving zero probability (within the backward re- 2We use the official E2E NLG Challenge scoring scripts at https://github.com/tuetschek/e2e-metrics. 3For categorical records, like "familyFriendly", which cannot easily be aligned with a phrase, we simply select only candidate training sentences with the same categorical value. currences in Section 5) to any segmentation that splits up a sequence yt+1:t+l that appears in some rj, or that includes yt+1:t+l as a subsequence of another sequence. Thus, we maximize (1) subject to these hard constraints. Increasing the Number of Hidden States While a larger K allows for a more expressive la- tent model, computing K emission distributions over the vocabulary can be prohibitively expen- sive. We therefore tie the emission distribution be- tween multiple states, while allowing them to have a different transition distributions. We give additional architectural details of our model in the Supplemental Material; here we note that we use an MLP to embed rj ∈ Rd, and a 1- layer LSTM (Hochreiter and Schmidhuber, 1997) in defining our emission distributions. In order to reduce the amount of memory used, we restrict our output vocabulary (and thus the height of the ma- trix W in Section 5) to only contain words in y that are not present in x; any word in y present in x is assumed to be copied. In the case where a word yt appears in a record rj (and could therefore have been copied), the input to the LSTM at time t+1 is computed using information from rj; if there are multiple rj from which yt could have been copied, the computed representations are simply averaged. For all experiments, we set d = 300 and L = 4. At generation time, we select the 100 most com- mon templates z(i), perform beam search with a beam of size 5, and select the generation with the highest overall joint probability. For our E2E experiments, our best non- autoregressive model has 55 "base" states, dupli- cated 5 times, for a total of K = 275 states, and our best autoregressive model uses K = 60 states, without any duplication. For our WikiBio exper- iments, both our best non-autoregressive and au- toregressive models uses 45 base states duplicated 3 times, for a total of K = 135 states. In all cases, K was chosen based on BLEU performance on held-out validation data. Code implementing our models is available at https://github.com/ harvardnlp/neural-template-gen. 7 Results Our results on automatic metrics are shown in Tables 1 and 2. In general, we find that the templated baselines underperform neural models, whereas our proposed model is fairly competi- tive with neural models, and sometimes even out- BLEU NIST ROUGE CIDEr METEOR Validation D&J SUB NTemp NTemp+AR D&J SUB NTemp NTemp+AR 69.25 43.71 64.53 67.07 65.93 43.78 55.17 59.80 8.48 6.72 7.66 7.98 8.59 6.88 7.14 7.56 72.57 55.35 68.60 69.50 Test 68.50 54.64 65.70 65.01 2.40 1.41 1.82 2.29 2.23 1.39 1.70 1.95 47.03 37.87 42.46 43.07 44.83 37.35 41.91 38.75 Table 1: Comparison of the system of Dusek and Jurcıcek (2016), which forms the baseline for the E2E challenge, a non-parametric, substitution-based baseline (see text), and our HSMM models (denoted "NTemp" and "NTemp+AR" for the non-autoregressive and autoregressive versions, resp.) on the validation and test portions of the E2E dataset. "ROUGE" is ROUGE-L. Models are evaluated using the of- ficial E2E NLG Challenge scoring scripts. Travellers Rest Beefeater name[Travellers Rest Beefeater], customerRating[3 out of 5], area[riverside], near[Raja Indian Cuisine] 1. [Travellers Rest Beefeater]55 [is a]59 [3 star]43 [restaurant]11 [located near]25 [Raja Indian Cuisine]40 [.]53 2. [Near]31 [riverside]29 [,]44 [Travellers Rest Beefeater]55 [serves]3 [3 star]50 [food]1 [.]2 3. [Travellers Rest Beefeater]55 [is a]59 [restaurant]12 [providing]3 [riverside]50 [food]1 [and has a]17 [3 out of 5]26 [customer rating]16 [.]2 [It is]8 [near]25 [Raja Indian Cuisine]40 [.]53 4. [Travellers Rest Beefeater]55 [is a]59 [place to eat]12 [located near]25 [Raja Indian Cuisine]40 [.]53 5. [Travellers Rest Beefeater]55 [is a]59 [3 out of 5]5 [rated]32 [riverside]43 [restaurant]11 [near]25 [Raja Indian Cuisine]40 [.]53 Table 3: Impact of varying the template z(i) for a single x from the E2E validation data; generations are annotated with the segmentations of the chosen z(i). Results were obtained using the NTemp+AR model from Table 1. Template KN † NNLM (field) † NNLM (field & word) † NTemp NTemp+AR Seq2seq (Liu et al., 2018) BLEU NIST 19.8 5.19 7.52 33.4 7.98 34.7 7.94 34.2 34.8 7.59 43.65 - ROUGE-4 10.7 23.9 25.8 35.9 38.6 40.32 Table 2: Top: comparison of the two best neural systems of Lebret et al. (2016), their templated baseline, and our HSMM models (denoted "NTemp" and "NTemp+AR" for the non- autoregressive and autoregressive versions, resp.) on the test portion of the WikiBio dataset. Models marked with a † are from Lebret et al. (2016), and following their methodology we use ROUGE-4. Bottom: state-of-the-art seq2seq-style re- sults from Liu et al. (2018). performs them. On the E2E data, for example, we see in Table 1 that the SUB baseline, despite having fairly impressive performance for a non- parametric model, fares the worst. The neural HSMM models are largely competitive with the encoder-decoder system on the validation data, de- spite offering the benefits of interpretability and controllability; however, the gap increases on test. Table 2 evaluates our system's performance on the test portion of the WikiBio dataset, compar- ing with the systems and baselines implemented by Lebret et al. (2016). Again for this dataset we see that their templated Kneser-Ney model under- performs on the automatic metrics, and that neu- ral models improve on these results. Here the HSMMs are competitive with the best model of Lebret et al. (2016), and even outperform it on ROUGE. We emphasize, however, that recent, so- phisticated approaches to encoder-decoder style database-to-text generation have since surpassed the results of Lebret et al. (2016) and our own, and we show the recent seq2seq style results of Liu et al. (2018), who use a somewhat larger model, at the bottom of Table 2. 7.1 Qualitative Evaluation We now qualitatively demonstrate that our gener- ations are controllable and interpretable. Controllable Diversity One of the powerful as- pects of the proposed approach to generation is that we can manipulate the template z(i) while leaving the database x constant, which allows for easily controlling aspects of the generation. In Ta- ble 3 we show the generations produced by our model for five different neural template sequences z(i), while fixing x. There, the segments in each generation are annotated with the latent states de- termined by the corresponding z(i). We see that these templates can be used to affect the word- ordering, as well as which fields are mentioned in the generated text. Moreover, because the discrete states align with particular fields (see below), it is generally simple to automatically infer to which fields particular latent states correspond, allowing users to choose which template best meets their re- quirements. We emphasize that this level of con- trollability is much harder to obtain for encoder- decoder models, since, at best, a large amount of sampling would be required to avoid generating around a particular mode in the conditional distri- bution, and even then it would be difficult to con- trol the sort of generations obtained. kenny warren name: kenny warren, birth date: 1 april 1946, birth name: kenneth warren deutscher, birth place: brooklyn, new york, occupation: ventriloquist, comedian, author, notable work: book - the revival of ventriloquism in america 1. [kenneth warren deutscher]132 [ ( ]75 [born]89 [april 1, 1946]101 [ ) ]67 [is an american]82 [author]20 [and]1 [ventriloquist and comedian]69 [.]88 2. [kenneth warren deutscher]132 [ ( ]75 [born]89 [april 1, 1946]101 [ ) ]67 [is an american]82 [author]20 [best known for his]95 [the revival of ventriloquism]96 [.]88 3. [kenneth warren]16 ["kenny" warren]117 [ ( ]75 [born]89 [april 1, 1946]101 [ ) ]67 [is an american]127 [ventriloquist, comedian]28 [.]133 4. [kenneth warren]16 ["kenny" warren]117 [ ( ]75 [born]89 [april 1, 1946]101 [ ) ]67 [is a]104 [new york]98 [author]20 [.]133 5. [kenneth warren deutscher]42 [is an american]82 [ventriloquist, comedian]118 [based in]15 [brooklyn, new york]84 [.]88 Table 4: Impact of varying the template z(i) for a single x from the WikiBio validation data; generations are annotated with the segmentations of the chosen z(i). Results were obtained using the NTemp model from Table 2. Interpretable States Discrete states also pro- vide a method for interpreting the generations pro- duced by the system, since each segment is explic- itly typed by the current hidden state of the model. Table 4 shows the impact of varying the template z(i) for a single x from the WikiBio dataset. While there is in general surprisingly little stylistic varia- tion in the WikiBio data itself, there is variation in the information discussed, and the templates cap- ture this. Moreover, we see that particular discrete states correspond in a consistent way to particular pieces of information, allowing us to align states with particular field types. For instance, birth names have the same hidden state (132), as do names (117), nationalities (82), birth dates (101), and occupations (20). To demonstrate empirically that the learned states indeed align with field types, we calculate the average purity of the discrete states learned for both datasets in Table 5. In particular, for each discrete state for which the majority of its gen- erated words appear in some rj, the purity of a state's record type alignment is calculated as the percentage of the state's words that come from the most frequent record type the state represents. This calculation was carried out over training ex- amples that belonged to one of the top 100 most frequent templates. Table 5 indicates that discrete states learned on the E2E data are quite pure. Dis- crete states learned on the WikiBio data are less pure, though still rather impressive given that there are approximately 1700 record types represented in the WikiBio data, and we limit the number of states to 135. Unsurprisingly, adding autoregres- siveness to the model decreases purity on both datasets, since the model may rely on the autore- gressive RNN for typing, in addition to the state's identity. NTemp E2E WikiBio 81.7 (17.9) 37.5 (18.9) NTemp+AR 81.2 (15.7) 36.3 (20.2) Table 5: Empirical analysis of the average purity of dis- crete states learned on the E2E and WikiBio datasets, for the NTemp and NTemp+AR models. Average purities are given as percents, and standard deviations follow in parentheses. See the text for full description of this calculation. 8 Conclusion and Future Work We have developed a neural, template-like gen- eration model based on an HSMM decoder, which can be learned tractably by backpropagat- ing through a dynamic program. The method al- lows us to extract template-like latent objects in a principled way in the form of state sequences, and then generate with them. This approach scales to large-scale text datasets and is nearly competi- tive with encoder-decoder models. More impor- tantly, this approach allows for controlling the diversity of generation and for producing inter- pretable states during generation. We view this work both as the first step towards learning dis- crete latent variable template models for more dif- ficult generation tasks, as well as a different per- spective on learning latent variable text models in general. Future work will examine encouraging the model to learn maximally different (or mini- mal) templates, which our objective does not ex- plicitly encourage, templates of larger textual phe- nomena, such as paragraphs and documents, and hierarchical templates. Acknowledgments SW gratefully acknowledges the support of a Siebel Scholars award. AMR gratefully acknowl- edges the support of NSF CCF-1704834, Intel Re- search, and Amazon AWS Research grants. References Gabor Angeli, Percy Liang, and Dan Klein. 2010. A simple domain-independent probabilistic approach to generation. In Proceedings of the 2010 Confer- ence on Empirical Methods in Natural Language Processing, pages 502 -- 512. Association for Com- putational Linguistics. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly learning to align and translate. In ICLR. Satanjeev Banerjee and Alon Lavie. 2005. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evalu- ation measures for machine translation and/or sum- marization, pages 65 -- 72. Anja Belz. 2008. Automatic generation of weather forecast texts using comprehensive probabilistic generation-space models. Natural Language Engi- neering, 14(04):431 -- 455. Anja Belz and Ehud Reiter. 2006. Comparing auto- matic and human evaluation of nlg systems. In 11th Conference of the European Chapter of the Associa- tion for Computational Linguistics. Andrew Chisholm, Will Radford, and Ben Hachey. 2017. Learning to generate one-sentence biogra- phies from wikidata. CoRR, abs/1702.06235. KyungHyun Cho, Bart van Merrienboer, Dzmitry Bah- danau, and Yoshua Bengio. 2014. On the properties of neural machine translation: Encoder-decoder ap- proaches. Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation. Hanjun Dai, Bo Dai, Yan-Ming Zhang, Shuang Li, and Le Song. 2017. Recurrent hidden semi-markov In International Conference on Learning model. Representations. Ondrej Dusek and Filip Jurcıcek. 2016. Sequence-to- sequence generation for spoken dialogue via deep syntax trees and strings. In The 54th Annual Meet- ing of the Association for Computational Linguis- tics, page 45. Mark JF Gales and Steve J Young. 1993. The theory of segmental hidden Markov models. University of Cambridge, Department of Engineering. Albert Gatt and Ehud Reiter. 2009. Simplenlg: A re- In Pro- alisation engine for practical applications. ceedings of the 12th European Workshop on Natural Language Generation, pages 90 -- 93. Association for Computational Linguistics. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Incorporating copying mechanism in Li. 2016. sequence-to-sequence learning. In ACL. C¸ aglar Gulc¸ehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. 2016. Pointing the unknown words. In ACL. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Comput., 9:1735 -- 1780. Blake Howald, Ravikumar Kondadadi, and Frank Schilder. 2013. Domain adaptable semantic clus- tering in statistical nlg. In Proceedings of the 10th International Conference on Computational Seman- tics (IWCS 2013) -- Long Papers, pages 143 -- 154. Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. 2017. Toward con- trolled generation of text. In International Confer- ence on Machine Learning, pages 1587 -- 1596. Po-Sen Huang, Chong Wang, Sitao Huang, Dengyong Zhou, and Li Deng. 2018. Towards neural phrase- based machine translation. In International Confer- ence on Learning Representations. Dan Jurafsky and James H Martin. 2014. Speech and language processing. Pearson London. Ravi Kondadadi, Blake Howald, and Frank Schilder. 2013. A statistical nlg framework for aggregated planning and realization. In Proceedings of the 51st Annual Meeting of the Association for Computa- tional Linguistics (Volume 1: Long Papers), vol- ume 1, pages 1406 -- 1415. Lingpeng Kong, Chris Dyer, and Noah A Smith. 2016. In Interna- Segmental recurrent neural networks. tional Conference on Learning Representations. Ioannis Konstas and Mirella Lapata. 2013. A global model for concept-to-text generation. J. Artif. Intell. Res.(JAIR), 48:305 -- 346. Karen Kukich. 1983. Design of a knowledge-based re- port generator. In ACL, pages 145 -- 150. R´emi Lebret, David Grangier, and Michael Auli. 2016. Neural text generation from structured data with In EMNLP, application to the biography domain. pages 1203 -- 1213. J. Li, R. Jia, H. He, and P. Liang. 2018. Delete, retrieve, generate: A simple approach to sentiment and style transfer. In North American Association for Compu- tational Linguistics (NAACL). Percy Liang, Michael I Jordan, and Dan Klein. 2009. Learning semantic correspondences with less super- vision. In ACL, pages 91 -- 99. Association for Com- putational Linguistics. Chin-Yew Lin. 2004. Rouge: A package for auto- matic evaluation of summaries. Text Summarization Branches Out. Tianyu Liu, Kexiang Wang, Lei Sha, Baobao Chang, and Zhifang Sui. 2018. Table-to-text generation by structure-aware seq2seq learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial In- telligence. Liang Lu, Lingpeng Kong, Chris Dyer, Noah A Smith, and Steve Renals. 2016. Segmental recurrent neural networks for end-to-end speech recognition. Inter- speech 2016, pages 385 -- 389. Thang Luong, Hieu Pham, and Christopher D. Man- ning. 2015. Effective approaches to attention-based In Proceedings of the neural machine translation. 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, pages 1412 -- 1421. Kathleen McKeown. 1992. Text generation - using dis- course strategies and focus constraints to generate natural language text. Studies in natural language processing. Cambridge University Press. Susan W McRoy, Songsak Channarukul, and Syed S Ali. 2000. Yag: A template-based generator for real- In Proceedings of the first interna- time systems. tional conference on Natural language generation- Volume 14, pages 264 -- 267. Association for Compu- tational Linguistics. Hongyuan Mei, Mohit Bansal, and Matthew R. Walter. 2016. What to talk about and how? selective gener- ation using lstms with coarse-to-fine alignment. In NAACL HLT, pages 720 -- 730. Kevin P Murphy. 2002. Hidden semi-markov models (hsmms). unpublished notes, 2. Vinod Nair and Geoffrey E Hinton. 2010. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 807 -- 814. Jekaterina Novikova, Ondrej Dusek, and Verena Rieser. 2017. The E2E dataset: New challenges for end-to- end generation. In Proceedings of the 18th Annual Meeting of the Special Interest Group on Discourse and Dialogue, Saarbrucken, Germany. Mari Ostendorf, Vassilios V Digalakis, and Owen A Kimball. 1996. From hmm's to segment models: A unified view of stochastic modeling for speech recognition. IEEE Transactions on speech and au- dio processing, 4(5):360 -- 378. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. Bleu: a method for automatic eval- In Proceedings of uation of machine translation. the 40th annual meeting on association for compu- tational linguistics, pages 311 -- 318. Association for Computational Linguistics. Adam Paszke, Sam Gross, Soumith Chintala, Gre- gory Chanan, Edward Yang, Zachary DeVito, Zem- ing Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in pytorch. NIPS 2017 Autodiff Workshop. Lawrence R Rabiner. 1989. A tutorial on hidden markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257 -- 286. Ehud Reiter and Robert Dale. 1997. Building applied natural language generation systems. Natural Lan- guage Engineering, 3(1):57 -- 87. Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. 2017. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Informa- tion Processing Systems, pages 6833 -- 6844. Yikang Shen, Zhouhan Lin, Chin wei Huang, and Aaron Courville. 2018. Neural language modeling by jointly learning syntax and lexicon. In Interna- tional Conference on Learning Representations. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929 -- 1958. Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. 2014. Sequence to sequence learning with neural net- works. In Advances in Neural Information Process- ing Systems (NIPS), pages 3104 -- 3112. Hao Tang, Weiran Wang, Kevin Gimpel, and Karen End-to-end training approaches Livescu. 2016. In Spoken for discriminative segmental models. Language Technology Workshop (SLT), 2016 IEEE, pages 496 -- 502. IEEE. Ke M Tran, Yonatan Bisk, Ashish Vaswani, Daniel Marcu, and Kevin Knight. 2016. Unsupervised neu- In Proceedings of the ral hidden markov models. Workshop on Structured Prediction for NLP, pages 63 -- 71. Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. 2015. Cider: Consensus-based image de- In Proceedings of the IEEE scription evaluation. conference on computer vision and pattern recog- nition, pages 4566 -- 4575. Chong Wang, Yining Wang, Po-Sen Huang, Abdel- rahman Mohamed, Dengyong Zhou, and Li Deng. 2017. Sequence modeling via segmentations. In In- ternational Conference on Machine Learning, pages 3674 -- 3683. Lu Wang and Claire Cardie. 2013. Domain- independent abstract generation for focused meeting summarization. In Proceedings of the 51st Annual Meeting of the Association for Computational Lin- guistics (Volume 1: Long Papers), volume 1, pages 1395 -- 1405. Sam Wiseman, Stuart Shieber, and Alexander Rush. 2017. Challenges in data-to-document generation. In Proceedings of the 2017 Conference on Empiri- cal Methods in Natural Language Processing, pages 2253 -- 2263. Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W. Cohen. 2018. Breaking the softmax bottleneck: A high-rank RNN language model. In International Conference on Learning Representa- tions. U 1 ∈ Rm3×d and U 2 ∈ RK×m2×m3; D(x) is de- fined analogously. For all experiments, m1 = 64, m2 = 32, and m3 = 64. Optimization We train with SGD, using a learn- ing rate of 0.5 and decaying by 0.5 each epoch after the first epoch in which validation log- likelihood fails to increase. When using an au- toregressive HSMM, the additional LSTM is op- timized only after the learning rate has been de- cayed. We regularize with Dropout (Srivastava et al., 2014). A.2 Additional Learned Templates In Tables 6 and 7 we show visualizations of addi- tional templates learned on the E2E and WikiBio data, respectively, by both the non-autoregressive and autoregressive HSMM models presented in the paper. For each model, we select a set of five dissimilar templates in an iterative way by greed- ily selecting the next template (out of the 200 most frequent) that has the highest percentage of states that do not appear in the previously selected tem- plates; ties are broken randomly. Individual states within a template are visualized using the three most common segments they generate. Zichao Yang, Phil Blunsom, Chris Dyer, and Wang Ling. 2016. Reference-aware language models. CoRR, abs/1611.01628. Lei Yu, Jan Buys, and Phil Blunsom. 2016. Online seg- In Proceed- ment to segment neural transduction. ings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1307 -- 1316. Junbo Jake Zhao, Yoon Kim, Kelly Zhang, Alexan- der M. Rush, and Yann LeCun. 2018. Adversari- ally regularized autoencoders. In Proceedings of the 35th International Conference on Machine Learn- ing, ICML 2018, pages 5897 -- 5906. A Supplemental Material A.1 Additional Model and Training Details Computing rj A record rj is represented by embedding a feature for its type, its position, and its word value in Rd, and applying an MLP with ReLU nonlinearity (Nair and Hinton, 2010) to form rj ∈ Rd, similar to Yang et al. (2016) and Wiseman et al. (2017). LSTM Details The initial cell and hidden- state values for the decoder LSTM are given by Q1xa and tanh(Q2xa), respectively, where Q1, Q2 ∈ Rd×d. When a word yt appears in a record rj, the input to the LSTM at time t + 1 is computed using an MLP with ReLU nonlinearity over the concatena- tion of the embeddings for rj's record type, word value, position, and a feature for whether it is the final position for the type. If there are multiple rj from which yt could have been copied, the com- puted representations are averaged. At test time, we use the MAP rj to compute the input, even if there are multiple matches. For yt which could not have been copied, the input to the LSTM at time t + 1 is computed using the same MLP over yt and three dummy features. For the autoregressive HSMM, an additional 1- layer LSTM with d hidden units is used. We ex- perimented with having the autoregressive HSMM consume either tokens y1:t in predicting yt+1, or the average embedding of the field types corre- sponding to copied tokens in y1:t. The former worked slightly better for the WikiBio dataset (where field types are more ambiguous), while the latter worked slightly better for the E2E dataset. Transition function em- C(xu), which produces hidden state beddings conditional on the source, is de- fined as C(xu) = U 2(ReLU(U 1xu)), where Distribution The is a is an is a family friendly Italian French fast food ... restaurant pub place ... with a with with an ... average high low ... customer rating . price range rating ... The Mill Bibimbap House The Twenty Two ... located in the located on the located north of the ... centre of the city river city centre ... that serves serving that provides ... The Waterman The Golden Palace Browns Cambridge ... There is a There is a cheap ... There is an fast food . take-away deliveries sushi ... ... restaurant coffee shop French restaurant ... The Olive Grove The Punter The Cambridge Blue restaurant pub ... serves offers has ... fast food . take-away deliveries sushi ... ... The ... Child friendly The average priced restaurant coffee shop French restaurant ... The Mill Bibimbap House The Twenty Two ... serves offers has ... English Indian Italian ... food . cuisine dishes ... The Strada The Dumpling Tree Alimentum ... provides serves offers ... Indian Chinese English ... food in the food at a food and has a ... customer rating of price range of rating of 1 out of 5 . average 5 out of 5 ... ... high moderate average ... price range customer rating . rating ... It is They are It's ... near located in the located near ... Italian fast food French ... restaurant called place called restaurant named ... The Waterman . Cocum Loch Fyne ... 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. The Eagle The Golden Curry Zizzi ... riverside city centre Cafe Sicilia ... serves providing Chinese English Indian provides . Its customer rating is The price range is It has a ... ... ... food cuisine Food ... in the with a and has a ... 1 out of 5 . average high ... Located near Located in the The Portland Arms riverside city centre is an is a family friendly there is a A family friendly ... Italian fast food French ... restaurant coffee shop pub ... ... is called named ... The Waterman . Cocum Loch Fyne ... Near ... A An ... Near ... A An ... Located near Located in the The Portland Arms riverside city centre , The Eagle The Golden Curry is a is a family friendly ... Italian fast food French ... Zizzi ... near restaurant coffee shop pub ... located in the located near ... is an ... riverside city centre Cafe Sicilia ... A family friendly is called named ... The Waterman . Cocum Loch Fyne ... cheap family-friendly family friendly ... Italian fast food French ... restaurant . coffee shop pub ... Table 6: Five templates extracted from the E2E data with the NTemp model (top) and the Ntemp+AR model (bottom). 1. 2. 3. 4. 5. 1. 2. 3. 4. william henry george augustus frederick marie anne de bourbon ... was ( ( ; ... born born on born 1 ... ) ]) ] ... is an american was an american is a russian ... politician . football player actor ... captain lieutenant sir ... john herbert hartley donald charles cameron was a british was an english ... world war i world war first world war ... national team . organization super league ... 1968 1960 1970 ... was a john herbert hartley donald charles cameron ... is a was a is an ... john herbert hartley donald charles cameron was a is a is a former ... ... ... major league baseball ... american australian ... indie rock death metal band midfielder defenceman ska ... from for based in ... australia . los angeles, california chicago ... football professional baseball professional ice hockey ... midfielder . defender goalkeeper ... footballer professional footballer rules footballer james william john ... william " billy " wilson " jack " henry smith ... who plays for who currently plays for who played with ... ( 1900 c. 1894 1913 ... -- france budapest buenos aires ) is an american is an english was an american ... ... paganese south melbourne fc dynamo kyiv ... in the of the and the ... vicotiral football league national football league australian football league ... ... ( vfl nfl afl ... ) . anderson da silva aftab ahmed david jones ... ( ; ... born born on born 1 ... 1951 1970 1974 ... ) ] ... is an american was an american is an english ... actor actress cricketer ... . anderson da silva aftab ahmed david jones ... adjutant lieutenant captain ... william john william was a is a former is a ... aftab ahmed david jones anderson da silva ... " billy " watson jim " edward smith ... james " ... who plays for who currently plays for who played with ... world war i liberal baseball ... member of the party member of the recipient of the ... pennsylvania austrian montana ... house of representatives . legislature senate ... was a is a former is a ... world war i liberal baseball ... member of the party member of the recipient of the ... knesset . scottish parliament fc lokomotiv liski ... c. 1900 1913 ... ( 1913 collingwood st kilda carlton ... in - ... -- in the of the and the ... 1917 surrey, england british columbia ) was an american was an australian is an american football player rules footballer defenceman ... ... ... victorial football league national football league australian football league ... ( vfl afl nfl ... ) . 5. anderson da silva aftab ahmed david jones ... is a is a former is a female ... member of the party member of the recipient of the ... knesset scottish parliament fc lokomotiv liski ... . Table 7: Five templates extracted from the WikiBio data with the NTemp model (top) and the Ntemp+AR model (bottom).
1907.08672
1
1907
2019-07-19T20:09:03
Discourse-Based Evaluation of Language Understanding
[ "cs.CL" ]
We introduce DiscEval, a compilation of $11$ evaluation datasets with a focus on discourse, that can be used for evaluation of English Natural Language Understanding when considering meaning as use. We make the case that evaluation with discourse tasks is overlooked and that Natural Language Inference (NLI) pretraining may not lead to the learning really universal representations. DiscEval can also be used as supplementary training data for multi-task learning-based systems, and is publicly available, alongside the code for gathering and preprocessing the datasets.
cs.CL
cs
Discourse-Based Evaluation of Language Understanding Damien Sileo1 , 3, Tim Van-de-Cruys2, Camille Pradel1, Philippe Muller3 1:Synapse D´eveloppement, 2:IRIT (CNRS), 3:IRIT (University of Toulouse) [email protected] Abstract We introduce DiscEval, a compilation of 11 evaluation datasets with a focus on discourse, that can be used for evaluation of English Natural Language Understanding when considering meaning as use. We make the case that evaluation with discourse tasks is overlooked and that Natural Language Inference (NLI) pretraining may not lead to the learning really universal representations. DiscEval can also be used as supplementary training data for multi-task learning-based systems, and is publicly available, alongside the code for gathering and preprocessing the datasets. Keywords: Representation learning, evaluation, discourse, semantics, pragmatics, natural language understanding 1. Introduction Recent models for Natural Language Understanding (NLU) have made unusually quick progress over the last year, according to current evaluation frameworks. The GLUE benchmark (Wang et al., 2018) was designed to be a set of challenging tasks for NLU. However, the best current sys- tems surpass human accuracy estimate on the average score of the GLUE tasks1. While these benchmarks have been created for evaluation purposes, the best performing systems (Liu et al., 2019; Yang et al., 2019) rely on multi-task learning and use all the evaluation tasks as training tasks before the task-specific evaluations. These multi-task models, seen as the best per- forming, are also released for general purpose use. How- ever, such multi-task finetuning might lead to catastrophic forgetting of capacities learned during the first training phase (viz. language modeling for BERT). This tendency makes the representativeness of these benchmark tasks all the more important. A wide range of important work actually trust SentEval (Cer et al., 2018; Kiros and Chan, 2018; Subramanian et al., 2018; Wieting et al., 2015) or GLUE (Liu et al., 2019) in order to back up the claim that encoders produce univer- sal representations. Since the consensual benchmarks can be a strong guidance for the evolution of NLU models, they should be as exhaus- tive as possible, and closely related to the models' end use cases. Ultimately, many use cases are related to conversa- tion with end users or analysis of structured documents. In such cases, discourse analysis (i.e. the ability to parse high- level textual structures that take into account the global con- text) is a prerequisite for human level performance. More generally, the evaluation of NLU systems should in- corporate pragmatics aspects and take into account the ac- tual intent of speech acts (Searle et al., 1980), while existing evaluations may focus mostly on semantic aspects (e.g. se- mantic similarity and NLI). In real word use, recognizing the implicatures of a statement is arguably more important than recognizing its mere implications (Grice, 1975). An implicature of a statement is a part of its meaning that is not contained it its literal interpretation and is dependent on the context (which may not be explicitly available, but can be inferred). Consider the following utterance : You're standing on my foot. Implications of this utterance include You are standing on a part of my body or Someone is touching me. On another hand, a plausible implicature of this utterance is that the speaker wants the adressee to move further away. The speaker's intention, also called illocutionary force (Austin, 1975) can be regarded as a dimension of meaning that is complementary to the literal content (Green, 2000). Understanding the literal semantic content of a statement in a conversation or a document is not sufficient if it does not allow a NLU system to understand how that statement should change a situation or how it fits a broader con- text. Speech acts have been categorized into classes such as ASSERTION, QUESTION or ORDER which have differ- ent kinds of effects on the world. For instance, constative speech acts (e.g. the sky is blue) describe a state of the world and are either true or false while performative speech acts (e.g. I declare you husband and wife) can change the world upon utterance (Austin, 1975). Discourse tasks focus on the meaning of language as use. Therefore, a discourse- centric evaluation could by construction be a better fit to evaluate how NLU models perform in practical use cases, or at least should be used as a complement to semantics- centered evaluations. Thus, we make the case that ignoring discourse in evalua- tions is detrimental to NLU. We compile a list of 11 tasks that should complement existing evaluations frameworks. We frame all our tasks as classification tasks (either of sen- tences, or of sentence pairs) so that they can be seamlessly integrated with other evaluation or multi-task pretraining setups (GLUE or SentEval tasks). Our evaluation bench- mark, named DiscEval, is publicly available2. We evaluate state of the art NLU models on these tasks by fine-tuning BERT on several auxiliary finetuning datasets and show that the most widely used auxiliary finetuning dataset, viz. MNLI, is not the best performing on DiscEval. 1as of june 2019 2https://github.com/synapse-developpement/DiscEval 2. Related Work Evaluation methods of NLU have been the object of heated debates since the proposal of the Turing Test. Automatic evaluations can be based on sentence similarity (Agirre et al., 2012) and leverage human annotated scores of simi- larity between sentence pairs. Sentence similarity estima- tion tasks can potentially encompass many aspects, but it is not clear how humans annotators weight semantic, stylistic, and discursive aspects during their rating. Using a set of more focused and clearly defined tasks has been a popular approach. Kiros et al. (2015) proposed a set of tasks and tools for sentence understanding evalua- tion. These tasks were compiled in the SentEval (Conneau et al., 2017) evaluation suite designed for automatic evalua- tion of pre-trained sentence embeddings. SentEval tasks are mostly based on sentiment analysis, sentence similarity and natural language inference, and forces the user to provide a sentence encoder that is not finetuned during the evalua- tion. Concurrently, Zhang et al. (2015) also compiled a set of text classification tasks based on thematic classification and sentiment analysis, that is still used to evaluate docu- ment level representation learning (Yang et al., 2019). GLUE (Wang et al., 2018) propose to evaluate language understanding with less constraints than SentEval, allow- ing users not to rely on explicit sentence embedding based models. These tasks are classification or regression based, and are carried out for sentences or sentence pairs. Ad- ditionally, they propose diagnostic NLI tasks where vari- ous annotated linguistic phenomena occur, which could be necessary to make the right predictions, as in Poliak et al. (2018b). Natural Language Inference can be regarded as a univer- sal framework for evaluation (Poliak et al., 2018a). In the Recast framework, existing datasets (e.g. sentiment anal- ysis) are casted as NLI tasks. For instance, based on the sentence don't waste your money, annotated as a negative review, they use handcrafted rules to generate the following example: (PREMISE: When asked about the product, liam said "don't waste your money" , HYPOTHESIS: Liam didn't like the product, LABEL: entailment) However, the generated datasets do not allow an evalua- tion to measure directly how well a model deals with the semantic phenomena present in the original dataset, since some sentences use artificially generated reported speech. Thus, NLI data could be used to evaluate discourse analy- sis, but it is not clear how to generate examples that are not overly artificial. Moreover, it is unclear to what extent the examples in existing NLI datasets are required to deal with pragmatics. SuperGLUE (Wang et al., 2018) updates GLUE with six novel tasks that are selected to be even more challenging. Two of them deal with contextualized lexical semantics, two tasks are a form of question answering, and two of them are NLI problems. One of those NLI tasks, Commitment- Bank3, is the only explicitly discourse-related task. 3https://github.com/mcdm/CommitmentBank/ Discourse relation prediction has been used by (Nie et al., 2017) and (Sileo et al., 2019) for sentence representation learning evaluation, but the dataset they use (PDTB (Prasad et al., 2008)) is included in ours. Other evaluations, like linguistic probing (Conneau et al., 2018; Belinkov and Glass, 2019; Wang et al., 2019b) fo- cus on an internal understanding of what is captured by the models (e.g. syntax, lexical content), rather than measuring performance on external tasks, and are outside the scope of this work. 3. Proposed Tasks Our goal is to compile a set of diverse discourse-related tasks. We restrict ourselves to classification either of sen- tences or sentence pairs. We only use publicly available datasets and tasks that are absent from other benchmarks (SentEval/GLUE). As opposed to Glue (Wang et al., 2018), we do not keep test labels hidden in order to allow faster experiments. The scores in the task are not meant to be compared to previous work, since we alter some datasets to yield more meaningful evaluations (we perform duplicate removal or class subsampling when mentioned). We first present the tasks, and then propose a rudimentary taxonomy of how they fit into conceptions of meaning as use. 3.1. DiscEval tasks In this section, we describe the datasets that are part of Dis- cEval. They are summarized in table 1. The name of the most frequent classes can be found in table 3. PDTB (Prasad et al., 2014) contains a collection of fine- grained implicit (i.e. not signaled by a discourse marker) relations between sentences from the news domain in the Penn Discourse TreeBank 2.0. We select the level 2 rela- tions as categories. STAC is a corpus of strategic chat conversations man- ually annotated with negotiation-related information, dia- logue acts and discourse structures in the framework of Segmented Discourse Representation Theory (SDRT). We only consider pairwise relations between all dialog acts, following Badene et al. (2019). We remove duplicate pairs and dialogues that only have non-linguistic utterances (coming from a server). We subsample dialog act pairs with no relation so that they constitute 20% of each fold. GUM is a corpus of multilayer annotations for texts from various domains; it includes Rhetorical Structure Theory (RST) discourse structure annotations. Once again, we only consider pairwise interactions between discourse units (e.g. sentences/clauses). We subsample dialog act pairs with no relation so that they constitute 20% of each dialog. We split the examples in train/test/dev sets randomly according to the dialog they belong to. Emergent (Ferreira and Vlachos, 2016) is composed of pairs of assertions and titles of news articles that are against, for, or neutral with respect to the opinion of the assertion. dataset categories exemple class Ntrain conjunction "it was censorship"/"it was outrageous" question-answer-pair "what ?"/"i literally lost" condition "Do not drink"/"if underage in your country" for "a meteorite landed in nicaragua."/"small meteorite hits managua" hedge "well , a little different , actually ," "yeah that 's that 's that 's what i meant ." acknowledge-answer "Co-operation is essential for team work"/"lions hunt in a team" low specificity discourse relation discourse relation discourse relation stance speech act speech act C/E/P/S/S/R presence of sarcasm "don't quit your day job"/"[...] i was going to sell this joke. [...]" I/I/F verifiability V/A/D sarcasm 9k 4k 6k 5k 13k 11k 2k 2k 19k 14k 0.6k PDTB STAC GUM Emergent SwitchBoard MRDA Persuasion SarcasmV2 Squinky Verifiability EmoBank "boo ya." "I've been a physician for 20 years." "I wanted to be there.." uninformative, high implicature, unformal verifiable-experiential low valence, high arousal, low dominance Table 1: DiscEval classification datasets. Ntrain is the number of examples in the training set. C/E/P/S/S/R denotes Claim- Type/Eloquence/PremiseType/Strength/Specificity/Relevance; I/I/F is Information/Implicature/Formality ; V/A/D denotes Valence/Arousal/Dominance PDTB STAC GUM Emergent SwitchB. MRDA Persuasion SarcasmV2 Squinky Verif. EmoBank AVG Majority fastText BERT BERT+MNLI BERT+DisSent BERT+Discovery 26.2 31 52.2 52.3 51.4 55.4 20.2 47 55.6 54.9 57.2 58.7 16.9 16.9 38.6 40.2 45.3 48.5 50.2 64.6 75.5 78.8 67.6 69.8 18.6 47.3 63.7 63.1 64.3 65.1 19.7 31 43.7 42.9 43.7 45.7 66.5 66.5 66.6 69.5 69.6 67.9 49 64.6 76.2 71.7 64.7 75.5 53.3 79.4 87.8 87.9 87.8 88.5 69.6 77 84.9 84.4 84 85.4 56.1 65 75.6 76.1 75.6 76.6 40.6 53.7 65.5 65.6 64.7 67.0 Table 2: Transfer test accuracies across DiscEval tasks; We report the average when the dataset has several classification tasks (as in Squinky, EmoBank and Persuasion); AVG denotes the average of DiscEval tasks; BERT+X refers to BERT pretrained classification model after auxiliary finetuning phase on task X . SwitchBoard (Godfrey et al., 1992) contains textual tran- scriptions of dialogs about various topics with annotated speech acts. We remove duplicate examples and subsample Statements and Non Statements so that they constitute 20% of the examples. We use a custom train/dev validation split (90/10 ratio) since this deduplication lead to a drastic size reduction of the original development set. The label of a speech can dependent on the context (previous utterances), but we discarded it in this work for the sake of simplicity, even though integration of context could improve the scores (Ribeiro et al., 2015). MRDA (Shriberg et al., 2004) contains textual transcrip- tion of multi-party real meetings, with speech acts annota- tions. We use a custom train/dev validation split (90/10 ra- tio) since this deduplication lead to a drastic size reduction of the original development set, and we subsample State- ment examples so that they constitue 20% of the dataset. We also ignored the context. Persuasion (Carlile et al., 2018) is a collection of argu- ments from student essays annotated with factors of per- sasiveness with respect to a claim; considered factors are the following: Specificity, Eloquence, Relevance, Strength, ClaimType, PremiseType. For each graded target (first 4 factors), we cast the ratings into three quantiles and discard the middle quantile. Squinky dataset (Lahiri, 2015) gather annotations in Formality and Informativeness and Implicature where sen- tences were graded on a scale from 1 to 7. They define the Implicature score as the amount of not explicitly stated in- formation carried in a sentence. For each target, we cast the ratings into three quantiles and discard the middle quantile. Verifiability (Park and Cardie, 2014) is a collection of online user comment annotated as Verifiable-Experiential (verifiable and about writer's experience) Verifiable-Non- Experiential or Unverifiable. EmoBank (Buechel and Hahn, 2017) aggregates emo- tion annotations on texts from various domains using the VAD reprsentation format. The authors define Valence as corresponding to the concept of polarity4, Arousal as degree of calmness or excitement and Dominance as per- ceived degree of control over a situation. For each target, we cast the ratings into three quantiles and discard the mid- dle quantile. 3.2. Articulating DiscEval tasks A sentence can have a goal (characterized by speech act or discourse relation), can pursue that goal through various means (e.g. using appeal to emotions, or verifiable argu- ments), and can achieve that goal with varying degrees of success. This leads us to a rudimentary grouping of our tasks: SarcasmV2 (Oraby et al., 2016) consists of messages from online forums with responses that may or may not be sarcastic according to human annotations. sis. 4This is the dimension that is widely used in sentiment analy- -- The speech acts classification tasks (SwitchBoard, MRDA) deal with the detection of the function of ut- terances. They use the same label set (viz. DASML) (Allen and Core, 1997) but different domains and an- notation guidelines. A discourse relation characterizes how a sentence contributes to a meaning of a docu- ment/conversation (e.g; through elaboration or con- trast), so this task requires a form of understanding of the use of a sentence, and how a sentence fits with another sentence in a broader discourse. Here, three tasks (PDTB, STAC, GUM) deal with discourse rela- tion prediction with varying domains and formalisms5. The Stance detection task can be seen as a coarse grained discourse relation classification. -- Persuasiveness prediction is a useful tool to assess whether a model can measure how well a sentence can achieve its intended goal. This aspect is orthogonal to the determination of the goal itself, and is arguably equally important. -- Detecting emotional content, verifiability, formality, informativeness or sarcasm is necessary in order to figure out in what realm communication is occuring. A statement can be persuasive, yet poorly informative and unverifiable. Emotions (Dolan, 2002) and power perception (Pfeffer, 1981) can have a strong influence on human behavior and text interpretation. Manipu- lating emotions can be the main purpose of a speech act as well. Sarcasm is a another mean of communi- cation and sarcasm detection is in itself an interesting task for evaluation or pragmatics, since sarcasm is a clear case of literal meaning being different from the intended meaning. 4. Evaluations 4.1. Models We provide two baselines for DiscEval: prediction of the majority class, and a fastText classifier. The fastText classi- fier (Joulin et al., 2016) has randomly initialized embed- dings of size 10 and default parameters otherwise. Em- beddings size was picked among {10, 100} according to DiscEval development set accuracy. When the input is a sentence pair, words have distinct representations for their occurrences in first and second sentence (e.g. cat s1 and cat s2 for the word cat) As another reference, we evaluate BERT (Devlin et al., 2019) base uncased model; During evaluation fine-tuning phase, we use 2 epochs and HuggingFace script6 default parameters otherwise. We also perform experiments with Supplementary Train- ing on Intermediate Labeled-data Tasks (STILT) (Phang et al., 2018). STILT is a further pretraining step on a data- rich task before the final fine-tuning evaluation on the target task. We finetune BERT on three of such tasks: 5These formalisms have different assumptions and definitions about the nature of discourse structure. 6https://github.com/huggingface/pytorch-transformers/ MNLI (Williams et al., 2018) is a collection of 433k sen- tence pairs manually annotated with contradiction, entail- ment, or neutral relations. Finetuning with this dataset leads to accuracy improvement on all GLUE tasks except CoLA (Phang et al., 2018). DisSent data is from (Nie et al., 2017), consisting of 4.7M sentences or clauses that were separated by a dis- course marker from a list of 15 markers. Prediction of dis- course markers based of the context clauses/sentences with which they occurred have been used as a training signal for sentence representation learning. Authors used handcrafted rules for each marker in order to ensure that the markers ac- tually signal a form of relation. DisSent has underwhelm- ing results on the GLUE tasks as a STILT (Wang et al., 2019a). Discovery (Sileo et al., 2019) is another dataset for discourse marker prediction, composed of 174 discourse markers with 20k usage examples for each marker. Sen- tence pairs were extracted from web data, and the markers come either from the PDTB or from an heuristic automatic extraction. We finetune BERT on the STILTs with 1 to 3 epoch and select the best performing model according to DiscEval av- erage development set accuracy. 4.2. Overall Results These models are evaluated in table 2. We report the aver- age score of 8 runs of finetuning phases. DiscEval seem to be challenging to BERT base model. In- deed, for all tasks, there is a STILT that significantly im- proves the accuracy of BERT. The best overall result is achieved with Discovery STILT. Pretraining on MNLI also yields an overall improvement over vanilla BERT especially on Emergent stance classifi- cation task which is related to natural language inference. However, MNLI finetuning worsens the results of BERT on STAC, speech act classification, sarcasm detection, and verifiability detction tasks. MNLI has been suggested as a useful auxilary training task based on evaluation on GLUE(Phang et al., 2018) and Sen- tEval(Conneau et al., 2017) . Our evaluation suggests that finetuning a model with MNLI alone has drawbacks and that could be alleviated by using discourse marker predic- tion tasks. 4.3. Fine Grained Results DiscEval categories cover a broad range of discourse as- pects. The overall accuracies only show a synthetic view of the tasks evaluated in DiscEval. Some datasets (STAC, MRDA, Persuasiveness) contain many subcategories that allow a fine grained analysis through a wide array of classes (viz. 51 categories for MRDA). Table 3 shows a fine grained evaluation which yields some insights on the ca- pabilities of BERT. We do not report categories with a sup- port inferior to 20 for conciseness sake. Interestingly, Dis- covery and MNLI are quite complementary as STILTs; For instance, MNLI is helpful to stance detection and on some persuasion related tasks, while Discovery is the best per- forming in discourse relation prediction. 5. Conclusion We proposed DiscEval, a set of discourse related evalua- tion tasks, and used them to evaluate BERT finetuned on various auxiliary finetuning tasks. The results lead us to rethink the efficiency of mainly using NLI as an auxiliary training task. DiscEval can be used for training or evalua- tion in general NLU or discourse related work. In further investigations, we plan to use more general tasks than clas- sification on sentence or pairs, such as longer and possi- bly structured sequences. Several of the datasets we used (SwitchBoard, GUM, STAC) already contain such higher level structures. A comparison with human annotators on DiscEval tasks could also help to pinpoints the weaknesses of current models dealing with discourse phenomena. It would also be interesting to measure how scores on Dis- cEval tasks and GLUE tasks correlate to each other, and test whether multi-task learning on DiscEval and GLUE tasks improves the score on both benchmarks. A further step would be to study the correlation between performance metrics in deployed NLU systems and the scores of the automated evaluation benchmarks in order to validate our claims about centrality of discourse. class Emergent.for Emergent.observing Emergent.against EmoBank.Arousal.high EmoBank.Arousal.low EmoBank.Domninance.low EmoBank.Domninance.high EmoBank.Valence.low EmoBank.Valence.high Squinky.Formality.low Squinky.Formality.high Squinky.Implicature.low Squinky.Implicature.high Squinky.Informativeness.low Squinky.Informativeness.high GUM.no relation GUM.elaboration GUM.purpose GUM.circumstance GUM.condition MRDA.Statement MRDA.Expansions of y/n Answers MRDA.Defending/Explanation MRDA.Rising Tone MRDA.Offer MRDA.Floor Holder MRDA.Understanding Check MRDA.Floor Grabber MRDA.Assessment/Appreciation MRDA.Acknowledge-answer MRDA.Accept MRDA.Wh-Question MRDA.Collaborative Completion MRDA.Affirmative Non-yes Answers MRDA.Interrupted/Abandoned/Uninterpretable MRDA.Yes-No-question PDTB.Expansion PDTB.Entrel PDTB.Contingency PDTB.Comparison PDTB.Temporal PDTB.Cause PDTB.Restatement PDTB.Conjunction PDTB.Contrast PDTB.Instantiation PDTB.Asynchronous 67 0 0 0 66 77 0 72 0 69 0 69 0 70 0 0 29 0 0 0 33 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 55 0 0 0 0 41 0 0 0 0 0 Persuasion.Eloquence.low Persuasion.Eloquence.high Persuasion.PremiseType.common knowledge Persuasion.Relevance.high Persuasion.Relevance.low Persuasion.Specificity.low Persuasion.Specificity.high Persuasion.Strength.low Persuasion.Strength.high 86.0 0.0 84 81.0 0 73 0 72 0 STAC.Question answer pair STAC.no relation STAC.Acknowledgement STAC.Comment STAC.Elaboration STAC.Result STAC.Continuation STAC.Q Elab STAC.Contrast STAC.Clarification question STAC.Explanation SarcasmV2.sarcasm SarcasmV2.not sarcasm SwitchBoard.Uninterpretable SwitchBoard.Statement-non-opinion SwitchBoard.Yes-No-Question SwitchBoard.Wh-Question SwitchBoard.Statement-opinion SwitchBoard.Declarative Yes-No-Question SwitchBoard.Conventional-closing SwitchBoard.Action-directive SwitchBoard.Agree/Accept SwitchBoard.Summarize/Reformulate SwitchBoard.Appreciation Verifiability.unverifiable Verifiability.non-experiential Verifiability.experiential 0 34 0 0 0 0 0 0 0 0 0 0 66 31 0 0 0 0 0 0 0 0 0 0 82 0 0 Majority fastText BERT BERT+DisSent BERT+ Discovery BERT+MNLI support 74.1 54.9 31.8 51.1 62.5 76.5 33.1 76.9 65.4 90.6 89.4 68.8 49.4 87.5 85.8 0 29 0 0 0 39.3 27.6 49.5 20.2 39.5 33.1 8.6 29.4 33.7 33.3 32.9 33.9 19 2.7 0 0 55.2 50.7 25.7 0 0 45.3 0 38.4 0 0 0 86.0 0.0 84 81.0 0 73 0.7 72 0 71 38.9 62.1 41.4 25.6 50 20 46.9 0.5 0 6.5 68 60.5 69.2 46.9 63.5 61.8 4.4 28.3 56.7 9.6 43.9 3.1 52.7 85.8 25.6 62.7 81.4 72.6 67.8 71.6 72.1 76.2 55.2 88.1 84.8 96.8 96.3 74.8 72.9 94.3 93.1 43.4 48.1 56.8 56.8 67.8 48.2 45.4 53.7 41.3 52.7 57.2 47.1 40 56.8 34.7 41.5 61.4 24.9 9.9 17 22.1 64.3 67.4 51.8 41.5 41.1 58.4 44.9 53.8 45.8 63.5 52.5 86.0 0.0 84 81.0 0 74.9 15.2 72.1 0.8 81.2 37.8 71 52.4 43.4 56 27.2 59.8 45 38.4 22.6 76.4 77.1 86.9 63.5 81.5 72.6 49 41.3 76.3 64.4 58.5 28.6 81.9 90.1 63.7 78.4 72.5 54.9 31.1 74.0 72.5 75.6 56.8 87.1 84 96.8 96.4 74.8 72 94.2 93.3 42.4 53.7 79.5 65.2 68 48.3 45.1 53.2 41.5 51.8 57.4 47.7 36.8 58.4 40.1 39.8 59.7 23.8 10.6 11.8 19.8 64.2 66.2 52.8 44.8 39.1 59.6 43.4 53.2 48.1 60.8 48.2 86.0 0.0 84 81.0 0 84.0 70.9 72 0 81.2 38.6 71.6 52.8 46 59.4 26 59.4 42.4 44.2 33.8 63.6 67.8 88.6 62.1 80.4 73.2 48.1 41.6 73.8 65.4 61.3 27.9 81.2 90.3 62.4 77.4 79.2 58.9 56.8 72.8 73.4 77.1 53.5 88.2 84.5 96.3 96.2 75.8 73.8 94.4 93.5 47.5 54.3 85.3 67.7 70.9 48.7 45.1 54.3 41.9 54.6 57 49.3 37.6 58 44.3 43.6 61.2 27.1 15.5 29.6 40.3 65.5 69.2 53.9 49.8 42.8 60.0 52.7 55.1 52.8 66.5 57.7 86.0 0.0 84.2 81.0 0 79.4 49.4 73.4 9.2 81.8 41.8 73.0 54.5 47.0 56 34.3 62.7 47.0 42.2 36.7 70.9 74.6 87.7 63.3 81.1 71.5 53.3 42.5 78.0 65.9 58.6 28.8 81.1 90.9 65.1 79.9 82.5 75.6 81.9 73.3 73.1 74.3 59.5 87.5 84.2 96.6 95.8 74.7 72.8 93.8 92.7 34.3 49.3 66.8 63.1 68.7 47.8 44.7 53.5 41.2 51.2 57.5 46 35.6 56.8 32.5 42 60.1 22.7 8.8 10.8 21.9 63.6 67.2 52.1 44.9 32 59 44.7 54.3 48.7 64.6 49 86.0 0.0 84 80 9.8 81.4 72.2 74.2 22.6 81.5 35.7 71.2 50.7 42.7 53 25.8 61.7 43.2 37.3 32.5 75.7 66.2 87.2 61.8 80.4 74.4 42.8 36.6 77.7 68.9 58.4 22.9 83.3 90.1 60.6 77.1 130 97 32 346 337 502 296 360 283 240 212 246 219 250 214 45 42 27 23 20 1270 520 515 445 398 372 359 279 225 217 167 138 119 117 112 83 568 418 291 151 82 284 215 206 132 120 64 68 22 51 61 29 36 26 26 20 295 264 143 116 102 78 68 67 38 29 27 239 230 121 81 75 46 42 35 28 26 24 23 21 1687 370 367 Table 3: Transfer F1 scores across the categories of DiscEval tasks; BERT+X denotes BERT pretrained classification model after auxiliary finetuning phase on task X . Agirre et al., 2012 Agirre, E., Diab, M., Cer, D., and Gonzalez-Agirre, A. (2012). Semeval-2012 task 6: A pilot on semantic textual similarity. In Proceedings of the First Joint Conference on Lexical and Computational Semantics-Volume 1: Proceedings of the main confer- ence and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Eval- uation, pages 385 -- 393. Association for Computational Linguistics. Allen and Core, 1997 Allen, J. and Core, M. (1997). Draft of damsl: Dialog act markup in several layers. Austin, 1975 Austin, J. L. (1975). How to do things with words. Oxford university press. Badene et al., 2019 Badene, S., Thompson, C., Lorr´e, J.-P., and Asher, N. (2019). Learning Multi-party Discourse Structure Using Weak Supervision (regular paper). In Computational Linguistics and Intellectual Technolo- gies: papers from the Annual conference Dialogue, Moscou, Russie, 29/05/2019-01/06/2019, page (on line), http://www.aclweb.org, mai. Association for Computa- tional Linguistics (ACL). Belinkov and Glass, 2019 Belinkov, Y. J. (2019). Analysis methods in neural language process- ing: A survey. Transactions of the Association for Computational Linguistics, 7:49 -- 72. and Glass, Buechel and Hahn, 2017 Buechel, S. and Hahn, U. (2017). EmoBank: Studying the impact of annotation perspec- tive and representation format on dimensional emotion analysis. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 578 -- 585, Va- lencia, Spain, April. Association for Computational Lin- guistics. Carlile et al., 2018 Carlile, W., Gurrapadi, N., Ke, Z., and Ng, V. (2018). Give me more feedback: Annotating ar- gument persuasiveness and related attributes in student essays. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 621 -- 631, Melbourne, Australia, July. Association for Computational Linguistics. Cer et al., 2018 Cer, D., Yang, Y., yi Kong, S., Hua, N., Limtiaco, N., John, R. S., Constant, N., Guajardo- Cespedes, M., Yuan, S., Tar, C., Sung, Y.-H., Strope, B., and Kurzweil, R. (2018). Universal sentence encoder. Conneau et al., 2017 Conneau, A., Kiela, D., Schwenk, H., Barrault, L., and Bordes, A. (2017). Supervised Learn- ing of Universal Sentence Representations from Natural Language Inference Data. Emnlp. Conneau et al., 2018 Conneau, A., Kruszewski, G., Lample, G., Barrault, L., and Baroni, M. (2018). What you can cram into a single vector: Probing sentence embeddings for linguistic properties. In Proceedings of the 56th An- nual Meeting of the Association for Computational Lin- guistics (Volume 1: Long Papers), pages 2126 -- 2136. As- sociation for Computational Linguistics. Devlin et al., 2019 Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2019). Bert: Pre-training of deep bidi- rectional transformers for language understanding. In Proceedings of the 2019 Conference of the North Ameri- can Chapter of the Association for Computational Lin- guistics: Human Language Technologies, Volume 1 (Long Papers). Association for Computational Linguis- tics. Dolan, 2002 Dolan, R. J. (2002). Emotion, cognition, and behavior. science, 298(5596):1191 -- 1194. Ferreira and Vlachos, 2016 Ferreira, W. and Vlachos, A. (2016). Emergent: a novel data-set for stance classifi- cation. In HLT-NAACL. Godfrey et al., 1992 Godfrey, J. J., Holliman, E. C., and McDaniel, J. (1992). Switchboard: Telephone speech corpus for research and development. In Proceedings of the 1992 IEEE International Conference on Acoustics, Speech and Signal Processing - Volume 1, ICASSP'92, pages 517 -- 520, Washington, DC, USA. IEEE Computer Society. Green, 2000 Green, M. S. Illocutionary force and semantic content. Linguistics and Philosophy, 23(5):435 -- 473. (2000). Grice, 1975 Grice, H. P. (1975). Logic and conversation. In Peter Cole et al., editors, Syntax and Semantics: Vol. 3: Speech Acts, pages 41 -- 58. Academic Press, New York. Joulin et al., 2016 Joulin, A., Grave, E., Bojanowski, P., and Mikolov, T. (2016). Bag of Tricks for Efficient Text Classification. Kiros and Chan, 2018 Kiros, J. and Chan, W. (2018). In- ferLite: Simple universal sentence representations from natural language inference data. In Proceedings of the 2018 Conference on Empirical Methods in Natural Lan- guage Processing, pages 4868 -- 4874, Brussels, Belgium, October-November. Association for Computational Lin- guistics. Kiros et al., 2015 Kiros, R., Zhu, Y., Salakhutdinov, R. R., Zemel, R., Urtasun, R., Torralba, A., and Fidler, S. (2015). Skip-thought vectors. In Advances in neural in- formation processing systems, pages 3294 -- 3302. Lahiri, 2015 Lahiri, S. (2015). SQUINKY! A Corpus of Sentence-level Formality, Informativeness, and Implica- ture. CoRR, abs/1506.02306. Liu et al., 2019 Liu, X., He, P., Chen, W., and Gao, J. (2019). Improving multi-task deep neural networks via knowledge distillation for natural language understand- ing. arXiv preprint arXiv:1904.09482. Nie et al., 2017 Nie, A., Bennett, E. D., and Goodman, N. D. (2017). DisSent: Sentence Representation Learn- ing from Explicit Discourse Relations. Oraby et al., 2016 Oraby, S., Harrison, V., Reed, L., Her- nandez, E., Riloff, E., and Walker, M. (2016). Creat- ing and characterizing a diverse corpus of sarcasm in di- alogue. In Proceedings of the 17th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 31 -- 41. Association for Computational Linguistics. Park and Cardie, 2014 Park, J. and Cardie, C. (2014). Iden- tifying appropriate support for propositions in online user comments. In Proceedings of the first workshop on argumentation mining, pages 29 -- 38. Pfeffer, 1981 Pfeffer, J. (1981). Understanding the role of power in decision making. Jay M. Shafritz y J. Steven preting Neural Networks for NLP, pages 353 -- 355, Brus- sels, Belgium, November. Association for Computa- tional Linguistics. Wang et al., 2019a Wang, A., Hula, J., Xia, P., Pappagari, R., McCoy, R. T., Patel, R., Kim, N., Tenney, I., Huang, Y., Yu, K., Jin, S., Chen, B., Durme, B. V., Grave, E., Pavlick, E., and Bowman, S. R. (2019a). Can you tell me how to get past sesame street? sentence-level pre- training beyond language modeling. In ACL 2019. Wang et al., 2019b Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., and Bowman, S. R. (2019b). GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations. Wieting et al., 2015 Wieting, J., Bansal, M., Gimpel, K., and Livescu, K. (2015). Towards universal paraphrastic sentence embeddings. CoRR, abs/1511.08198. Williams et al., 2018 Williams, A., Nangia, N., and Bow- man, S. (2018). A broad-coverage challenge corpus for sentence understanding through inference. In Pro- ceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguis- tics: Human Language Technologies, Volume 1 (Long Papers), pages 1112 -- 1122. Association for Computa- tional Linguistics. Yang et al., 2019 Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R., and Le, Q. V. (2019). Xlnet: Gen- eralized autoregressive pretraining for language under- standing. Zhang et al., 2015 Zhang, X., Zhao, J., and LeCun, Y. (2015). Character-level convolutional networks for text classification. In Advances in neural information pro- cessing systems, pages 649 -- 657. Ott, Classics of Organization Theory, Wadsworth, pages 137 -- 154. Phang et al., 2018 Phang, J., F´evry, T., and Bowman, S. R. (2018). Sentence encoders on stilts: Supplementary training on intermediate labeled-data tasks. CoRR, abs/1811.01088. Poliak et al., 2018a Poliak, A., Haldar, A., Rudinger, R., Hu, J. E., Pavlick, E., White, A. S., and Van Durme, B. (2018a). Collecting diverse natural language inference problems for sentence representation evaluation. In Pro- ceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 67 -- 81. Poliak et al., 2018b Poliak, A., Naradowsky, J., Haldar, A., Rudinger, R., and Durme, B. V. (2018b). Hypothesis Only Baselines in Natural Language Inference. Proceed- ings of the 7th Joint Conference on Lexical and Compu- tational Semantics, (1):180 -- 191. Prasad et al., 2008 Prasad, R., Dinesh, N., Lee, A., Milt- sakaki, E., Robaldo, L., Joshi, A., and Webber, B. (2008). The penn discourse treebank 2.0. In Bente Maegaard Joseph Mariani Jan Odijk Stelios Piperidis Daniel Tapias Nicoletta Calzolari (Conference Chair), Khalid Choukri, editor, Proceedings of the Sixth In- ternational Conference on Language Resources and Evaluation (LREC'08), Marrakech, Morocco, may. European Language Resources Association (ELRA). http://www.lrec-conf.org/proceedings/lrec2008/. Prasad et al., 2014 Prasad, R., Riley, K. F., and Lee, A. (2014). Towards Full Text Shallow Discourse Relation Annotation : Experiments with Cross-Paragraph Implicit Relations in the PDTB. (2009). Ribeiro et al., 2015 Ribeiro, E., Ribeiro, R., and de Matos, D. M. (2015). The influence of context on dialogue act recognition. arXiv preprint arXiv:1506.00839. Searle et al., 1980 Searle, J. R., Kiefer, F., Bierwisch, M., et al. (1980). Speech act theory and pragmatics, vol- ume 10. Springer. Shriberg et al., 2004 Shriberg, E., Dhillon, R., Bhagat, S., (2004). The icsi meeting Ang, J., and Carvey, H. recorder dialog act (mrda) corpus. In Proceedings of the 5th SIGdial Workshop on Discourse and Dialogue at HLT-NAACL 2004. Sileo et al., 2019 Sileo, D., Van de Cruys, T., Pradel, C., and Muller, P. (2019). Mining discourse markers for unsupervised sentence representation learning. In Pro- ceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguis- tics: Human Language Technologies, Volume 1 (Long Papers). Association for Computational Linguistics. Subramanian et al., 2018 Subramanian, S., Trischler, A., Bengio, Y., and Pal, C. J. (2018). Learning general pur- pose distributed sentence representations via large scale multi-task learning. International Conference on Learn- ing Representations. Wang et al., 2018 Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., and Bowman, S. (2018). GLUE: A multi-task benchmark and analysis platform for natu- ral language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Inter-
1801.06024
1
1801
2018-01-18T14:10:37
Natural Language Multitasking: Analyzing and Improving Syntactic Saliency of Hidden Representations
[ "cs.CL", "cs.AI", "cs.LG", "stat.ML" ]
We train multi-task autoencoders on linguistic tasks and analyze the learned hidden sentence representations. The representations change significantly when translation and part-of-speech decoders are added. The more decoders a model employs, the better it clusters sentences according to their syntactic similarity, as the representation space becomes less entangled. We explore the structure of the representation space by interpolating between sentences, which yields interesting pseudo-English sentences, many of which have recognizable syntactic structure. Lastly, we point out an interesting property of our models: The difference-vector between two sentences can be added to change a third sentence with similar features in a meaningful way.
cs.CL
cs
Natural Language Multitasking Analyzing and Improving Syntactic Saliency of Latent Representations Gino Brunner, Yuyi Wang, Roger Wattenhofer, Michael Weigelt∗ {brunnegi,yuwang,wattenhofer,weigeltm}@ethz.ch ETH Zurich, Switzerland 8 1 0 2 n a J 8 1 ] L C . s c [ 1 v 4 2 0 6 0 . 1 0 8 1 : v i X r a Abstract We train multi-task autoencoders on linguistic tasks and analyze the learned hidden sentence representations. The representations change significantly when translation and part-of-speech decoders are added. The more decoders a model employs, the better it clusters sentences according to their syntactic similarity, as the representa- tion space becomes less entangled. We explore the structure of the representation space by interpolating between sentences, which yields interesting pseudo-English sentences, many of which have recognizable syntactic structure. Lastly, we point out an interesting property of our models: The difference-vector between two sen- tences can be added to change a third sentence with similar features in a meaningful way. 1 Introduction Representation learning has opened the doors for many creative neural networks that learn to generate music or extract the artistic style of a painting and apply it to an arbitrary photograph (Gatys et al. [2016]). In computational linguistics, progress has been made in neural machine translation, speech- to-text and many other applications. However, creative algorithms that write poetry, mimic an author or even develop fictional languages are sparse or non-existent. Since good representations are crucial for such creative tasks, we examine ways to improve learned representations and develop ways to measure their linguistic quality. We analyze how improvements in the syntactic capabilities of a model relate to the learned hidden representations. A syntax clustering experiment shows that the representation space of multi-task models is more easily separable into disentangled regions than that of single-task models. As a result, some simple sentence features can be added and subtracted from each other in the representation space. Our work does not focus on optimizing one single task or error, but on forcing the representations to contain useful information in a structured, analyzable way. To this end we train several sequence to sequence models with an increasing number of decoders. Each decoder has a distinctive linguistic task. We compare the sentence representations our models have learned and explore how representations of different sentences relate to each other.2 2 Related work Sutskever et al. [2014] use Long Short-Term Memory (LSTM) networks to encode an arbitrary sequence into a vector and decode it back into a (possibly different) sequence. They achieve results in neural machine translation (NMT) that are competitive with statistical machine translation models (SMT). The NMT objective is one of several tasks we use in our models. Luong et al. [2015] extend Sutskever et al.'s model with three multi-task settings: One-to-many, many-to-one and many-to-many. ∗Authors are listed in alphabetical order. 2Our code is available at https://drive.google.com/open?id=0B7Mps2rt3vBoSHlWeElGT1JiS3c 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Their work shows that translation performance can benefit from parsing and image caption tasks. This kind of improvement from adding related tasks is also the subject of our work. Niehues and Cho [2017] note that many linguistic resources that enabled SMT are not commonly used in NMT models. They train translation models jointly with part-of-speech (POS) and named-entity recognition tasks and show that both translation and POS tagging benefit from the shared information. Our research is rooted in the same idea, but we focus on the learned representations rather than on training objectives. As an alternative to the bag-of-words feature many natural language processing (NLP) models use, Le and Mikolov [2014] propose the "paragraph vector" to represent sentences, paragraphs and whole documents. This feature outperforms bag-of-word models in text classification and sentiment analysis tasks. While it could be extended to deal with larger pieces of text, our work focuses on the sentence-level. Liu et al. [2015] developed a multi-task deep neural network for multi-domain classification and information retrieval, which learns general semantic representations useful for both tasks, demonstrating the advantage of multi-task learning. Artetxe et al. [2017] note that large parallel corpora for the training of NMT models are scarce. They introduce a novel system that solely relies on monolingual data while still learning to translate between languages. Vinyals et al. [2015] develop a generative model that connects image processing and natural language generation. Their model takes an image as input and generates an English sentence that describes the content of the image. Such a complex task relies on good, well-generalized representations, which we are exploring in this work as well. 3 Models The model architecture we use to learn representations is the autoencoder, which operates in two stages: An encoder transforms data into a "code" in a hidden layer, from which the decoder then tries to reconstruct the original input. The decoder can be modified to learn a task other than reconstruction, such as translating the input into a different language. Because text is of sequential nature we use Long Short Term Memory recurrent networks (LSTM) as encoders and decoders. 3.1 Multi-task autoencoder We extend the basic sequence to sequence autoencoder model by adding multiple decoders that perform separate linguistic tasks. First, an encoder LSTM consumes a sequence of characters one by one and updates its internal state. When the whole input sequence has been read, the encoder state contains information about the entire sequence. This state is fed into a dense layer which we call the "representation layer", the output of which is a real vector with a specified dimension. The analysis we perform in Section 4 refers to the output of this layer. Next, the representation vector is fed to each decoder LSTM, which then generate output sequences corresponding to their tasks. A single-task model will learn representations of its training data which are useful for the objective at hand. Since it supports multiple decoders, our model architecture forces the representations to contain useful information for each objective. Adding more linguistic tasks as decoders should make representations more salient from a linguistic perspective and change the properties of the whole representation space in a meaningful and analyzable way. 3.2 Decoders We use four different decoders. The replicating (REP) decoder's task is to reconstruct the input sequence. The German and French (DE/FR) decoders attempt to translate the input sentence to German and French respectively. The last decoder we use learns to tag words in the input sequence with part-of-speech tags (POS), such as verb, noun, adjective. Figure 1 shows the architecture of our multi-task autoencoder model. 3.3 Dataset To train our models on the three tasks replication, translation and part-of-speech-tagging, we require a multilingual corpus with sentences that correspond to each other. The transcripts of the European Parliament sessions ( Koehn [2005]) are a suitable corpus with aligned English, German and French sentences. The replication task uses the English sentences as both input and target. The training data for the POS decoders was created using the python nltk module ( Loper and Bird [2002]) and 2 Figure 1: Architecture of our multi-task autoencoder models. We use four different decoders: Replicating (REP), translation to German (DE), translation to French (FR) and a part-of-speech tagger (POS). The encoder and decoders are LSTMs. The fully connected (FC) layers transform the fixed-length representation vectors into variable length state vectors for each decoder. the English text from the European Parliament corpus. The subset of this dataset we use contains over 1.7 million sentences (for all decoders), 1.5 million of which were used as the training set. The remaining 0.2 million sentences form the test set. A training example is a tuple whose size depends on the model configuration. For example, the single-task REP model uses 2-tuples (input: English sentence, target: English sentence), whereas the multi-task REP-DE-POS-model uses 4-tuples (input: English sentence, REP-target: English sentence, DE-target: German sentence, POS-target: POS-tag sequence). While the number of available training examples is the same for each model, multi-task models are trained with larger tuples and therefore more training data. To account for this imbalance, we train reference models with fewer training examples and compare their performance to the main models which we train on the full dataset. 3.4 Model configurations We train models with different decoders and representation layer sizes. Table 1 shows the perplexities reached by each decoder for some of the trained models. Perplexity measures how close a generated sequence is to a target sequence and is defined as the exponential of the cross entropy between the two sequences. The model name simply lists its decoders and representation layer size. All encoder and decoder LSTMs have 512 neurons. We have experimented with different numbers of layers, neurons and representation layer sizes. Generally, our results were not sensitive to these choices, and we thus refrained from fine-tuning our models. The achieved perplexities are not competitive with state-of-the-art models. However, our work focuses on learned representations, not on decoder losses. The perplexities reached by the reference models mentioned in 3.3 are indistinguishable from the main models, and are thus not listed separately. Table 1: Model Configurations. For each model, the used decoderse and the size of the representation vector is indicated. Model name REP-1024 REP-DE-1024 REP-DE-FR-1024 REP-DE-256 REP-DE-POS-256 REP DE 1.05 1.04 1.04 1.07 1.14 - 2.02 2.02 2.02 2.05 FR - - 1.86 - - POS - - - - 1.10 3 EncoderStateDE/FR-DecoderStatePOS-DecoderStateREP-DecoderRepresentation VectorFCFCEnglish SentenceEnglish SentenceGerman/French SentencePOS-TagsFCState 4 Results 4.1 Syntax clustering How can the quality of learned representations be measured? The goal we pursue with our models is not the highest possible decoder accuracy. Instead, we are interested in representations that capture some linguistic aspect of the input language. In order to compare the learned representations of different models, we examine how well they cluster syntactically similar sentences. We use 14 sentence prototypes with different syntactic structures, for example "The +N is +A", where +N, +V, +A and +D are placeholders for nouns, verbs, adjectives and adverbs. Following is a list of all 13 sentence prototypes we used (the 14th category are empty sentences): 1: The +N is +A. 2: The +N +Vs. 3: The +N has a +N. 4: The +N +Vs a +N. 5: The +N +Vs +D. 6: No +N ever +Vs. 7: Are +Ns +A? 8: The +Ns of +N +D +V the +A +N, but some +Ns still +V their +N. 9: In the +N of a +A +N, the +N will +V the +N of +Ving the +N. 10: +Ns +V the +A +N of +Ns +Ving on the +N. 11: In the +N of +N, +Ns would rather +V without +N than +V any +A +Ns. 12: +N +Vs in order to +V on a +N. 13: +A +Ns often +V like +Ns. 14: whitespace Each sentence prototype is randomly populated by common English words 100 times. The syntax of each sentence in such a category is very similar or identical to all others in the same category, but different from sentences in other categories. These sentences are then fed into our models. We record every resulting representation and pair it with its input sentence. Using K-means clustering with K = 14 we cluster the representation-sentence pairs in the representation space. For each resulting cluster, we count how many sentences of each prototype it contains. This yields a list such as this: [30, 3, 1, 7, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0], which shows the content of one of 14 clusters: 30 sentences of type one, 3 of type two and so on. Since most sentences in this cluster are of type five, this cluster is assigned to be the cluster of sentence category five. However, 41 sentences of type other than five were "falsely" assigned to this cluster. Therefore, the error of this cluster is 41. The sum of errors of all 14 clusters is the clustering error, which is our quality measure for this experiment. Since K-means clustering is nondeterministic, we run the algorithm 100 times. Table 2 shows the best-of-100 clustering errors. Table 2: Clustering errors by model Model REP REP-FR REP-FR-DE REP-DE REP-POS REP-DE-POS Error 51 26 0 24 22 8 Starting from the left, the single-task REP model has the highest clustering error. As we add German and French translation decoders, the syntax clustering error decreases. Adding part-of-speech tagging reduces the clustering error even more. Finally, combining translation and part-of-speech tagging reduces the clustering error to zero. This means that the 14 syntactically different sentence prototypes are perfectly separated in the representation space. It is not surprising that this model performs better than the others: At least for humans and most classical algorithms, correct POS tagging is a requirement or preparative step to syntax analysis. The distinctive advantage this model has over the others indicates that neural language models benefit from related linguistic tasks. Having clear, separable clusters of sentences suggests that some aspects of syntax are disentangled in the multi-task representation space. Figure 2 shows the syntax clusters for the worst and best performing models, visualized using t-SNE. Clearly, using syntactically relevant tasks helps the model to learn more clearly separated representations of syntax. 4 (a) Model with only a replicating (REP) decoder. The sentence prototype representation clusters 1-5 as well as 8 and 12 are very close together or overlapping. (b) Model with replicating (REP), German transla- tion (DE) and part-of-speech tagging decoders. No sentence representation clusters are overlapping, and only type 3 and 4 are close together. Figure 2: Syntax clusters visualized with t-SNE. We trained several reference models on fewer training examples to account for the different numbers of decoders, and thus different amount of effective training data (as described in Section 3.3). Although the clustering errors differ, there is no clear trend, as some models cluster worse and others better with fewer examples (see Table 3). Note that the perplexities these models achieved are all comparable to their reference models (trained with the full training set), and none of the models overfit the training data. Table 3: Best-of-100 clustering errors with fewer training examples Model R-D-1024 R-D-256 R-D-F-1024 R-D-P-256 Full training set 1/2 training set 1/3 training set 22 37 - 3 - 1 29 33 - 24 - 19 4.2 Interpolation 2 The sentence representations our models generate lie in a high-dimensional space. Clustering experiments show that the data points from sentences in the training set are not spaced evenly in this vector space, rather they form clusters or manifolds. Seeing how clearly some models cluster sentences according to their syntax, the question arises: What lies between two sentences? More precisely: If two sentences s1 and s2 have representations r1 and r2, what sentence corresponds to ? What about other points along a straight line between r1 and r2? Table 4 shows two example r1+r2 outputs each of the REP decoder of the REP-DE-POS-256 and REP-DE-1024 models. As shown in Section 4.1, the REP-DE-POS-256 has a significantly lower clustering error, and it can be seen that it also produces more plausible sentences with fewer non-words when doing interpolation in the representation space. Unsurprisingly, not every point in the representation space corresponds to a correct English sentence. If we overlook the non-words in some of the interpolated sentences, the change in syntax can be understood to a degree. However, linear interpolation does not seem to be enough to explore the shape of this representation space. More work investigating these manifolds could yield useful results for generative, creative algorithms. For example, what properties would a representation space have 5 Table 4: Sentence interpolation between two endpoints for two different models. REP-DE-POS-256: Is this what we want? Is this meat which we need? Is that is very with true? Whe nomists ha told day of items. The course all hotels to drug itselve. The consumer may took speed in follows Mr... The consumer must therefore be informed of GMOs. We will not tolerate a policy of religious repression. We will not threaten by insist regarding our representation. We will not dossil at Ecoprat south direct-resprest and. We must the knowled alro in economic objarimar represent. We sant techni oy asplig poor correads in report'sed. The interest has lip porals often Mrs Martensrespre. Whe is still want recoursion in viruccuroning responsibly. The insade to sarame places outso in requirponts resel. The issue where any returning ideology rrrengeing reply. There is a strongly matic poorer 'fragen presumers' thre. There is a systemic policy of religious reprovement. There is a systematic policy of religious repression. There is a systematic policy of religious repression. REP-DE-1024: Is this what we want? Is this what nath we affend? Whin to shakin the weaknes fan? Why cust hesitage we chear thembox. The consumer is of encautant where quote. The consumer is botted there binds for EU. The consumer must therefore be informed of GMOs We will not tolerate a policy of religious repression. if it were trained to understand two languages? How would representations of sentences and words from different languages relate to each other? 4.3 Representation "arithmetic" Some word embedding spaces have a special property, where differences between embedded words can correspond to a direction on an axis that has a semantic or grammatical interpretation. For example, the difference vector of queen and king might roughly equal that of woman and man (Mikolov et al. [2013]). This raises the question whether sentence representations can have similar properties. A simple assumption would be that the difference-vector of Cats are good pets. and Dogs are good pets. should have canceled out the part about good pets and roughly point from Dogs to Cats. Adding this difference-vector to any sentence that contains Dogs should then result in a sentence where Dogs is replaced with Cats. The REP-DE-1024 model fails at this task, as shown in Table 5. However, the arithmetic works better for the model that performed best in the syntax clustering (REP-DE-POS-256) experiment, as is shown in Table 6. The arithmetic worked for first three sentences, and failed for the last two. While these results are not representative and require more rigorous investigation, we did not cherry pick the examples. The fact that the representation "arithmetic" works for a number of small examples shows that the learned representations are much more complex than mere symbol probabilities. Since this experiment only considers word occurrence and order, it remains open whether there is any semantic component to this phenomenon. Adding specialized semantic tasks to our models could improve the results. Table 5: Representation "arithmetic" for the REP-DE-1024 model. s1 1: I am one. 2: This example works. 3: A word in a phrase. 4: The end is easier. 5: A large number of people want to work. s2 I am two. - - This example fails. - A tree in a phrase. - The start is easier. - A small number of people want to work. s3 + You are two. + Another attempt fails. + A tree is green. + A start is next! + A small sentence is enough. s1 - s2 + s3 = You ready no. = Another attempt world. = A word is purevy? = A rew lieh in new! = A large senselfeir in or evacce. Table 6: Representation "arithmetic" for the REP-DE-POS-256 model. s1 1: I am one. 2: This example works. 3: A word in a phrase. 4: The end is easier. 5: A large number of people want to work. s2 I am two. - - This example fails. - A tree in a phrase. - The start is easier. - A small number of people want to work. s3 + You are two. + Another attempt fails. + A tree is green. + A start is next! + A small sentence is enough. 6 s1 - s2 + s3 = You are one. = Another attempts work. = A word is green. = A need aid not! = A large sector for challenge. 5 Conclusion and Future Work We trained several multi-task autoencoders on linguistic tasks and analyzed the learned sentence representations. The representations change significantly when translation and part-of-speech tagging decoders are added. The more decoders a model uses, the better it can cluster sentence representations according to their syntactic similarity. This indicates that the space (at least the part of it that is associated with syntactic information) becomes more separable or disentangled as more tasks are added. We explored the structure of the representation space by interpolating between sentences, which yields interesting pseudo-English sentences, many of which have recognizable syntactic structure. Finally, we point out an interesting property of our models' representations: The difference-vector between two sentence representations can be added to change a third sentence with similar features in a meaningful way. We call this process "representation arithmetic", since it allows adding and subtracting sentence features to and from other sentences. In the future, we want to get a better understanding of the shape of the representation space. In- terpolating inside the manifold the data populates could enable creative algorithms which produce grammatical sentences by sampling from the inside of the manifold. Perhaps the "representation arithmetic" property can be made more robust by adding semantic tasks as decoders. If this behavior could be made more predictable, the representation space would have useful properties for generative models, as semantic features could be transferred between sentences. So far we have not constrained our latent space, since our focus did not lie on language generation. Nevertheless, we plan on experimenting with Variational Autoencoders due to their inherent capability to disentangle the latent space, which might enable better disentanglement of semantics and syntax. References Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, pages 2414–2423, 2016. Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, NIPS 2014, pages 3104–3112, 2014. Minh-Thang Luong, Quoc V. Le, Ilya Sutskever, Oriol Vinyals, and Lukasz Kaiser. Multi-task sequence to sequence learning. CoRR, abs/1511.06114, 2015. Jan Niehues and Eunah Cho. Exploiting linguistic resources for neural machine translation using multi-task learning. In Proceedings of the Second Conference on Machine Translation, WMT 2017, pages 80–89, 2017. Quoc V. Le and Tomas Mikolov. Distributed representations of sentences and documents. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, pages 1188–1196, 2014. Xiaodong Liu, Jianfeng Gao, Xiaodong He, Li Deng, Kevin Duh, and Ye-Yi Wang. Representation learning using multi-task deep neural networks for semantic classification and information retrieval. In NAACL HLT 2015, The 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 912–921, 2015. Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. Unsupervised neural machine translation. CoRR, abs/1710.11041, 2017. Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pages 3156–3164, 2015. Philipp Koehn. Europarl: A Parallel Corpus for Statistical Machine Translation. 2005. Edward Loper and Steven Bird. Nltk: The natural language toolkit. In Proceedings of the ACL-02 Workshop on Effective Tools and Methodologies for Teaching Natural Language Processing and Computational Linguistics - Volume 1, ETMTNLP '02, pages 63–70. Association for Computational Linguistics, 2002. Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Annual Conference on Neural Information Processing Systems, NIPS 2013, pages 3111–3119, 2013. 7
1909.02307
1
1909
2019-09-05T10:34:07
Fusing Vector Space Models for Domain-Specific Applications
[ "cs.CL", "cs.LG", "stat.ML" ]
We address the problem of tuning word embeddings for specific use cases and domains. We propose a new method that automatically combines multiple domain-specific embeddings, selected from a wide range of pre-trained domain-specific embeddings, to improve their combined expressive power. Our approach relies on two key components: 1) a ranking function, based on a new embedding similarity measure, that selects the most relevant embeddings to use given a domain and 2) a dimensionality reduction method that combines the selected embeddings to produce a more compact and efficient encoding that preserves the expressiveness. We empirically show that our method produces effective domain-specific embeddings that consistently improve the performance of state-of-the-art machine learning algorithms on multiple tasks, compared to generic embeddings trained on large text corpora.
cs.CL
cs
Fusing Vector Space Models for Domain-Specific Applications Laura Rettig eXascale Infolab University of Fribourg Fribourg, Switzerland [email protected] Julien Audiffren CMLA, CNRS, ENS Paris-Saclay Paris-Saclay University Cachan, France Philippe Cudr´e-Mauroux eXascale Infolab University of Fribourg Fribourg, Switzerland [email protected] [email protected] 9 1 0 2 p e S 5 ] L C . s c [ 1 v 7 0 3 2 0 . 9 0 9 1 : v i X r a Abstract -- We address the problem of tuning word embeddings for specific use cases and domains. We propose a new method that automatically combines multiple domain-specific embeddings, selected from a wide range of pre-trained domain-specific embed- dings, to improve their combined expressive power. Our approach relies on two key components: 1) a ranking function, based on a new embedding similarity measure, that selects the most relevant embeddings to use given a domain and 2) a dimensionality reduction method that combines the selected embeddings to produce a more compact and efficient encoding that preserves the expressiveness. We empirically show that our method produces effective domain-specific embeddings that consistently improve the performance of state-of-the-art machine learning algorithms on multiple tasks, compared to generic embeddings trained on large text corpora. Index Terms -- Word Embeddings, Dimensionality Reduction, Similarity Measure I. INTRODUCTION Word embedding techniques such as word2vec [1] have become a key building block of many NLP applications. These techniques capture the semantic similarities between linguistic terms based on their distributional properties from large textual contents and allow to easily represent words or phrases in a low-dimensional vector space that can be leveraged by down- stream applications (e.g., language translation or sentiment analysis). As training word embedding models is computationally intensive and requires large text corpora, pre-trained models such as those provided by Facebook Research1 or Google2 are widely used today. These models are trained on very large unlabeled text corpora of billions of words and provide high- quality embeddings for a variety of languages. Despite the convenience they bring, using such readily- available, pre-trained models is often suboptimal in vertical applications [2], [3]; as these models are pre-trained on large, non-specific sources (e.g., Wikipedia and the Common Crawl for FastText, news articles for Google's word2vec models), they often cannot capture important semantic information from specific sub-domains or applications. Indeed, many words 1fastText pre-trained word vectors: https://fasttext.cc/docs/en/crawl-vectors. 2word2vec models from Google's Code Archive: https://code.google.com/ html archive/p/word2vec/ carry specific meaning depending on their context, which can be difficult to capture from generic or encyclopedic contents only. In addition, particular domains may use specific vocab- ulary terms that are not present in pre-trained embeddings. Retraining word embeddings for a specific context is pos- sible, though it is also extremely costly, both in terms of computational power and in the availability of large quantities of text that have to be fed into the model. Instead, we suggest in this paper a third solution combining the convenience of pre-trained embeddings with the effectiveness of dedicated models. The main intuition behind our method is to leverage a collection of domain-specific embeddings and to efficiently combine them in order to capture the peculiarities of a given application domain as closely as possible. While sensible, this approach also raises two new challenges that have to be tackled: i) How to automatically select the most adequate embeddings from a library of pre-trained embeddings for a specific task and ii) how to efficiently and effectively combine different embeddings in order to obtain high-quality embeddings suitable for the task at hand. We take on these challenges through a new method intro- duced in this paper that we call Embedding Fusion: We solve the first challenge by introducing a ranking technique based on a comparative analysis of the language used in the task and in the embeddings text corpora. We tackle the second problem by using dimensionality reduction methods that combine the selected embeddings to produce a more compact and efficient -- yet similarly expressive -- encoding. Our main contributions are hence as follows: 1) To the best of our knowledge, we are the first to propose the idea of dynamically selecting and combining several word embeddings to better capture a particular application domain; 2) We introduce a new technique to rank word embeddings, based on their relevance to a particular domain; 3) We describe several techniques to combine a set of domain-specific embeddings into a new encoding better suited for the task at hand; 4) Finally, we demonstrate through a comprehensive empir- ical evaluation on multiple test corpora that the use of our approach -- i.e., the combination of automatically se- lected and relevant domain-specific embeddings -- leads to consistently improved results compared to the use of generic embeddings. II. METHOD As discussed above, the key idea of Embedding Fusion is to replace a general-purpose embedding by a carefully constructed combination of domain-specific embeddings. Our method relies on two main ingredients, namely i) a prin- cipled algorithm to automatically select the most relevant embedding(s), depending on the task at hand, and ii) an efficient dimensionality reduction algorithm that combines the previously selected embeddings into a single embedding of fixed dimension d. These two contributions are presented in Sections II-A and II-B, respectively. A. Ranking Embeddings In the following, we use the terms embedding or encoding interchangeably to refer to word embeddings. Encodings are characterized by their two core features: the learning algorithm used for training (see e.g. [4], [5]), and the text corpus used as training set (such as Wikipedia). While the choice of the learning algorithm has a significant impact on the resulting embedding, in this work we are more interested in the influence of the associated text corpus and more precisely the characteristics of the corpus (topic, type of language, etc.). Therefore, throughout this paper, we use the exact same algorithm for learning all text encodings, namely word2vec [4] with the CBOW model and a window size of 5, outputting embeddings of dimension d = 300, which is a common choice in state-of-the-art word embeddings. The text corpora are then the only difference between the embeddings and we use them to define the notions of similarity and ranking of pairs of encodings. a) Domain-Specific Embeddings: We say that an encod- ing is domain-specific if its associated text corpus is almost exclusively constituted of documents pertaining to a specific topic. Examples of domain-specific embeddings that we use in our subsequent evaluations include drugs, an embedding constructed on Wikipedia articles relating to pharmaceuticals, or twitter, an embedding constructed from a series of tweets. In theory, the use of domain-specific embeddings suited to the task at hand entails significant advantages: the presence of specialized words in the vocabulary such as colloquial expressions and a better encoding of homonyms, e.g., when given words may have a distinct meaning in a specific domain, such as calculus that refers to kidney stones in a medical context rather than to a branch of mathematics. However, one significant drawback of domain-specific em- beddings is that by definition, each encoding may only be suitable for a narrow range of tasks. To solve this issue we provide a generic solution that can automatically analyze multiple domain-specific contents and evaluate their relevance to a given task. More precisely, we propose a new approach that uses both i) a large library of pre-trained domain-specific embeddings and ii) a new similarity function to automatically score the relevance of each encoding of the library with respect (cid:1)N b) Notations: Let (cid:0)Ei to the corpus of the target task, resulting in a ranking of their usefulness. The similarity function is introduced below. i=1 denote a collection of N different domain-specific embeddings. For each encoding Ei, we denote as Ti its corresponding text corpus containing Ti words. For any word w ∈ Ti, let Ei(w) designate the embedding of w in Ei and #Ti(w) the number of occurences of w in Ti. In the following and without loss of generality, all the embeddings are assumed to have the same dimensionality d = 300. Finally, let T be the text corpus of the target task and E be a general-purpose embedding method. c) Text corpus as distribution: In order to define a similarity between text corpora, we proceed as follows. First, we associate with each word w in each corpus Ti a weight αi(w) that reflects its relative frequency: (cid:80)N #Ti(w) j=1 #Tj(w) (cid:80)N j=1 Tj Ti αi(w) = (1) (cid:80) αi(w) can be seen as the ratio between the frequency of the word w in Ti and its frequency among the collection of all text corpora. Therefore, αi(w) increases with how specific w is to Ti; a word w that is frequent in Ti but rare in the other text corpora will have a large weight αi(w). The idea is that such a word might be representative of the domain specific to Ti and therefore is associated with a higher weight. Then, each text corpus is seen as a distribution over the space of embeddings of words, where the probability p of each word w is directly proportional to its weight. Formally, given a generic encoding E (i.e., a general-purpose embedding used to represent all words w), Ti induces a discrete distribution Pi over Rd, such that ∀w ∈Ti, Pi(E(w)) = #αi(w) #αi(w(cid:48)) w(cid:48)∈Ti . (2) The reasoning behind this definition is twofold. First, words with large weights should give insight into the corpus topic (1), while words with small weights may be the result of errors (e.g., a document that is wrongly associated with the corpus). Therefore, we set this relative importance. Second, we use embeddings instead of raw words, as embeddings naturally include a notion of similarity between words [5]. The generic embedding is used here to provide a common encoding for all words of each text corpus, as opposed to embeddings that are specific to a topic. the probabilities to reflect d) Similarity between text corpora: We define the simi- larity between two text corpora as the similarity between their respective probability distributions over Rd, using the RBF kernel. In other words, . = s(Pi, Pj) s(Ti,Tj) (cid:88) w∈Ti = (cid:88) Pi(E(w))Pj(E(w(cid:48)))× w(cid:48)∈Tj exp(−(cid:107)E(w) − E(w(cid:48))(cid:107)2 ) 2 σ2 (3) where σ is the bandwidth of the RBF kernel (in this work we used σ = 0.01), and Pi(E(w)) is defined in (2). The exponential term represents the similarity between the words; words with closely related meanings will hence have a sim- ilarity close to one due to the combined use of a common embedding E with a smooth kernel. Remark. While in theory (3) includes all the words of both corpora, it is generally-speaking intractable in practice due to the size of the vocabulary of each corpus. Moreover, since rare words are likely to be unrelated to the text corpus topic and have little influence on the similarity metric (due to their negligible probability weights), we choose to use only the top 500 most frequent non-stop words of each corpus when computing similarities. In our experiments, this value achieved the best trade-off between reducing the computation time and capturing most of the corpus characteristics. e) Ranking Embeddings: Finally, the ranking of the embeddings is derived from the similarity metric defined in (3). For a task associated to a text corpus T , we define α by  #T (w) (cid:80)N j=1 #Tj(w) 0 (cid:80)N j=1 Tj T αi(w) = if ∃i ∈ [1, N ] s.t. w ∈ Ti otherwise. (4) Note that compared to (1), α(w) is the ratio between the frequency of the word w in T and its frequency among the concatenated text corpora of the embeddings, not including T . Consequently, a word that is present in T but not in any Ti is ignored, as its relative frequency cannot be computed. Then, P (E(w)) and s(Ti,T ) are defined using (4), (2) and (3). Finally, each encoding is ranked according to the similarity between its corpus and the task corpus: s(Ei,T ) = s(Ti,T ) . ∀1 ≤ i ≤ N, The performance of this ranking approach is evaluated in Section III. B. Fusing Word Embeddings While in some cases a domain-specific encoding is able to outperform the general-purpose embedding, our experiments show that we can further improve the performance by merging multiple domain-specific embeddings (see Section III). There- fore, the second step of our approach is to combine top-k embeddings from the previous ranking into a new encoding suited for the task at hand. We distinguish four different families of embedding combination algorithms: concatenation, averaging, PCA, and autoencoders, which are discussed in their respective subsections below. 1) Concatenation: The first approach Econcat simply uses the cartesian product of the different embeddings, i.e. Econcat(·) =(cid:0)E1(·), . . . ,Ek(·)(cid:1) ∈ Rkd. By definition, Econcat retains all semantic information carried by the word in the top-k embeddings. However, this is done at the cost of an increased dimensionality (in this case, kd). Since many of these dimensions may yield redundant -- or non- relevant -- semantic meaning, this increased dimensionality may reduce the efficiency of learning algorithms leveraging Econcat [6], [7]. Therefore, the three following algorithms preserve the original dimensionality d. 2) Averaging: Recent approaches have shown that Eavg constructed from the arithmetic mean between pairs of vectors drawn from distinct Ei performs comparably to more com- plex combination methods under the assumption that the two embeddings are approximately orthogonal [22]. This method preserves the original dimensionality d, however at the cost of a greater loss of information than the following two approaches, which use dimensionality reduction on Econcat to obtain a final embedding of dimension d. 3) PCA: The gold standard for linear methods of dimen- sionality reduction is the Principal Component Analysis (PCA) [8]. In our setting, we define Epca as the result of the PCA algorithm applied on the covariance matrix of the Econcat embedding of all words in the target corpus T . We set the target dimension of Epca to d = 300. 4) Autoencoders: The last family of embeddings is ob- tained by using unsupervised deep learning-based dimension- ality reduction algorithms, namely autoencoders [9], general- ized autoencoders [10] and variational autoencoders [11]. By applying these algorithms to the concatenated encoding of the target task Econcat we obtain Eauto, EG auto and EV auto, respectively. These non- linear methods have been shown to produce interesting results when applied to embedding-related problems (e.g. [12]). (cid:0)T(cid:1) with a target dimension of d = 300, III. EVALUATION In this section we study in detail the performance of Embedding Fusion and in particular the pros and cons of the dimensionality reduction methods discussed in Section II-B. To evaluate the embeddings produced by Embedding Fusion, we use the common task of sentiment analysis on user reviews [13], where the learning algorithm is tasked with finding whether the author of a review expresses a positive or negative sentiment towards the object of their review. a) Sentiment Analysis on Vector Space Models: As noted by Guggilla et al. [14], both recurrent neural networks (RNN) and convolutional neural networks (CNN) achieve comparable performance on sentiment analysis (see [15] for an in-depth review). In this work we selected a CNN architecture for our evaluation as an examplary task. The network takes as input the embeddings of the words of one review and outputs the probability of the review to express a positive sentiment. The architecture of the CNN used in the experiments is summarized in Fig. 1. For regularization, we used dropout [16] with p = 0.3 after both the maxpooling layer and the dense layer. The network was trained using Adagrad [17] with batches of 100 sentences over 100 epochs and a learning rate of 0.01. b) Annotated Review Datasets: To evaluate Embedding Fusion, we used annotated datasets where each review is either labeled as positive/negative or associated with a numeric rating which can be split into positive (upper half of the scale) or negative (lower half of the scale). We use the following openly Fig. 1. CNN Architecture used in the evaluation process. Each of the convolutional layers as well as the dense layer is followed by a RELU activation function. TABLE I COMPOSITION OF THE TEST DATASETS CONSISTING OF ANNOTATED REVIEWS FOR SENTIMENT ANALYSIS AND THE LIBRARY OF CORPORA T USED TO TRAIN THE EMBEDDINGS. Datasets Movies Airlines Full Yelp Yelp:Restaurants Yelp:PSG Embeddings Wikipedia Wiki:Actors Wiki:Drugs Wiki:Schools Wiki:Rail transport Wiki:Cuisine Enron Legal Twitter Subset of Yelp #unique tokens 300k 17k 1840k 1207k 75k 2546k 314k 246k 348k 291k 256k 389k 83k 1920k 38k available annotated datasets from different domains: movie re- views [18], annotated tweets about US airlines3, Yelp reviews4 including two sets of reviews sampled by selecting reviews within specific categories from the full corpus (Restaurants and Public Services & Government (PSG)). Table I gives an overview of these datasets and their cardinality in terms of unique tokens. c) Domain-Specific Text Corpora: Table I also lists the text corpora T which we used to train the domain-specific word2vec embeddings E. Wikipedia refers to the corpus of all Wikipedia articles. Corpora labeled Wiki: have been obtained by sampling the complete collection of Wikipedia articles, taking into account articles belonging to the given category or its sub-categories only by parsing the Wikipedia category tree. While covering distinct domains, the nature of Wikipedia articles is however such that their language is rather uniform, in order to be understood by a large audience. The Enron dataset [19] contains e-mails between employees of the Enron corporation. Given the nature of corporate e-mails, these emails contain mainly colloquial business-related as well as 3https://www.kaggle.com/crowdflower/twitter-airline-sentiment 4https://www.yelp.com/dataset TOP-3 WORDS FOR EACH ENCODING Ti, RANKED IN DECREASING ORDER TABLE II WITH RESPECT TO αi. Text Corpus Actors Drugs Schools Rail Cuisine Enron Legal Twitter Syelp Top-3 words protofeminist, swordfights, storywriter polydrug, angiography, cyclos auditoria, schoolmaster, Rabelaisian southeasternmost, podcar, transponder folktale, ripeness, anisette Pinales, rebuttable, customers hamermill, indictable, mitigator queening, punches, theworst ambience, chipotle, houseware formal communications. The corpus of legal texts contains court cases from the Federal Court of Australia [20] which are written in very specific legal language and terminology. We also created an embedding based on a small subset -- 2.5% of the data -- of the full Yelp reviews corpus (abbreviated as syelp). In terms of language and terminology, we are expecting this corpus to be similar to other review datasets. The twitter dataset was gathered from the Twitter API by sampling from the open stream over a period of 3 months in early 2016. The number of unique tokens for these corpora reflects the size of the embeddings' vocabularies, i.e., it only includes words that occurred at least 5 times. It should be pointed out that the evaluation of Embedding Fusion is nontrivial, as it requires a large and diverse set of test corpora as well as domain-specific corpora that have to be trained individually and then evaluated against the test corpora. A. Ranking Embeddings First, we evaluate the relevance of the similarity function s (3) and its induced ranking function introduced in Sec- tion II-A. Table II shows the top-3 words according to the α weights (4) for each embedding. This highlights that our weight model α is successful in identifying uncommon words that may encode part of the corpus characteristics. However, it also shows that a large number of words may be required to fully capture the aforementioned characteristics. Table III lists for each dataset the top-2 ranked embeddings, as well as their respective similarity values (3) computed with the top 500 words and σ = 0.01. We compare our approach to the widely used tf-idf weighted cosine similarity method, TABLE III TOP-2 EMBEDDINGS AUTOMATICALLY SELECTED BY THE RANKING ALGORITHM AND BY TF-IDF FOR EACH TEST SET, WITH THEIR SIMILARITY VALUES, AS WELL AS THE TOP-2 EXPERT-PICKED EMBEDDINGS FOR THIS TASK. Test set Movies Airlines Yelp Restaurants PSG Automatic selection actors syelp twitter rail syelp cuisine syelp cuisine syelp rail Similarity s Manual selection 1.4 × 10−4 actors 7.5 × 10−5 syelp 5.1 × 10−6 twitter 1.7 × 10−6 1.1 × 10−3 1.7 × 10−5 1.0 × 10−3 2.3 × 10−4 4.7 × 10−4 2.3 × 10−5 rail syelp cuisine syelp cuisine syelp legal tf-idf-cos selection syelp twitter syelp twitter syelp cuisine cuisine twitter syelp cuisine INDIVIDUAL DOMAIN-SPECIFIC AND GENERAL-PURPOSE EMBEDDINGS' PERFORMANCE FOR EACH TEST DATASET. TABLE IV Embedding Movies Actors 0.79 Drugs 0.77 Schools 0.81 Rail 0.78 Cuisine 0.76 Enron 0.80 Legal 0.79 Twitter 0.82 Syelp 0.84 Wikipedia 0.85 Airlines 0.86 0.85 0.87 0.88 0.85 0.88 0.86 0.91 0.90 0.90 Yelp 0.84 0.79 0.82 0.81 0.80 0.82 0.80 0.85 0.86 0.84 Restaurants 0.83 0.79 0.82 0.81 0.82 0.84 0.79 0.85 0.86 0.84 PSG 0.77 0.75 0.78 0.77 0.77 0.80 0.77 0.79 0.81 0.81 tf-idf-cos for short (see for example [21]) and against the top-2 embeddings selected manually by an expert, i.e., those that a human expert would expect to be relevant to the domain of the task. All the selected embeddings match what would be expected from the text corpus domains, except for the PSG dataset, for which the rail embedding was chosen instead of an intuitively more relevant legal-oriented embedding. It should be noted that syelp is selected in almost every case, which is coherent with the fact that the datasets contain reviews and opinions -- the main subject of the syelp corpus. the choice of the twitter embedding for the airline Also, dataset is coherent with the fact that the airline corpus is constituted of tweets. While the similarity scores in Table III may appear low, they are larger than similarities between unrelated text corpora by several orders of magnitude: For instance, the similarity between airline and actors is 4.0 × 10−51, which highlights the fact that our similarity metric is successful in identifying tf-idf-cos always related text corpora. On the other hand, selects a relevant embedding as the first choice, but makes two mistakes for the second choices, potentially related to the highly specialized nature of our text corpus. B. Domain-Specific Embeddings Here we evaluate the individual performance of the topic- specific embeddings. We also compare them to general- Fig. 2. Accuracy and standard deviation of all individual domain-specific embeddings compared to the general-purpose Wikipedia embedding for two test datasets, movies and PSG. purpose word2vec encodings trained on the full corpus of English Wikipedia articles. For each of these embeddings, we evaluate the previously defined CNN network and average the results over five runs (the dataset was randomly split into train and test sets (70%-30%) for each run). The results are presented in Table IV. As expected, the general Wikipedia embedding is always best or a close second on every task (see also in the plot for the PSG dataset in Fig. 2). On the other hand, the domain-specific embeddings are worse for most of the tasks in prediction accuracy. At the same time, we can observe that the syelp embedding performs well on all three Yelp-derived test sets, which is not unexpected given that the embedding was trained on a corpus partially overlapping the test set and is particularly relevant to all opinion-related tasks. These results highlight the need of both the ranking function, to select relevant domain specific embeddings, as well as the combination of these embeddings. C. Embedding Fusion We now evaluate the performance of the different dimen- sionality reduction methods described in Section II-B for the different datasets, using the two top-ranked domain-specific embeddings (cf. Table III) in all cases. For each of the aforementioned embeddings, we perform five runs of the CNN network (with a random split (70%-30%) for train and test actorsdrugsschoolsrailcuisineenronlegaltwittersyelpwikipediadataset0.7500.7750.8000.8250.8500.875accuracyMoviesactorsdrugsschoolsrailcuisineenronlegaltwittersyelpwikipediadataset0.760.780.800.82accuracyPublic Services & Government COMPARISON OF DIMENSIONALITY REDUCTION METHODS FOR THE TOP-2 AUTOMATICALLY SELECTED TEXT CORPORA FOR ALL GIVEN TASKS. THE TABLE V Test set Movies Airlines Corpora actors, syelp FIRST ROW REPORTS AVERAGE ACCURACY, THE SECOND ROW THE STANDARD DEVIATION OVER 5 RUNS. Eavg 0.84 0.011 0.90 0.020 0.86 EV auto Wikipedia 0.83 0.014 0.90 0.012 0.86 EG auto 0.82 0.015 0.86 0.016 0.86 Econcat 0.84 0.013 0.91 0.013 0.86 EP CA 0.87 0.0052 0.91 0.0071 0.86 Eauto 0.86 0.017 0.90 0.85 0.013 0.90 0.0081 twitter, rail Yelp syelp, cuisine Restaurants syelp, cuisine PSG syelp, rail 0.0037 0.85 0.012 0.81 0.012 0.0012 0.86 0.0014 0.83 0.0098 0.0074 0.87 0.0023 0.86 0.0026 0.82 0.0079 0.0044 0.85 0.0025 0.80 0.0082 0.0021 0.85 0.0046 0.81 0.0058 0.84 0.013 0.84 0.0096 0.81 0.010 0.0040 0.86 0.0028 0.82 0.0033 embeddings by a significant margin in two cases (Movies and PSG). IV. DISCUSSION a) Domain-Specific Embeddings: As can be seen from Section III-B, domain-specific encodings tend to be less effec- tive than general-purpose embeddings when used individually. This is in line with the fact that encodings based on algorithms such as word2vec are typically trained using very large text corpora and therefore contain extensive vocabulary as well as information-rich encodings for many words due to their re- peated occurrence in text. As can be seen in both Table IV and Fig. 2, the individual embedding built from the subsampled set of Yelp reviews performs better than the general-purpose Wikipedia embedding for the three Yelp-derived test sets. This is easy to explain by the fact that there is a very high similarity, potentially even an overlap, between training and test data. We nevertheless chose to include the syelp embedding in the tests as it performed well also on the non-Yelp test sets (cf. Table IV). While we consistently used the well-established word2vec algorithm to train our set of domain-specific embed- dings, we believe our method translates equally to embeddings obtained through more recently proposed methods [5], [23]. b) Combining Domain-Specific Embeddings: The com- bination of relevant domain-specific embeddings was shown to consistently outperform the general-purpose embedding (see Section III-C) -- despite using significantly smaller text corpora. This might be explained by the fact that a very large text corpus may induce a loss of information for some words that have different meanings in specific contexts, a loss that is also present with Eavg. Indeed, embeddings might "average" those meanings during their training -- a problem that is not encountered by domain-specific encodings due to their narrower usage of specific terms. These semantics are preserved in an embedding that is combined at a later stage as opposed to trained on a concatenation of the original corpora, where this averaging of meanings still occurs. c) Ranking Embeddings: Table III shows that our rank- ing function selects the same embeddings as in the manual selection by human experts in all cases except one (PSG). It is interesting to note that the selected encodings include actors and cuisine -- corpora related to the topic of the task -- but also Fig. 3. Comparison of the accuracy and standard deviation of individual embeddings and fused embeddings obtained by the different dimensionality reduction methods on the movie review and restaurant review datasets. sets). The results are reported in Table V and compared against Eavg [22] as well as the general-purpose Wikipedia word2vec model used individually. The results show that among the different embedding reduction methods, EP CA outperforms the other methods -- although Eauto is a close second, slightly outperforming EP CA on the Yelp review test set. EP CA also performs slightly better than Wikipedia, even though EP CA was trained on text corpora that are smaller by several orders of magnitude. Overall, EP CA never deteriorates the performance of the individual embeddings and outperforms both individual PCAautoG autoV autoconcatavgWikipediaactorssyelpmethod0.780.800.820.840.86accuracyMoviesPCAautoG autoV autoconcatavgWikipediasyelpcuisinemethod0.820.830.840.850.86accuracyRestaurants twitter -- a general corpus related to the medium and language of the task -- and syelp -- a corpus related to the content of the task, i.e., opinions. This highlights the generality and the multi-purpose usefulness of our similarity score and offers a promising first step in devising a more refined algorithm that combines representative encodings derived from three separate libraries of embeddings: topic, medium, and content. d) Dimension Reduction: According to Table V and Fig. 3, linear dimensionality reduction methods (i.e., PCA- based approaches) perform better than nonlinear methods (in this case, autoencoders and in particular their extensions) reliably, i.e., with a comparably low standard deviation. This result might be explained by the fact that Principal Component Analysis extracts the directions that account for the largest amount of variation. Since differences between words (i.e., variations) have been shown to be linked to relations [24], PCA may extract directions that are linked to important relations for this particular topic -- since the different corpora have been created to be domain-specific. V. RELATED WORK a) Multi-Corpus Word Embeddings: One common NLP task using two or more embeddings is machine translation, where there is one embedding per language. Methods are often put in place to align the vector spaces in order to find matching words without knowing the full ground-truth [25], [26]. When not performing alignment, machine translation requires parallel or aligned text corpora [27], [28]. Unlike these methods, our approach does not require the vector spaces to be aligned; however, since we are dealing with monolingual cases, our corpora are implicitly parallel. Another case for joining embeddings is when dealing with joint embeddings of different types of data, such as knowledge graphs with text [29], or images with text [30]. While this is in essence an alignment between different structures, our method operates solely on textual contents and requires corpora with a textual overlap. State-of-the-art approaches to multi-domain embed- dings [31] require a joint training of the embeddings into a common space. Our method does not require retraining when choosing to combine embeddings of certain domains. b) Combining Word Embeddings: Previous works have proposed different approaches to combine word embeddings, the most fundamental being the concatenation of embeddings trained with different algorithms [32]. However, this work does not consider domain-specific embeddings. Similarly, the method of averaging embeddings [22] creates a "meta- embedding" from the arithmetic mean of the vectors that is comparable in accuracy to concatenation of vectors while of- fering the performance benefits of lower-dimensional embed- dings. We have shown to outperform this method in Table V. Yin and Schutze [33] use a multi-channel approach to word embedding, borrowing from image processing techniques and using a different encoding for each channel, while Zhang et al. [34] compute the first layers of the CNN with different word embeddings in parallel and concatenate them at the very last layer. However, and to the best of our knowledge, we are the first to propose the idea of dynamically selecting and combining several domain-specific word embeddings. c) Sentiment Analysis: Sentiment analysis, and in par- ticular predicting whether a given text conveys a positive or negative message, has been the subject of many publications in the recent past [13]. Deep learning networks have been a tool of choice for this task, particularly when combined with word embeddings [35]. While both recurrent neural networks and convolutional neural networks have been successfully used for this task, both families have been shown to achieve similar performance [15], [36]. Tang et al. [37] introduced the use of specific sentiment embeddings, i.e. embeddings of words with their sentiment, for the specific task of sentiment analysis. This is not suitable for our approach, as we intend to generalize to various AI tasks. d) Dimensionality Reduction: Dimensionality reduc- tion is a key component of many statistical learning ap- proaches [38]. The combination of concatenation followed by dimensionality reduction is not new, as it is at the heart of many tensor-based learning methods [39]. In these cases, the dimension reduction is achieved through the choice of an appropriate regularization, such as constraints on the CP rank of the tensor [40] -- an approach that can be related to the construction of the PCA embedding in our case. Similarly, the use of autoencoders as the first layers of deep neural networks is a common approach when the data are too complex (such as living in a very high-dimensional space) [9]. To the authors' knowledge, none of the methods proposed in this paper have been previously used to combine embeddings. VI. CONCLUSIONS In this paper, we introduced the idea of combining in- dividual embeddings to capture domain-specific semantics. In that sense, we presented Embedding Fusion, a two-step process consisting in ranking and then combining domain- specific embeddings. Our ranking method captures the simi- larity between the corpus used by the downstream application and the various domain-specific embeddings that are available. Embedding Fusion was shown to select embeddings that are highly relevant and of which the combined performance is higher than a general-purpose embedding. We showed that the best performing combination method was a PCA ap- proach, EP CA, that fuses different embeddings into a single efficient and effective embedding, which outperforms each of the embeddings taken individually as well as its nonlinear counterparts. Compared to the general-purpose Wikipedia em- bedding, EP CA yields a consistent and significant performance improvement (2% improvement on average on already highly- accurate scores) despite being trained on data that is several orders of magnitude smaller. In future work, we plan to improve our ranking method by incorporating additional information, e.g., by linking both the application and embedding corpora to a knowledge graph in order to capture their semantic overlap more precisely, and to develop a new approach to effectively combine three or more embeddings by using their characteristics. For this, we intend to investigate the possibility of combining embeddings that reflect specific properties of a target corpus, nameley, topic, medium, and content from different libraries of embeddings. ACKNOWLEDGMENT This work was funded by the Hasler Foundation in the context of the City-Stories project. REFERENCES [1] T. Mikolov, I. Sutskever, K. Chen, G. Corrado, and J. Dean, "Distributed representations of words and phrases and their compositionality," in Proceedings of the 26th International Conference on Neural Information Processing Systems, 2013, pp. 3111 -- 3119. [2] W. L. Hamilton, K. Clark, J. Leskovec, and D. Jurafsky, "Inducing domain-specific sentiment lexicons from unlabeled corpora," in Pro- ceedings of the Conference on Empirical Methods in Natural Language Processing, 2016, p. 595. [3] H. Xu, B. Liu, L. Shu, and P. Yu, "Lifelong domain word embedding via meta-learning," in International Joint Conference on Artificial Intel- ligence, 2018. [4] T. Mikolov, K. Chen, G. S. Corrado, and J. Dean, "Efficient estimation of word representations in vector space," CoRR, vol. abs/1301.3781, 2013. [5] P. Bojanowski, E. Grave, A. Joulin, and T. Mikolov, "Enriching word vectors with subword information," Transactions of the Association for Computational Linguistics, vol. 5, pp. 135 -- 146, 2017. [6] O. Bousquet and A. Elisseeff, "Stability and generalization," Journal of machine learning research, vol. 2, pp. 499 -- 526, 2002. [7] V. N. Vapnik, "An overview of statistical learning theory," IEEE trans- actions on neural networks, vol. 10, no. 5, pp. 988 -- 999, 1999. [8] I. Jolliffe, "Principal component analysis," in International encyclopedia of statistical science. Springer, 2011, pp. 1094 -- 1096. [9] G. E. Hinton, S. Osindero, and Y.-W. Teh, "A fast learning algorithm for deep belief nets," Neural computation, vol. 18, no. 7, pp. 1527 -- 1554, 2006. [10] W. Wang, Y. Huang, Y. Wang, and L. Wang, "Generalized autoencoder: A neural network framework for dimensionality reduction," in Proceed- ings of the IEEE conference on computer vision and pattern recognition workshops, 2014, pp. 490 -- 497. [11] D. P. Kingma and M. Welling, "Auto-encoding variational bayes," in Proceedings of the 2nd International Conference on Learning Repre- sentations (ICLR), 2014. [12] J. Li, T. Luong, and D. Jurafsky, "A hierarchical neural autoencoder for paragraphs and documents," in Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), 2015, pp. 1106 -- 1115. [13] B. Liu and L. Zhang, "A survey of opinion mining and sentiment analysis," in Mining text data. Springer, 2012, pp. 415 -- 463. [14] C. Guggilla, T. Miller, and I. Gurevych, "Cnn-and lstm-based claim classification in online user comments," in Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, 2016, pp. 2740 -- 2751. [15] Q. T. Ain, M. Ali, A. Riaz, A. Noureen, M. Kamran, B. Hayat, and A. Rehman, "Sentiment analysis using deep learning techniques: a review," Int J Adv Comput Sci Appl, vol. 8, no. 6, p. 424, 2017. [16] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhut- dinov, "Dropout: a simple way to prevent neural networks from overfit- ting," Journal of Machine Learning Research, vol. 15, no. 1, pp. 1929 -- 1958, 2014. [17] J. Duchi, E. Hazan, and Y. Singer, "Adaptive subgradient methods for online learning and stochastic optimization," Journal of Machine Learning Research, vol. 12, no. Jul, pp. 2121 -- 2159, 2011. [18] A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts, "Learning word vectors for sentiment analysis," in Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, 2011, pp. 142 -- 150. [19] B. Klimt and Y. Yang, "Introducing the Enron corpus." in CEAS, 2004. [20] F. Galgani and A. Hoffmann, "Lexa: Towards automatic legal citation classification," in AI 2010: Advances in Artificial Intelligence, ser. Lecture Notes in Computer Science, J. Li, Ed., vol. 6464. Springer Berlin Heidelberg, 2010, pp. 445 -- 454. [21] P. D. Turney and P. Pantel, "From frequency to meaning: Vector space models of semantics," Journal of artificial intelligence research, vol. 37, pp. 141 -- 188, 2010. [22] J. Coates and D. Bollegala, "Frustratingly easy meta-embedding -- computing meta-embeddings by averaging source word embeddings," in Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), 2018. [23] M. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, and L. Zettlemoyer, "Deep contextualized word representations," in Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), 2018, pp. 2227 -- 2237. [24] O. Levy and Y. Goldberg, "Linguistic regularities in sparse and explicit word representations," in Proceedings of the eighteenth conference on computational natural language learning, 2014, pp. 171 -- 180. [25] G. Lample, M. Ott, A. Conneau, L. Denoyer et al., "Phrase-based & neural unsupervised machine translation," in Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, 2018, pp. 5039 -- 5049. [26] N. Yang, S. Liu, M. Li, M. Zhou, and N. Yu, "Word alignment modeling with context dependent deep neural network," in Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics, 2013, pp. 166 -- 175. [27] S. Gouws, Y. Bengio, and G. Corrado, "Bilbowa: Fast bilingual distributed representations without word alignments," in International Conference on Machine Learning, 2015, pp. 748 -- 756. [28] I. Vulic and M.-F. Moens, "Bilingual word embeddings from non- parallel document-aligned data applied to bilingual lexicon induction," in Proceedings of the Association for Computational Linguistics (ACL 2015), vol. 2. ACL; East Stroudsburg, PA, 2015, pp. 719 -- 725. the 53rd Annual Meeting of [29] H. Zhong, J. Zhang, Z. Wang, H. Wan, and Z. Chen, "Aligning knowledge and text embeddings by entity descriptions," in Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 2015, pp. 267 -- 272. [30] M. Norouzi, T. Mikolov, S. Bengio, Y. Singer, J. Shlens, A. Frome, G. S. Corrado, and J. Dean, "Zero-shot learning by convex combination of semantic embeddings," in Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2014. [31] W. Yang, W. Lu, and V. Zheng, "A simple regularization-based algorithm for learning cross-domain word embeddings," in Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, 2017, pp. 2898 -- 2904. [32] S. Ghannay, B. Favre, Y. Esteve, and N. Camelin, "Word embedding evaluation and combination," in Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC 2016), 2016, pp. 300 -- 305. [33] W. Yin and H. Schutze, "Multichannel variable-size convolution for sentence classification," in Proceedings of the Nineteenth Conference on Computational Natural Language Learning, 2015, pp. 204 -- 214. [34] Y. Zhang, S. Roller, and B. C. Wallace, "MGNC-CNN: A simple approach to exploiting multiple word embeddings for sentence classifi- cation," in Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2016, pp. 1522 -- 1527. [35] Y. Kim, "Convolutional neural networks for sentence classification," in Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2014, pp. 1746 -- 1751. [36] W. Yin, K. Kann, M. Yu, and H. Schutze, "Comparative study of cnn and rnn for natural language processing," CoRR, vol. abs/1702.01923, 2017. [37] D. Tang, F. Wei, B. Qin, N. Yang, T. Liu, and M. Zhou, "Sentiment embeddings with applications to sentiment analysis," IEEE Transactions on Knowledge and Data Engineering, vol. 28, pp. 496 -- 509, 2016. [38] C. O. S. Sorzano, J. Vargas, and A. D. Pascual-Montano, "A survey of dimensionality reduction techniques," CoRR, vol. abs/1403.2877, 2014. [39] G. Rabusseau, B. Balle, and J. Pineau, "Multitask spectral learning of weighted automata," in Advances in Neural Information Processing Systems, 2017, pp. 2588 -- 2597. [40] D. Goldfarb and Z. Qin, "Robust low-rank tensor recovery: Models and algorithms," SIAM Journal on Matrix Analysis and Applications, vol. 35, no. 1, pp. 225 -- 253, 2014.
1902.01370
3
1902
2019-10-28T07:55:12
Insertion-based Decoding with automatically Inferred Generation Order
[ "cs.CL", "cs.LG" ]
Conventional neural autoregressive decoding commonly assumes a fixed left-to-right generation order, which may be sub-optimal. In this work, we propose a novel decoding algorithm -- InDIGO -- which supports flexible sequence generation in arbitrary orders through insertion operations. We extend Transformer, a state-of-the-art sequence generation model, to efficiently implement the proposed approach, enabling it to be trained with either a pre-defined generation order or adaptive orders obtained from beam-search. Experiments on four real-world tasks, including word order recovery, machine translation, image caption and code generation, demonstrate that our algorithm can generate sequences following arbitrary orders, while achieving competitive or even better performance compared to the conventional left-to-right generation. The generated sequences show that InDIGO adopts adaptive generation orders based on input information.
cs.CL
cs
Insertion-based Decoding with automatically Inferred Generation Order Jiatao Gu†, Qi Liu(cid:5)∗, and Kyunghyun Cho‡† †Facebook AI Research (cid:5)University of Oxford ‡New York University, CIFAR Azrieli Global Scholar †{jgu, kyunghyuncho}@fb.com ‡[email protected] 9 1 0 2 t c O 8 2 ] L C . s c [ 3 v 0 7 3 1 0 . 2 0 9 1 : v i X r a Abstract Conventional neural autoregressive decod- ing commonly assumes a fixed left-to-right generation order, which may be sub-optimal. In this work, we propose a novel decod- ing algorithm -- InDIGO -- which supports flexible sequence generation in arbitrary or- ders through insertion operations. We extend Transformer, a state-of-the-art sequence gen- eration model, to efficiently implement the proposed approach, enabling it to be trained with either a pre-defined generation order or adaptive orders obtained from beam-search. Experiments on four real-world tasks, in- cluding word order recovery, machine trans- lation, image caption and code generation, demonstrate that our algorithm can generate sequences following arbitrary orders, while achieving competitive or even better perfor- mance compared to the conventional left-to- right generation. The generated sequences show that InDIGO adopts adaptive genera- tion orders based on input information. 1 Introduction Neural autoregressive models have become the de facto standard in a wide range of sequence genera- tion tasks, such as machine translation (Bahdanau et al., 2015), summarization (Rush et al., 2015) and dialogue systems (Vinyals and Le, 2015). In these studies, a sequence is modeled autoregressively with the left-to-right generation order, which raises the question of whether generation in an arbitrary order is worth considering (Vinyals et al., 2016; Ford et al., 2018). Nevertheless, previous studies on generation orders mostly resort to a fixed set of generation orders, showing particular choices of ordering are helpful (Wu et al., 2018; Ford et al., 2018; Mehri and Sigal, 2018), without providing ∗This work was completed while the author worked as an AI resident at Facebook AI Research. Figure 1: An example of InDIGO. At each step, we simultaneously predict the next token and its (relative) position to be inserted. The final output sequence is obtained by mapping the words based on their positions. an efficient algorithm for finding adaptive genera- tion orders, or restrict the problem scope to n-gram segment generation (Vinyals et al., 2016). In this paper, we propose a novel decoding al- gorithm, Insertion-based Decoding with Inferred Generation Order (InDIGO), which models gener- ation orders as latent variables and automatically infers the generation orders by simultaneously pre- dicting a word and its position to be inserted at each decoding step. Given that absolute positions are unknown before generating the whole sequence, we use a relative-position-based representation to capture generation orders. We show that decoding consists of a series of insertion operations with a demonstration shown in Figure 1. We extend Transformer (Vaswani et al., 2017) for supporting insertion operations, where the gen- eration order is directly captured as relative po- sitions through self-attention inspired by (Shaw et al., 2018). For learning, we maximize the evi- dence lower-bound (ELBO) of the maximum like- lihood objective, and study two approximate pos- terior distributions of generation orders based on a pre-defined generation order and adaptive orders <S></S>dream<S></S>dreamI<S></S>dreamIa<S></S>dreamIahave<S></S>dreamIhavea021000234534111232insert to rightinsert to left T(cid:89) obtained from beam-search, respectively. Experimental results on word order recovery, machine translation, code generation and image caption demonstrate that our algorithm can gener- ate sequences with arbitrary orders, while achiev- ing competitive or even better performance com- pared to the conventional left-to-right generation. Case studies show that the proposed method adopts adaptive orders based on input information. The code will be released as part of the official repo of Fairseq (https://github.com/pytorch/fairseq). 2 Neural Autoregressive Decoding Let us consider the problem of generating a se- quence y = (y1, ..., yT ) conditioned on some in- puts, e.g., a source sequence x = (x1, ..., xT (cid:48)). Our goal is to build a model parameterized by θ that models the conditional probability of y given x, which is factorized as: pθ(yx) = pθ(yt+1y0:t, x1:T (cid:48)), (1) t=0 where y0 and yT +1 are special tokens (cid:104)s(cid:105) and (cid:104)/s(cid:105), respectively. The model sequentially predicts the conditional probability of the next token at each step t, which can be implemented by any func- tion approximator such as RNNs (Bahdanau et al., 2015) and Transformer (Vaswani et al., 2017). Learning Neural autoregressive model is com- monly learned by maximizing the conditional like- t=0 log pθ(yt+1y0:t, x1:T (cid:48)) lihood log p(yx) =(cid:80)T given a set of parallel examples. Decoding A common way to decode a sequence from a trained model is to make use of the autore- gressive nature that allows us to predict one word at each step. Given any source x, we essentially follow the order of factorization to generate tokens sequentially using some heuristic-based algorithms such as greedy decoding and beam search. 3 Insertion-based Decoding with Inferred Generation Order (InDIGO) Eq. 1 explicitly assumes a left-to-right (L2R) gen- eration order of the sequence y. In principle, we can factorize the sequence probability in any per- mutation and train a model for each permutation separately. As long as we have infinite amount of data with proper optimization performed, all these models are equivalent. Nevertheless, Vinyals et al. (2016) have shown that the generation order of a sequence actually matters in many real-world tasks, e.g., language modeling. Although the L2R order is a strong inductive bias, as it is natural for most human-beings to read and write sequences from left to right, L2R is not necessarily the optimal option for generating se- quences. For instance, people sometimes tend to think of central phrases first before building up a whole sentence; For programming languages, it is beneficial to be generated based on abstract syntax trees (Yin and Neubig, 2017). Therefore, a natural question arises, how can we decode a sequence in its best order? 3.1 Orders as Latent Variables We address this question by modeling generation orders as latent variables. Similar to Vinyals et al. (2016), we rewrite the target sequence y in a par- ticular order π = (z2, ..., zT , zT +1) ∈ PT 1 as a set yπ = {(y2, z2), ..., (yT +1, zT +1)}, where (yt, zt) represents the t-th generated token and its absolute position, respectively. Different from the common notation, the target sequence is 2-step drifted be- cause the two special tokens (y0, z0) = ((cid:104)s(cid:105), 0) and (y1, z1) = ((cid:104)/s(cid:105), T + 1) are always prepended to represent the left and right boundaries, respec- tively. Then, we model the conditional probability as the joint distribution of words and positions by marginalizing all the orders: pθ(yx) = pθ(yπx), (cid:88) π∈PT where for each element: pθ(yπx) = pθ(yT +2y0:T +1, z0:T +1, x1:T (cid:48))· pθ(yt+1, zt+1y0:t, z0:t, x1:T (cid:48)) T(cid:89) (2) t=1 where the third special token yT +2 = (cid:104)eod(cid:105) is intro- duced to signal the end-of-decoding, and p(yT +2·) is the end-of-decoding probability. At decoding time, the factorization allows us to decode autoregressively by predicting word yt+1 and its position zt+1 step by step. The generation order is automatically inferred during decoding. 3.2 Relative Representation of Positions It is difficult and inefficient to predict the absolute positions zt without knowing the actual length T . 1 PT is the set of all the permutations of (1, ..., T ). 0, ..., zt 1 = 3, zt 2 = 2, zt One solution is directly using the absolute posi- tions zt t of the partial sequence y0:t at each autoregressive step t. For example, the absolute positions for the sequence ((cid:104)s(cid:105), (cid:104)/s(cid:105), dream, I) are 3 = 1) in Figure 1 at 0 = 0, zt (zt step t = 3. It is however inefficient to model such explicit positions using a single neural network without recomputing the hidden states for the en- tire partial sequence, as some positions are changed at every step (as shown in Figure 1). Relative Positions We propose using relative- position representations rt 0:t instead of absolute i ∈ positions zt {−1, 0, 1}t+1 as the relative-position representa- tion for zt i is defined as: 0:t. We use a ternary vector rt i. The j-th element of rt 0 1 zt j > zt zt j = zt zt j < zt i (left) i (middle) i (right) −1 (cid:3) to show the relative-position (3) , where the elements of rt i show the relative po- sitions with respect to all the other words in the partial sequence at step t. We use a matrix Rt =(cid:2)rt rt i,j = 0, rt 1, ..., rt t representations of all the words in the sequence. The relative-position representation can always be mapped back to the absolute position zt i by: zt i = max(0, rt i,j) (4) t(cid:88) j=0 One of the biggest advantages for using such vector- based representations is that at each step, updating the relative-position representations is simply ex- tending the relative-position matrix Rt with the next predicted relative position, because the (left, middle, right) relations described in Eq. (3) stay unchanged once they are created. Thus, we update Rt as follows: Rt+1 = Rt ··· −rt+1 t+1,t −rt+1 t+1,0 (5) where we use rt+1 t+1 to represent the relative position at step t+1. This append-only property enables our method to reuse the previous hidden states without recomputing the hidden states at each step. For simplicity, the superscript of r is omitted from now on without causing conflicts.   rt+1 t+1,0 ... rt+1 t+1,t 0 Algorithm 1 Insertion-based Decoding 1 0 Initialize: y = ((cid:104)s(cid:105),(cid:104)/s(cid:105)), R = repeat −1 (cid:104) 0 (cid:105) , t = 1 Predict the next word yt+1 based on y, R. if yt+1 is (cid:104)eod(cid:105) then break end if Choose an existing word yk ∈ y; Choose the left or right (s) of yk to insert; Obtain the next position rt+1 with k, s (Eq. (6)). Update R by appending rt+1 (Eq. (5)). Update y by appending yt+1 Update t = t + 1 until Reach the maximum length Map back to absolute positions π (Eq. (4)) Reorder y: yzi = yi ∀zi ∈ π, i ∈ [0, t] (cid:40) Insertion-based Decoding 3.3 Given a partial sequence y0:t and its correspond- ing relative-position representations r0:t, not all of the 3t+2 possible vectors are valid for the next relative-position representation, rt+1. Only these vectors corresponding to insertion operations sat- isfy Eq. (4). In Algorithm 1, we describe an insertion-based decoding framework based on this observation. The next word yt+1 is predicted based on y0:t and r0:t. We then choose an existing word yk (0 ≤ k ≤ t)) from y0:t and insert yt+1 to its left or right. As a result, the next position rt+1 is determined by rt+1,j = s rk,j j = k j (cid:54)= k , ∀j ∈ [0, t] (6) where s = −1 if yt+1 is on the left of yk, and s = 1 otherwise. Finally, we use rt+1 to update the relative-position matrix R as shown in Eq. (5). 4 Model We present Transformer-InDIGO, an extension of Transformer (Vaswani et al., 2017), supporting insertion-based decoding. The overall framework is shown in Figure 2. 4.1 Network Design We extend the decoder of Transformer with relative- position-based self-attention, joint word & position prediction and position updating modules. Self-Attention One of the major challenges that prevents the vanilla Transformer from generating sequences following arbitrary orders is that the Figure 2: The overall framework of the proposed Transformer-InDIGO which includes (a) the word & position prediction module; (b) the one step decoding with position updating; (c) final decoding output by reordering. The black-white blocks represent the relative position matrix. absolute-position-based positional encodings are inefficient as mentioned in Section 3.2, in that abso- lute positions are changed during decoding, invali- dating the previous hidden states. In contrast, we adapt Shaw et al. (2018) to use relative positions in self-attention. Different from Shaw et al. (2018), in which a clipping distance d (usually d ≥ 2) is set for relative positions, our relative-position repre- sentations only preserve d = 1 relations (Eq. (3)). Each attention head in a multi-head self-attention module of Transformer-InDIGO takes the hidden states of a partial sequence y0:t, denoted as U = (u0, ..., ut), and its corresponding relative position matrix Rt as input, where each input state ui ∈ Rdmodel. The logit ei,j for attention is computed as: i Q(cid:1) ·(cid:16) (cid:0)u(cid:62) ei,j = (cid:17)(cid:62) u(cid:62) j K + A[ri,j +1] √ dmodel , (7) where Q, K ∈ Rdmodel×dmodel and A ∈ R3×dmodel are parameter matrices. A[ri,j +1] is the row vector indexed by ri,j + 1, which biases all the input keys based on the relative position, ri,j. Word & Position Prediction Like the vanilla Transformer, we take the representations from the last layer of self-attention, H = (h0, ..., ht) and H ∈ Rdmodel×(t+1), to predict both the next word yt+1 and its position vector rt+1 in two stages based on the following factorization: p(yt+1, rt+1H) = p(yt+1H) · p(rt+1yt+1, H) It can also be factorized as predicting the position before predicting the next word, yet our prelimi- nary experiments show that predicting the word first works slightly better. The prediction module First, we predict the next word yt+1 from the for word & position prediction are shown in Fig- ure 2(a). categorical distribution pword(yH) as: t F ) · W pword(yH) = softmax (cid:62)(cid:17) (h(cid:62) , (8) (cid:16) where W ∈ RdV×dmodel is the embedding matrix and dV is the size of vocabulary. We linearly project the last representation ht using F ∈ Rdmodel×dmodel for querying W . Then, as shown in Eq. (6), the pre- diction of the next position is done by performing insertion operations to existing words which can be modeled similarly to Pointer Networks (Vinyals et al., 2015). We predict a pointer kt+1 ∈ [0, 2t+1] based on: ppointer(kyt+1, H) = (cid:32) (cid:21)(cid:62)(cid:33) (cid:20)H(cid:62)C H(cid:62)D (9) , softmax (h(cid:62) t E + W[yt+1]) · where C, D, E ∈ Rdmodel×dmodel and W[yt+1] is the embedding of the predicted word. C, D are used to obtain the left and right keys, respectively, con- sidering that each word has two "keys" (its left and right) for inserting the generated word. The query vector is obtained by adding up the word em- bedding W[yt+1], and the linearly projected state, h(cid:62) t E. The resulting relative-position vector, rt+1 is computed using kt+1 according to Eq. (6). We manually set ppointer(0·) = ppointer(2 + t·) = 0 to avoid any word from being inserted to the left of (cid:104)s(cid:105) and the right of (cid:104)/s(cid:105). Position Updating As mentioned in Sec. 3.1, we update the relative position representation Rt with <S></S>dreamIaRelative PositionsTransformer-DecoderRLRRLLCausalSelf-attentionUpdatea0-1+1Rkey for insert at rightLkey for insert at left<S></S>dreamIahave054123<S></S>dreamIahavesortht<latexit sha1_base64="bfTi8g3GUSdgtNjKa2Fy0oX2GsY=">AAAB6nicbVA9SwNBEJ2LXzF+RQUbm8UgWIU7m1gGbSwTNB+QHHFvs5cs2ds7dueEcOQn2FgoYusvsrPxt7j5KDTxwcDjvRlm5gWJFAZd98vJra1vbG7ltws7u3v7B8XDo6aJU814g8Uy1u2AGi6F4g0UKHk70ZxGgeStYHQz9VuPXBsRq3scJ9yP6ECJUDCKVrob9rBXLLlldwaySrwFKVVP6t8PAFDrFT+7/ZilEVfIJDWm47kJ+hnVKJjkk0I3NTyhbEQHvGOpohE3fjY7dULOrdInYaxtKSQz9fdERiNjxlFgOyOKQ7PsTcX/vE6K4ZWfCZWkyBWbLwpTSTAm079JX2jOUI4toUwLeythQ6opQ5tOwYbgLb+8SpqXZc8te3WbxjXMkYdTOIML8KACVbiFGjSAwQCe4AVeHek8O2/O+7w15yxmjuEPnI8f5jSPtA==</latexit><latexit sha1_base64="MUCBKc2QkRNerSU/qY62O5UdoSc=">AAAB6nicbVA9SwNBEJ2LXzF+RQUbm8UgWIU7Gy1DbCwTNImQHGFvs5cs2ds7dueEcOQn2FgoYmvrv/AX2Nn4W9x8FJr4YODx3gwz84JECoOu++XkVlbX1jfym4Wt7Z3dveL+QdPEqWa8wWIZ67uAGi6F4g0UKPldojmNAslbwfBq4rfuuTYiVrc4Srgf0b4SoWAUrXQz6GK3WHLL7hRkmXhzUqoc1b/Fe/Wj1i1+dnoxSyOukElqTNtzE/QzqlEwyceFTmp4QtmQ9nnbUkUjbvxseuqYnFqlR8JY21JIpurviYxGxoyiwHZGFAdm0ZuI/3ntFMNLPxMqSZErNlsUppJgTCZ/k57QnKEcWUKZFvZWwgZUU4Y2nYINwVt8eZk0z8ueW/bqNo0qzJCHYziBM/DgAipwDTVoAIM+PMATPDvSeXRenNdZa86ZzxzCHzhvPzeEkXA=</latexit><latexit sha1_base64="MUCBKc2QkRNerSU/qY62O5UdoSc=">AAAB6nicbVA9SwNBEJ2LXzF+RQUbm8UgWIU7Gy1DbCwTNImQHGFvs5cs2ds7dueEcOQn2FgoYmvrv/AX2Nn4W9x8FJr4YODx3gwz84JECoOu++XkVlbX1jfym4Wt7Z3dveL+QdPEqWa8wWIZ67uAGi6F4g0UKPldojmNAslbwfBq4rfuuTYiVrc4Srgf0b4SoWAUrXQz6GK3WHLL7hRkmXhzUqoc1b/Fe/Wj1i1+dnoxSyOukElqTNtzE/QzqlEwyceFTmp4QtmQ9nnbUkUjbvxseuqYnFqlR8JY21JIpurviYxGxoyiwHZGFAdm0ZuI/3ntFMNLPxMqSZErNlsUppJgTCZ/k57QnKEcWUKZFvZWwgZUU4Y2nYINwVt8eZk0z8ueW/bqNo0qzJCHYziBM/DgAipwDTVoAIM+PMATPDvSeXRenNdZa86ZzxzCHzhvPzeEkXA=</latexit><latexit sha1_base64="O7FfWHYl4nxml/caqTcK6XxGg/w=">AAAB6nicbVA9TwJBEJ3DL8Qv1NJmIzGxInc2WhJtLDEKksCF7C17sGFv97I7Z0Iu/AQbC42x9RfZ+W9c4AoFXzLJy3szmZkXpVJY9P1vr7S2vrG5Vd6u7Ozu7R9UD4/aVmeG8RbTUptORC2XQvEWCpS8kxpOk0jyx2h8M/Mfn7ixQqsHnKQ8TOhQiVgwik66H/WxX635dX8OskqCgtSgQLNf/eoNNMsSrpBJam038FMMc2pQMMmnlV5meUrZmA5511FFE27DfH7qlJw5ZUBibVwpJHP190ROE2snSeQ6E4oju+zNxP+8bobxVZgLlWbIFVssijNJUJPZ32QgDGcoJ45QZoS7lbARNZShS6fiQgiWX14l7Yt64NeDO7/WuC7iKMMJnMI5BHAJDbiFJrSAwRCe4RXePOm9eO/ex6K15BUzx/AH3ucPV5yNzw==</latexit>C<latexit sha1_base64="qitYjHnTvWLLMhbcMUcBblbEEo8=">AAAB6HicbZC7SwNBEMbnfMb4ilraLAbBKtzZaCMG01gmYB6QHGFvM5es2ds7dveEcATsbSwUsfWfsbfzv3HzKDTxg4Uf3zfDzkyQCK6N6347K6tr6xubua389s7u3n7h4LCh41QxrLNYxKoVUI2CS6wbbgS2EoU0CgQ2g2FlkjcfUGkeyzszStCPaF/ykDNqrFWrdAtFt+RORZbBm0Px+jN/9QgA1W7hq9OLWRqhNExQrduemxg/o8pwJnCc76QaE8qGtI9ti5JGqP1sOuiYnFqnR8JY2ScNmbq/OzIaaT2KAlsZUTPQi9nE/C9rpya89DMuk9SgZLOPwlQQE5PJ1qTHFTIjRhYoU9zOStiAKsqMvU3eHsFbXHkZGuclzy15NbdYvoGZcnAMJ3AGHlxAGW6hCnVggPAEL/Dq3DvPzpvzPitdceY9R/BHzscPA+yOkA==</latexit><latexit sha1_base64="EQAAM1j/Ie8eqC8qE7NRLV0Spmg=">AAAB6HicbZC7SgNBFIbPxltcb1FLm8UgWIVdG23EYBrLBMwFkiXMTs4mY2Znl5lZISx5AhsLRWz1YextxLdxcik08YeBj/8/hznnBAlnSrvut5VbWV1b38hv2lvbO7t7hf2DhopTSbFOYx7LVkAUciawrpnm2Eokkijg2AyGlUnevEepWCxu9ShBPyJ9wUJGiTZWrdItFN2SO5WzDN4cilcf9mXy/mVXu4XPTi+maYRCU06Uantuov2MSM0ox7HdSRUmhA5JH9sGBYlQ+dl00LFzYpyeE8bSPKGdqfu7IyORUqMoMJUR0QO1mE3M/7J2qsMLP2MiSTUKOvsoTLmjY2eytdNjEqnmIwOESmZmdeiASEK1uY1tjuAtrrwMjbOS55a8mlssX8NMeTiCYzgFD86hDDdQhTpQQHiAJ3i27qxH68V6nZXmrHnPIfyR9fYD9WyQBA==</latexit><latexit sha1_base64="EQAAM1j/Ie8eqC8qE7NRLV0Spmg=">AAAB6HicbZC7SgNBFIbPxltcb1FLm8UgWIVdG23EYBrLBMwFkiXMTs4mY2Znl5lZISx5AhsLRWz1YextxLdxcik08YeBj/8/hznnBAlnSrvut5VbWV1b38hv2lvbO7t7hf2DhopTSbFOYx7LVkAUciawrpnm2Eokkijg2AyGlUnevEepWCxu9ShBPyJ9wUJGiTZWrdItFN2SO5WzDN4cilcf9mXy/mVXu4XPTi+maYRCU06Uantuov2MSM0ox7HdSRUmhA5JH9sGBYlQ+dl00LFzYpyeE8bSPKGdqfu7IyORUqMoMJUR0QO1mE3M/7J2qsMLP2MiSTUKOvsoTLmjY2eytdNjEqnmIwOESmZmdeiASEK1uY1tjuAtrrwMjbOS55a8mlssX8NMeTiCYzgFD86hDDdQhTpQQHiAJ3i27qxH68V6nZXmrHnPIfyR9fYD9WyQBA==</latexit><latexit sha1_base64="n9q4lqwqCrBAGkuJ+w9AiHHXDD4=">AAAB6HicbVA9TwJBEJ3DL8Qv1NJmIzGxInc2UhJpLCGRjwQuZG+Zg5W9vcvungm58AtsLDTG1p9k579xgSsUfMkkL+/NZGZekAiujet+O4Wt7Z3dveJ+6eDw6PikfHrW0XGqGLZZLGLVC6hGwSW2DTcCe4lCGgUCu8G0sfC7T6g0j+WDmSXoR3QsecgZNVZqNYblilt1lyCbxMtJBXI0h+WvwShmaYTSMEG17ntuYvyMKsOZwHlpkGpMKJvSMfYtlTRC7WfLQ+fkyiojEsbKljRkqf6eyGik9SwKbGdEzUSvewvxP6+fmrDmZ1wmqUHJVovCVBATk8XXZMQVMiNmllCmuL2VsAlVlBmbTcmG4K2/vEk6N1XPrXott1K/y+MowgVcwjV4cAt1uIcmtIEBwjO8wpvz6Lw4787HqrXg5DPn8AfO5w+UpYzD</latexit>D<latexit sha1_base64="k+Evk9/LT2U3D2FUCx6x034befI=">AAAB6HicbZC7SwNBEMbnfMbzFbW0WQyCVbiz0UYMamGZgHlAcoS9zVyyZm/v2N0TQgjY21goYus/Y2/nf+PmUWjiBws/vm+GnZkwFVwbz/t2lpZXVtfWcxvu5tb2zm5+b7+mk0wxrLJEJKoRUo2CS6wabgQ2UoU0DgXWw/71OK8/oNI8kXdmkGIQ067kEWfUWKty084XvKI3EVkEfwaFy0/34hEAyu38V6uTsCxGaZigWjd9LzXBkCrDmcCR28o0ppT1aRebFiWNUQfDyaAjcmydDokSZZ80ZOL+7hjSWOtBHNrKmJqens/G5n9ZMzPReTDkMs0MSjb9KMoEMQkZb006XCEzYmCBMsXtrIT1qKLM2Nu49gj+/MqLUDst+l7Rr3iF0hVMlYNDOIIT8OEMSnALZagCA4QneIFX5955dt6c92npkjPrOYA/cj5+AAVwjpE=</latexit><latexit sha1_base64="G8RSHBlg9lJEMWdbTCCPcRxw1n8=">AAAB6HicbZC7SgNBFIbPxltcb1FLm8UgWIVdG23EoBaWCZgLJEuYnZxNxszOLjOzQljyBDYWitjqw9jbiG/j5FJo4g8DH/9/DnPOCRLOlHbdbyu3tLyyupZftzc2t7Z3Crt7dRWnkmKNxjyWzYAo5ExgTTPNsZlIJFHAsREMrsZ54x6lYrG41cME/Yj0BAsZJdpY1etOoeiW3ImcRfBmULz4sM+T9y+70il8trsxTSMUmnKiVMtzE+1nRGpGOY7sdqowIXRAetgyKEiEys8mg46cI+N0nTCW5gntTNzfHRmJlBpGgamMiO6r+Wxs/pe1Uh2e+RkTSapR0OlHYcodHTvjrZ0uk0g1HxogVDIzq0P7RBKqzW1scwRvfuVFqJ+UPLfkVd1i+RKmysMBHMIxeHAKZbiBCtSAAsIDPMGzdWc9Wi/W67Q0Z8169uGPrLcf9vCQBQ==</latexit><latexit sha1_base64="G8RSHBlg9lJEMWdbTCCPcRxw1n8=">AAAB6HicbZC7SgNBFIbPxltcb1FLm8UgWIVdG23EoBaWCZgLJEuYnZxNxszOLjOzQljyBDYWitjqw9jbiG/j5FJo4g8DH/9/DnPOCRLOlHbdbyu3tLyyupZftzc2t7Z3Crt7dRWnkmKNxjyWzYAo5ExgTTPNsZlIJFHAsREMrsZ54x6lYrG41cME/Yj0BAsZJdpY1etOoeiW3ImcRfBmULz4sM+T9y+70il8trsxTSMUmnKiVMtzE+1nRGpGOY7sdqowIXRAetgyKEiEys8mg46cI+N0nTCW5gntTNzfHRmJlBpGgamMiO6r+Wxs/pe1Uh2e+RkTSapR0OlHYcodHTvjrZ0uk0g1HxogVDIzq0P7RBKqzW1scwRvfuVFqJ+UPLfkVd1i+RKmysMBHMIxeHAKZbiBCtSAAsIDPMGzdWc9Wi/W67Q0Z8169uGPrLcf9vCQBQ==</latexit><latexit sha1_base64="N532L3S4++3uGp4iHp6lOnatguw=">AAAB6HicbVA9SwNBEJ2LXzF+RS1tFoNgFe5sTBnUwjIB8wHJEfY2c8mavb1jd08IR36BjYUitv4kO/+Nm+QKTXww8Hhvhpl5QSK4Nq777RQ2Nre2d4q7pb39g8Oj8vFJW8epYthisYhVN6AaBZfYMtwI7CYKaRQI7AST27nfeUKleSwfzDRBP6IjyUPOqLFS825QrrhVdwGyTrycVCBHY1D+6g9jlkYoDRNU657nJsbPqDKcCZyV+qnGhLIJHWHPUkkj1H62OHRGLqwyJGGsbElDFurviYxGWk+jwHZG1Iz1qjcX//N6qQlrfsZlkhqUbLkoTAUxMZl/TYZcITNiagllittbCRtTRZmx2ZRsCN7qy+ukfVX13KrXdCv1mzyOIpzBOVyCB9dQh3toQAsYIDzDK7w5j86L8+58LFsLTj5zCn/gfP4AlimMxA==</latexit>E<latexit sha1_base64="NlFKxwEorTyvX+ZWl7iisJb1VZk=">AAAB6HicbZC7SwNBEMbnfMbzFbW0WQyCVbiz0UYMimCZgHlAcoS9zVyyZm/v2N0TQgjY21goYus/Y2/nf+PmUWjiBws/vm+GnZkwFVwbz/t2lpZXVtfWcxvu5tb2zm5+b7+mk0wxrLJEJKoRUo2CS6wabgQ2UoU0DgXWw/71OK8/oNI8kXdmkGIQ067kEWfUWKty084XvKI3EVkEfwaFy0/34hEAyu38V6uTsCxGaZigWjd9LzXBkCrDmcCR28o0ppT1aRebFiWNUQfDyaAjcmydDokSZZ80ZOL+7hjSWOtBHNrKmJqens/G5n9ZMzPReTDkMs0MSjb9KMoEMQkZb006XCEzYmCBMsXtrIT1qKLM2Nu49gj+/MqLUDst+l7Rr3iF0hVMlYNDOIIT8OEMSnALZagCA4QneIFX5955dt6c92npkjPrOYA/cj5+AAb0jpI=</latexit><latexit sha1_base64="bH4UPRdYnmM6bMmSz7bDix7UCZc=">AAAB6HicbZDLSsNAFIZP6q3GW9Wlm2ARXJXEjW7EogguW7AXaEOZTE/asZNJmJkIJfQJ3LhQxK0+jHs34ts4vSy09YeBj/8/hznnBAlnSrvut5VbWl5ZXcuv2xubW9s7hd29uopTSbFGYx7LZkAUciawppnm2Ewkkijg2AgGV+O8cY9SsVjc6mGCfkR6goWMEm2s6nWnUHRL7kTOIngzKF582OfJ+5dd6RQ+292YphEKTTlRquW5ifYzIjWjHEd2O1WYEDogPWwZFCRC5WeTQUfOkXG6ThhL84R2Ju7vjoxESg2jwFRGRPfVfDY2/8taqQ7P/IyJJNUo6PSjMOWOjp3x1k6XSaSaDw0QKpmZ1aF9IgnV5ja2OYI3v/Ii1E9Knlvyqm6xfAlT5eEADuEYPDiFMtxABWpAAeEBnuDZurMerRfrdVqas2Y9+/BH1tsP+HSQBg==</latexit><latexit sha1_base64="bH4UPRdYnmM6bMmSz7bDix7UCZc=">AAAB6HicbZDLSsNAFIZP6q3GW9Wlm2ARXJXEjW7EogguW7AXaEOZTE/asZNJmJkIJfQJ3LhQxK0+jHs34ts4vSy09YeBj/8/hznnBAlnSrvut5VbWl5ZXcuv2xubW9s7hd29uopTSbFGYx7LZkAUciawppnm2Ewkkijg2AgGV+O8cY9SsVjc6mGCfkR6goWMEm2s6nWnUHRL7kTOIngzKF582OfJ+5dd6RQ+292YphEKTTlRquW5ifYzIjWjHEd2O1WYEDogPWwZFCRC5WeTQUfOkXG6ThhL84R2Ju7vjoxESg2jwFRGRPfVfDY2/8taqQ7P/IyJJNUo6PSjMOWOjp3x1k6XSaSaDw0QKpmZ1aF9IgnV5ja2OYI3v/Ii1E9Knlvyqm6xfAlT5eEADuEYPDiFMtxABWpAAeEBnuDZurMerRfrdVqas2Y9+/BH1tsP+HSQBg==</latexit><latexit sha1_base64="UuWujcJ1qnBgRNBp8ukQAU/1iwM=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0m82GNRBI8t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CNgktsGW4EdhOFNAoEdoLJ7dzvPKHSPJYPZpqgH9GR5CFn1FipeTcoV9yquwBZJ15OKpCjMSh/9YcxSyOUhgmqdc9zE+NnVBnOBM5K/VRjQtmEjrBnqaQRaj9bHDojF1YZkjBWtqQhC/X3REYjradRYDsjasZ61ZuL/3m91IQ1P+MySQ1KtlwUpoKYmMy/JkOukBkxtYQyxe2thI2poszYbEo2BG/15XXSvqp6btVrupX6TR5HEc7gHC7Bg2uowz00oAUMEJ7hFd6cR+fFeXc+lq0FJ585hT9wPn8Al62MxQ==</latexit>F<latexit sha1_base64="uMv5FUJHmHt3pFNm7BO6XhGtAXY=">AAAB6HicbZC7SwNBEMbnfMbzFbW0WQyCVbiz0UYMCmKZgHlAcoS9zVyyZm/v2N0TQgjY21goYus/Y2/nf+PmUWjiBws/vm+GnZkwFVwbz/t2lpZXVtfWcxvu5tb2zm5+b7+mk0wxrLJEJKoRUo2CS6wabgQ2UoU0DgXWw/71OK8/oNI8kXdmkGIQ067kEWfUWKty084XvKI3EVkEfwaFy0/34hEAyu38V6uTsCxGaZigWjd9LzXBkCrDmcCR28o0ppT1aRebFiWNUQfDyaAjcmydDokSZZ80ZOL+7hjSWOtBHNrKmJqens/G5n9ZMzPReTDkMs0MSjb9KMoEMQkZb006XCEzYmCBMsXtrIT1qKLM2Nu49gj+/MqLUDst+l7Rr3iF0hVMlYNDOIIT8OEMSnALZagCA4QneIFX5955dt6c92npkjPrOYA/cj5+AAh4jpM=</latexit><latexit sha1_base64="HEQ4IExNQzo4E9k8+oDEYThRsbY=">AAAB6HicbZDLSsNAFIZP6q3GW9Wlm2ARXJXEjW7EoiAuW7AXaEOZTE/asZNJmJkIJfQJ3LhQxK0+jHs34ts4vSy09YeBj/8/hznnBAlnSrvut5VbWl5ZXcuv2xubW9s7hd29uopTSbFGYx7LZkAUciawppnm2Ewkkijg2AgGV+O8cY9SsVjc6mGCfkR6goWMEm2s6nWnUHRL7kTOIngzKF582OfJ+5dd6RQ+292YphEKTTlRquW5ifYzIjWjHEd2O1WYEDogPWwZFCRC5WeTQUfOkXG6ThhL84R2Ju7vjoxESg2jwFRGRPfVfDY2/8taqQ7P/IyJJNUo6PSjMOWOjp3x1k6XSaSaDw0QKpmZ1aF9IgnV5ja2OYI3v/Ii1E9Knlvyqm6xfAlT5eEADuEYPDiFMtxABWpAAeEBnuDZurMerRfrdVqas2Y9+/BH1tsP+fiQBw==</latexit><latexit sha1_base64="HEQ4IExNQzo4E9k8+oDEYThRsbY=">AAAB6HicbZDLSsNAFIZP6q3GW9Wlm2ARXJXEjW7EoiAuW7AXaEOZTE/asZNJmJkIJfQJ3LhQxK0+jHs34ts4vSy09YeBj/8/hznnBAlnSrvut5VbWl5ZXcuv2xubW9s7hd29uopTSbFGYx7LZkAUciawppnm2Ewkkijg2AgGV+O8cY9SsVjc6mGCfkR6goWMEm2s6nWnUHRL7kTOIngzKF582OfJ+5dd6RQ+292YphEKTTlRquW5ifYzIjWjHEd2O1WYEDogPWwZFCRC5WeTQUfOkXG6ThhL84R2Ju7vjoxESg2jwFRGRPfVfDY2/8taqQ7P/IyJJNUo6PSjMOWOjp3x1k6XSaSaDw0QKpmZ1aF9IgnV5ja2OYI3v/Ii1E9Knlvyqm6xfAlT5eEADuEYPDiFMtxABWpAAeEBnuDZurMerRfrdVqas2Y9+/BH1tsP+fiQBw==</latexit><latexit sha1_base64="XFqyBFTgCEUxwJTuQd64ewaUeqA=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0m82GNREI8t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CNgktsGW4EdhOFNAoEdoLJ7dzvPKHSPJYPZpqgH9GR5CFn1FipeTcoV9yquwBZJ15OKpCjMSh/9YcxSyOUhgmqdc9zE+NnVBnOBM5K/VRjQtmEjrBnqaQRaj9bHDojF1YZkjBWtqQhC/X3REYjradRYDsjasZ61ZuL/3m91IQ1P+MySQ1KtlwUpoKYmMy/JkOukBkxtYQyxe2thI2poszYbEo2BG/15XXSvqp6btVrupX6TR5HEc7gHC7Bg2uowz00oAUMEJ7hFd6cR+fFeXc+lq0FJ585hT9wPn8AmTGMxg==</latexit>W<latexit sha1_base64="SgWXombg1msUYlBJWSd7nhjmw3I=">AAAB6HicbZC7SwNBEMbn4ivGV9TSZjEIVuHORhsxaGOZgHlAcoS9zVyyZm/v2N0TwhGwt7FQxNZ/xt7O/8bNo9DEDxZ+fN8MOzNBIrg2rvvt5FZW19Y38puFre2d3b3i/kFDx6liWGexiFUroBoFl1g33AhsJQppFAhsBsObSd58QKV5LO/MKEE/on3JQ86osVat2S2W3LI7FVkGbw6lq8/C5SMAVLvFr04vZmmE0jBBtW57bmL8jCrDmcBxoZNqTCgb0j62LUoaofaz6aBjcmKdHgljZZ80ZOr+7shopPUoCmxlRM1AL2YT87+snZrwws+4TFKDks0+ClNBTEwmW5MeV8iMGFmgTHE7K2EDqigz9jYFewRvceVlaJyVPbfs1dxS5RpmysMRHMMpeHAOFbiFKtSBAcITvMCrc+88O2/O+6w058x7DuGPnI8fIjyOpA==</latexit><latexit sha1_base64="So0n/WFrGezzh4Ql0YSNr0dJmr0=">AAAB6HicbZC7SgNBFIbPeo3rLWppMxgEq7Bro40YtLFMwFwgCWF2cjYZMzu7zMwKYckT2FgoYqsPY28jvo2TS6GJPwx8/P85zDknSATXxvO+naXlldW19dyGu7m1vbOb39uv6ThVDKssFrFqBFSj4BKrhhuBjUQhjQKB9WBwPc7r96g0j+WtGSbYjmhP8pAzaqxVqXfyBa/oTUQWwZ9B4fLDvUjev9xyJ//Z6sYsjVAaJqjWTd9LTDujynAmcOS2Uo0JZQPaw6ZFSSPU7Wwy6IgcW6dLwljZJw2ZuL87MhppPYwCWxlR09fz2dj8L2umJjxvZ1wmqUHJph+FqSAmJuOtSZcrZEYMLVCmuJ2VsD5VlBl7G9cewZ9feRFqp0XfK/oVr1C6gqlycAhHcAI+nEEJbqAMVWCA8ABP8OzcOY/Oi/M6LV1yZj0H8EfO2w8Ty5AY</latexit><latexit sha1_base64="So0n/WFrGezzh4Ql0YSNr0dJmr0=">AAAB6HicbZC7SgNBFIbPeo3rLWppMxgEq7Bro40YtLFMwFwgCWF2cjYZMzu7zMwKYckT2FgoYqsPY28jvo2TS6GJPwx8/P85zDknSATXxvO+naXlldW19dyGu7m1vbOb39uv6ThVDKssFrFqBFSj4BKrhhuBjUQhjQKB9WBwPc7r96g0j+WtGSbYjmhP8pAzaqxVqXfyBa/oTUQWwZ9B4fLDvUjev9xyJ//Z6sYsjVAaJqjWTd9LTDujynAmcOS2Uo0JZQPaw6ZFSSPU7Wwy6IgcW6dLwljZJw2ZuL87MhppPYwCWxlR09fz2dj8L2umJjxvZ1wmqUHJph+FqSAmJuOtSZcrZEYMLVCmuJ2VsD5VlBl7G9cewZ9feRFqp0XfK/oVr1C6gqlycAhHcAI+nEEJbqAMVWCA8ABP8OzcOY/Oi/M6LV1yZj0H8EfO2w8Ty5AY</latexit><latexit sha1_base64="9SEGhucspoU8Qdg45nZgK4r6jcA=">AAAB6HicbVBNT8JAEJ3iF+IX6tHLRmLiibRe9Ej04hESCyTQkO0yhZXtttndmpCGX+DFg8Z49Sd589+4QA8KvmSSl/dmMjMvTAXXxnW/ndLG5tb2Tnm3srd/cHhUPT5p6yRTDH2WiER1Q6pRcIm+4UZgN1VI41BgJ5zczf3OEyrNE/lgpikGMR1JHnFGjZVanUG15tbdBcg68QpSgwLNQfWrP0xYFqM0TFCte56bmiCnynAmcFbpZxpTyiZ0hD1LJY1RB/ni0Bm5sMqQRImyJQ1ZqL8nchprPY1D2xlTM9ar3lz8z+tlJroJci7TzKBky0VRJohJyPxrMuQKmRFTSyhT3N5K2JgqyozNpmJD8FZfXiftq7rn1r2WW2vcFnGU4QzO4RI8uIYG3EMTfGCA8Ayv8OY8Oi/Ou/OxbC05xcwp/IHz+QOy9YzX</latexit>…Position PredictionWord Prediction…(a)<latexit sha1_base64="282JJehD7WAjx0hpBWFCbBzguNs=">AAAB6nicbVDLSgNBEOz1GeNr1aOXwSDES9j1oseAF48JmgckS5id9CZDZmeXmVkhLPkELx4U8eqH+A3e/As/wcnjoIkFDUVVN91dYSq4Np735aytb2xubRd2irt7+weH7tFxUyeZYthgiUhUO6QaBZfYMNwIbKcKaRwKbIWjm6nfekCleSLvzTjFIKYDySPOqLHSXZle9NySV/FmIKvEX5BS1a1/fwBAred+dvsJy2KUhgmqdcf3UhPkVBnOBE6K3UxjStmIDrBjqaQx6iCfnToh51bpkyhRtqQhM/X3RE5jrcdxaDtjaoZ62ZuK/3mdzETXQc5lmhmUbL4oygQxCZn+TfpcITNibAllittbCRtSRZmx6RRtCP7yy6ukeVnxvYpft2l4MEcBTuEMyuDDFVThFmrQAAYDeIRneHGE8+S8Om/z1jVnMXMCf+C8/wChyI+F</latexit><latexit sha1_base64="NcIupzmf3RhxzTFJaklXvkry3Y0=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlvBZ1y16ZW8KtEz8OSlW3Nr3x83RQ7XrfnZ6kqQxFYZwrHXb9xITZFgZRjgdFzqppgkmQ9ynbUsFjqkOsumpY3RqlR6KpLIlDJqqvycyHGs9ikPbGWMz0IveRPzPa6cmugwyJpLUUEFmi6KUIyPR5G/UY4oSw0eWYKKYvRWRAVaYGJtOwYbgL768TBrnZd8r+zWbhgcz5OEYTqAEPlxABa6hCnUg0IdHeIYXhztPzqvzNmvNOfOZQ/gD5/0H55aQeQ==</latexit><latexit sha1_base64="NcIupzmf3RhxzTFJaklXvkry3Y0=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlvBZ1y16ZW8KtEz8OSlW3Nr3x83RQ7XrfnZ6kqQxFYZwrHXb9xITZFgZRjgdFzqppgkmQ9ynbUsFjqkOsumpY3RqlR6KpLIlDJqqvycyHGs9ikPbGWMz0IveRPzPa6cmugwyJpLUUEFmi6KUIyPR5G/UY4oSw0eWYKKYvRWRAVaYGJtOwYbgL768TBrnZd8r+zWbhgcz5OEYTqAEPlxABa6hCnUg0IdHeIYXhztPzqvzNmvNOfOZQ/gD5/0H55aQeQ==</latexit><latexit sha1_base64="fIGXaRFLss1xFgKurVPdeLoqlJM=">AAAB6nicbVA9SwNBEJ2LXzF+RS1tFoMQm7Bno2XAxjKi+YDkCHubSbJkb+/Y3RPCkZ9gY6GIrb/Izn/jJrlCEx8MPN6bYWZemEhhLKXfXmFjc2t7p7hb2ts/ODwqH5+0TJxqjk0ey1h3QmZQCoVNK6zETqKRRaHEdji5nfvtJ9RGxOrRThMMIjZSYig4s056qLLLfrlCa3QBsk78nFQgR6Nf/uoNYp5GqCyXzJiuTxMbZExbwSXOSr3UYML4hI2w66hiEZogW5w6IxdOGZBhrF0pSxbq74mMRcZMo9B1RsyOzao3F//zuqkd3gSZUElqUfHlomEqiY3J/G8yEBq5lVNHGNfC3Ur4mGnGrUun5ELwV19eJ62rmk9r/j2t1GkeRxHO4Byq4MM11OEOGtAEDiN4hld486T34r17H8vWgpfPnMIfeJ8/ggGNNA==</latexit>(b)<latexit sha1_base64="TY/LbeBHIxrBTnqAw4a9X8UHtFM=">AAAB6nicbVDLSgNBEOz1GeNr1aOXwSDES9j1oseAF48JmgckS5id9CZDZmeXmVkhLPkELx4U8eqH+A3e/As/wcnjoIkFDUVVN91dYSq4Np735aytb2xubRd2irt7+weH7tFxUyeZYthgiUhUO6QaBZfYMNwIbKcKaRwKbIWjm6nfekCleSLvzTjFIKYDySPOqLHSXTm86Lklr+LNQFaJvyClqlv//gCAWs/97PYTlsUoDRNU647vpSbIqTKcCZwUu5nGlLIRHWDHUklj1EE+O3VCzq3SJ1GibElDZurviZzGWo/j0HbG1Az1sjcV//M6mYmug5zLNDMo2XxRlAliEjL9m/S5QmbE2BLKFLe3EjakijJj0ynaEPzll1dJ87LiexW/btPwYI4CnMIZlMGHK6jCLdSgAQwG8AjP8OII58l5dd7mrWvOYuYE/sB5/wGjTY+G</latexit><latexit sha1_base64="SVs4Ppr5xYUt4bgzNkXsuF7L3yw=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlsKzrlv0yt4UaJn4c1KsuLXvj5ujh2rX/ez0JEljKgzhWOu27yUmyLAyjHA6LnRSTRNMhrhP25YKHFMdZNNTx+jUKj0USWVLGDRVf09kONZ6FIe2M8ZmoBe9ifif105NdBlkTCSpoYLMFkUpR0aiyd+oxxQlho8swUQxeysiA6wwMTadgg3BX3x5mTTOy75X9ms2DQ9myMMxnEAJfLiAClxDFepAoA+P8AwvDneenFfnbdaac+Yzh/AHzvsP6RuQeg==</latexit><latexit sha1_base64="SVs4Ppr5xYUt4bgzNkXsuF7L3yw=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlsKzrlv0yt4UaJn4c1KsuLXvj5ujh2rX/ez0JEljKgzhWOu27yUmyLAyjHA6LnRSTRNMhrhP25YKHFMdZNNTx+jUKj0USWVLGDRVf09kONZ6FIe2M8ZmoBe9ifif105NdBlkTCSpoYLMFkUpR0aiyd+oxxQlho8swUQxeysiA6wwMTadgg3BX3x5mTTOy75X9ms2DQ9myMMxnEAJfLiAClxDFepAoA+P8AwvDneenFfnbdaac+Yzh/AHzvsP6RuQeg==</latexit><latexit sha1_base64="Q9Q3RlmsHuz9bAIr9Qt5YJQR75o=">AAAB6nicbVA9SwNBEJ2LXzF+RS1tFoMQm7Bno2XAxjKi+YDkCHubSbJkb+/Y3RPCkZ9gY6GIrb/Izn/jJrlCEx8MPN6bYWZemEhhLKXfXmFjc2t7p7hb2ts/ODwqH5+0TJxqjk0ey1h3QmZQCoVNK6zETqKRRaHEdji5nfvtJ9RGxOrRThMMIjZSYig4s056qIaX/XKF1ugCZJ34OalAjka//NUbxDyNUFkumTFdnyY2yJi2gkuclXqpwYTxCRth11HFIjRBtjh1Ri6cMiDDWLtSlizU3xMZi4yZRqHrjJgdm1VvLv7ndVM7vAkyoZLUouLLRcNUEhuT+d9kIDRyK6eOMK6Fu5XwMdOMW5dOyYXgr768TlpXNZ/W/HtaqdM8jiKcwTlUwYdrqMMdNKAJHEbwDK/w5knvxXv3PpatBS+fOYU/8D5/AIOGjTU=</latexit>(c)<latexit sha1_base64="a2Ke1LnYii/s9aZk8SGWv22R5+0=">AAAB6nicbVDLSgNBEOz1GeNr1aOXwSDES9j1oseAF48JmgckS5id9CZDZmeXmVkhLPkELx4U8eqH+A3e/As/wcnjoIkFDUVVN91dYSq4Np735aytb2xubRd2irt7+weH7tFxUyeZYthgiUhUO6QaBZfYMNwIbKcKaRwKbIWjm6nfekCleSLvzTjFIKYDySPOqLHSXZld9NySV/FmIKvEX5BS1a1/fwBAred+dvsJy2KUhgmqdcf3UhPkVBnOBE6K3UxjStmIDrBjqaQx6iCfnToh51bpkyhRtqQhM/X3RE5jrcdxaDtjaoZ62ZuK/3mdzETXQc5lmhmUbL4oygQxCZn+TfpcITNibAllittbCRtSRZmx6RRtCP7yy6ukeVnxvYpft2l4MEcBTuEMyuDDFVThFmrQAAYDeIRneHGE8+S8Om/z1jVnMXMCf+C8/wCk0o+H</latexit><latexit sha1_base64="Y05+glcJ37EcxNCCi42td7bLKjE=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlshZ1y16ZW8KtEz8OSlW3Nr3x83RQ7XrfnZ6kqQxFYZwrHXb9xITZFgZRjgdFzqppgkmQ9ynbUsFjqkOsumpY3RqlR6KpLIlDJqqvycyHGs9ikPbGWMz0IveRPzPa6cmugwyJpLUUEFmi6KUIyPR5G/UY4oSw0eWYKKYvRWRAVaYGJtOwYbgL768TBrnZd8r+zWbhgcz5OEYTqAEPlxABa6hCnUg0IdHeIYXhztPzqvzNmvNOfOZQ/gD5/0H6qCQew==</latexit><latexit sha1_base64="Y05+glcJ37EcxNCCi42td7bLKjE=">AAAB6nicbVC7SgNBFL0bXzG+Vu20GQxCbMKujZYBGwuLBM0DkiXMTmaTIbMzy8ysEJZ8gdhYKGLrn/gHdv6Fn+DkUWjigQuHc+7l3nvChDNtPO/Lya2srq1v5DcLW9s7u3vu/kFDy1QRWieSS9UKsaacCVo3zHDaShTFcchpMxxeTfzmPVWaSXFnRgkNYtwXLGIEGyvdlshZ1y16ZW8KtEz8OSlW3Nr3x83RQ7XrfnZ6kqQxFYZwrHXb9xITZFgZRjgdFzqppgkmQ9ynbUsFjqkOsumpY3RqlR6KpLIlDJqqvycyHGs9ikPbGWMz0IveRPzPa6cmugwyJpLUUEFmi6KUIyPR5G/UY4oSw0eWYKKYvRWRAVaYGJtOwYbgL768TBrnZd8r+zWbhgcz5OEYTqAEPlxABa6hCnUg0IdHeIYXhztPzqvzNmvNOfOZQ/gD5/0H6qCQew==</latexit><latexit sha1_base64="MAPWp0gE1a27E4Jf1OKQ5jsE+LQ=">AAAB6nicbVA9SwNBEJ2LXzF+RS1tFoMQm7Bno2XAxjKi+YDkCHubSbJkb+/Y3RPCkZ9gY6GIrb/Izn/jJrlCEx8MPN6bYWZemEhhLKXfXmFjc2t7p7hb2ts/ODwqH5+0TJxqjk0ey1h3QmZQCoVNK6zETqKRRaHEdji5nfvtJ9RGxOrRThMMIjZSYig4s056qPLLfrlCa3QBsk78nFQgR6Nf/uoNYp5GqCyXzJiuTxMbZExbwSXOSr3UYML4hI2w66hiEZogW5w6IxdOGZBhrF0pSxbq74mMRcZMo9B1RsyOzao3F//zuqkd3gSZUElqUfHlomEqiY3J/G8yEBq5lVNHGNfC3Ur4mGnGrUun5ELwV19eJ62rmk9r/j2t1GkeRxHO4Byq4MM11OEOGtAEDiN4hld486T34r17H8vWgpfPnMIfeJ8/hQuNNg==</latexit> Pre-defined Order Descriptions Left-to-right (L2R) Right-to-left (R2L) Generate words from left to right. (Wu et al., 2018) Generate words from right to left. (Wu et al., 2018) Odd-Even (ODD) Generate words at odd positions from left to right, then generate even positions. (Ford et al., 2018) Balanced-tree (BLT) Generate words with a top-down left-to-right order from a balanced binary tree. (Stern et al., 2019) Syntax-tree (SYN) Generate words with a top-down left-to-right order from the dependency tree. (Wang et al., 2018b) Common-First (CF) Generate all common words first from left to right, and then generate the others. (Ford et al., 2018) Rare-First (RF) Generate all rare words first from left to right, and then generate the remaining. (Ford et al., 2018) Random (RND) Generate words in a random order shuffled every time the example was loaded. Table 1: Descriptions of the pre-defined orders used in this work. Major references that have explored these generation orders with different models and applications are also marked. the predicted rt+1. Because updating the relative positions will not change the pre-computed relative- position representations, Transformer-InDIGO can reuse the previous hidden states in the next decod- ing step the same as the vanilla Transformer. 4.2 Learning Training requires maximizing the marginalized likelihood in Eq. (2). Yet this is intractable since we need to enumerate all of the T ! permutations of tokens. Instead, we maximize the evidence lower- bound (ELBO) of the original objective by intro- ducing an approximate posterior distribution of generation orders q(πx, y), which provides the probabilities of latent generation orders based on the ground-truth sequences x and y: LELBO = E log pθ(yπx) + H(q) π∼q T +1(cid:88) t=1 (cid:124) = + E r2:T +1∼q T(cid:88) t=1 (cid:124) log pθ(yt+1y0:t, r0:t, x1:T (cid:48)) Word Prediction Loss (cid:123)(cid:122) (cid:125)  + H(q), (cid:125) (cid:123)(cid:122) log pθ(rt+1y0:t+1, r0:t, x1:T (cid:48)) Position Prediction Loss (10) where π = r2:T +1, sampled from q(πx, y), is represented as relative positions. H(q) is the en- tropy term which can be ignored if q is fixed during training. Eq. (10) shows that given a sampled or- der, the learning objective is divided into word & position objectives. For calculating the position prediction loss, we aggregate the two probabilities corresponding to the same position by pθ(rt+1·) = ppointer(kl·) + ppointer(kr·), (11) where ppointer(kl·) and ppointer(kr·) are calculated simultaneously from the same softmax function in Eq. (9). kl, kr(kl (cid:54)= kr) represent the keys corre- sponding to the same relative position. Here, we study two types of q(πx, y): Pre-defined Order If we already possess some prior knowledge about the sequence, e.g., the L2R order is proven to be a strong baseline in many scenarios, we assume a Dirac-delta distribution q(πx, y) = δ(π = π∗(x, y)), where π∗(x, y)) is a predefined order. In this work, we study a set of pre-defined orders which can be found in Table. 1, for evaluating their effect on generation. Searched Adaptive Order (SAO) We choose the approximate posterior q as the point estima- tion that maximizes log pθ(yπx), which can also be seen as the maximum-a-posteriori (MAP) esti- mation on the latent order π. In practice, we ap- proximate these generation orders π through beam- search (Pal et al., 2006). Unlike the original beam- search for autoregressive decoding that searches in the sequence space to find the sequence maximiz- ing the probability shown in Eq. 1, we search in the space of all the permutations of the target sequence to find π maximising Eq. 2, as all the target tokens are known in advance during training. More specifically, we maintain B sub-sequences with the maximum probabilities using a set B at 0:t ∈ B, we each step t. For every sub-sequence y evaluate the probabilities of every possible choice from the remaining words y(cid:48) ∈ y \ y (b) 0:t and its position r(cid:48). We calculate the cumulative likelihood for each y(cid:48), r(cid:48), based on which we select top-B sub- sequences as the new set B for the next step. After obtaining the B generation orders, we optimize our objective as an average over these orders: (b) LSAO = 1 B log pθ(yπx) (12) (cid:88) π∈B where we assume q(πx, y) = (cid:26)1/B π ∈ B 0 otherwise . Beam Search with Dropout The goal of beam search is to approximately find the most likely generation orders, which limits learning from ex- ploring other generation orders that may not be favourable currently but may ultimately be deemed better. Prior research (Vijayakumar et al., 2016) also pointed out that the search space of the stan- dard beam-search is restricted. We encourage ex- ploration by injecting noise during beam search (Cho, 2016). Particularly, we found it effective to keep the dropout on (e.g., dropout = 0.1). Bootstrapping from a Pre-defined Order Dur- ing preliminary experiments, sequences returned by beam-search were often degenerated by always predicting common or functional words (e.g., "the", ",", etc.) as the first several tokens, leading to in- ferior performance. We conjecture that is due to the fact that the position prediction module learns much faster than the word prediction module, and it quickly captures spurious correlations induced by a poorly initialized model. It is essential to bal- ance the learning progress of these modules. To do so, we bootstrap learning by pre-training the model with a pre-defined order (e.g., L2R), before training with beam-searched orders. 4.3 Decoding As for decoding, we directly follow Algorithm 1 to sample or decode greedily from the proposed model. However, in practice beam-search is im- portant to explore the output space for neural au- toregressive models. In our implementation, we perform beam-search for InDIGO as a two-step search. Suppose the beam size B, at each step, we do beam-search for word prediction and then with the searched words, try out all possible positions and select the top-B sub-sequences. In preliminary experiments, we also tried doing beam-search for word and positions simultaneously with their joint probability. However, it did not seem helpful. 5 Experiments We evaluate InDIGO extensively on four challeng- ing sequence generation tasks: word order recov- ery, machine translation, natural language to code generation (NL2Code, Ling et al., 2016) and image captioning. We compare our model trained with the pre-defined orders and the adaptive orders obtained Dataset WMT16 Ro-En WMT18 En-Tr KFTT En-Ja Django MS-COCO Train 620k 207k 405k 16k 567k Dev 2000 3007 1166 1000 5000 Test Length 26.48 2000 25.81 3000 27.51 1160 1801 8.87 12.52 5000 Table 2: Dataset statistics for the machine transla- tion, code generation and image captioning tasks. Length represents the average number of tokens for target sentences of the training set. by beam-search. We use the same architecture for all orders including the standard L2R order. 5.1 Experimental Settings Dataset The machine translation experiments are conducted on three language pairs for studying how the decoding order influences the translation quality of languages with diversified characteris- tics: WMT'16 Romanian-English (Ro-En),2 WMT 18 English-Turkish (En-Tr)3 and KFTT English- Japanese (En-Ja, Neubig, 2011) 4 The English part of the Ro-En dataset is used for the word order recovery task. For the NL2Code task, We use the Django dataset (Oda et al., 2015)5 and the MS COCO (Lin et al., 2014) with the stan- dard split (Karpathy and Fei-Fei, 2015) for the NL2Code task and image captioning, respectively. The dataset statistics are shown in Table 2. Preprocessing We apply the Moses tokeniza- tion6 and normalization on all the text datasets ex- cept for codes. We perform 32, 000 joint BPE (Sen- nrich et al., 2016) operations for the MT datasets, while using all the unique words as the vocabulary for NL2Code. For image captioning, we follow the same procedure as described by Lee et al. (2018), where we use 49 512-dimensional image feature vectors (extracted from a pretrained ResNet-18 (He et al., 2016)) as the input to the Transformer en- coder. The image features are fixed during training. Models We set dmodel = 512, dhidden = 2048, nheads = 8, nlayers = 6, lrmax = 0.0005, warmup = 4000 and dropout = 0.1 throughout all the experiments. The source and target embed- ding matrices are shared except for En-Ja, as our 2 http://www.statmt.org/wmt16/translation-task.html 3 http://www.statmt.org/wmt18/translation-task.html 4http://www.phontron.com/kftt/. 5 https://github.com/odashi/ase15-django-dataset 6 https://github.com/moses-smt/mosesdecoder Order RND L2R R2L ODD BLT SYN CF RF SAO WMT16 Ro → En BLEU Ribes Meteor 41.00 20.20 52.19 31.82 52.09 31.62 30.11 50.68 45.67 24.38 50.25 29.62 50.71 30.25 30.23 50.72 53.00 32.47 79.35 83.37 83.18 83.09 81.70 82.65 83.22 83.29 84.10 TER 63.20 50.62 50.20 50.79 55.38 52.14 50.72 51.73 49.02 WMT18 En → Tr BLEU Ribes Meteor 19.12 03.04 33.90 14.85 33.33 14.38 13.64 32.48 27.40 08.72 55.45 69.20 68.87 68.85 65.70 -- 12.04 12.10 15.18 67.61 67.44 70.06 31.18 30.72 34.60 TER 90.60 71.56 71.91 72.84 77.76 74.75 73.40 71.56 KFTT En → Ja BLEU Ribes Meteor 35.24 17.09 48.57 30.87 47.91 30.44 28.59 46.28 40.23 21.50 70.89 77.72 77.95 77.01 73.97 -- 28.91 27.35 31.91 77.06 76.40 77.56 46.46 45.15 49.66 TER 70.11 59.92 61.09 60.12 64.39 61.56 62.14 59.80 Table 3: Results of translation experiments for three language pairs in different decoding orders. Scores are reported on the test set with four widely used evaluation metrics (BLEU↑, Meteor↑, TER↓ and Ribes↑). We do not report models trained with SYN order on En-Tr and En-Ja due to the lack of reliable dependency parsers. The statistical significance analysis6 between the outputs of SAO and L2R are conducted using BLEU score as the metric, and the p-values are ≤ 0.001 for all three language pairs. vocabulary cut-off so that the number of common words and the number of rare words are approxi- mately the same (Ford et al., 2018). We also con- sider on-the-fly sampling a random order for each sentence as the baseline (RND). When using L2R as the pre-defined order, Transformer-InDIGO is almost equivalent to the vanilla Transformer, as the position prediction simply learns to predict the next position as the left of the (cid:104)s(cid:105) symbol. The only dif- ference is that it enhances the vanilla Transformer with a small number of additional parameters for the position prediction. We also train Transformer-InDIGO using the searched adaptive order (SAO) where we set the beam size to 8. In default, models trained with SAO are bootstrapped from a slightly pre-trained (6,000 steps) model in L2R order. Inference During the test time, we do beam- search as described in Sec. 4.3. We observe from our preliminary experiments that models trained with different orders (either pre-defined or SAO) have very different optimal beam sizes for decod- ing. Therefore, we perform sensitivity studies, in which the beam sizes vary from 1 ∼ 20 and pick the beam size with the highest BLEU score on the validation set for each particular model. 5.2 Results and Analysis Word Order Recovery Word order recovery takes a bag of words as input and recovers its origi- nal word order, which is challenging as the search space is factorial. We do not restrict the vocabulary of the input words. We compare our model trained with the L2R order and eight searched adaptive Figure 3: The BLEU scores on the test set for word order recovery with various decoding beam sizes. preliminary experiments showed that keeping the embeddings not shared significantly improves the translation quality. Both the encoder and decoder use relative positions during self-attention except for the word order recovery experiments (where the position embedding is removed in the encoder, as there is no ground-truth position information in the input.) We do not introduce task-specific modules such as copying mechanism (Gu et al., 2016). Training When training with the pre-defined or- ders, we reorder words of each training sequence in advance accordingly which provides supervision of the ground-truth positions that each word should be inserted. We test the pre-defined orders listed in Table 1. The SYN orders were generated according to the dependency parse obtained by a dependency parse parser from Spacy (Honnibal and Montani, 2017) following a parent-to-children left-to-right order. The CF & RF orders are obtained based on 135791113151719decoding beam size2930313233L2RSAO Model L2R SAO Django MS-COCO BLEU Accuracy BLEU CIDEr-D 36.74 42.33 13.6% 22.12 16.3% 22.58 68.88 69.42 Table 4: Results on the official test sets for both code generation and image captioning tasks. Model Variants Baseline L2R SAO default dev 32.53 33.60 32.86 32.64 33.12 33.09 Stern et al. (2019) - Uniform 29.99 Stern et al. (2019) - Binary 32.27 no bootstrap no bootstrap, no noise bootstrap from R2L order bootstrap from SYN order test 31.82 32.47 31.88 31.72 32.02 31.93 28.52 30.66 Table 5: Ablation study for machine translation on WMT16 Ro-En. Results of Stern et al. (2019) are based on greedy decoding with the EOS penalty. orders (SAO) from beam search for word order re- covery. The BLEU scores over various beam sizes are shown in Figure 3. The model trained with SAO lead to higher BLEU scores over that trained with L2R with a gain up to 3 BLEU scores. Fur- thermore, increasing the beam size brings more im- provements for SAO compared to L2R, suggesting that InDIGO produces more diversified predictions so that it has higher chances to recover the order. Machine Translation As shown in Table 3, we compare our model trained with pre-defined orders and the searched adaptive orders (SAO) with vary- ing setups. We use four evaluation metrics includ- ing BLEU (Papineni et al., 2002), Ribes (Isozaki et al., 2010), Meteor (Banerjee and Lavie, 2005) and TER (Snover et al., 2006) to avoid using a single metric that might be in favor of a particu- lar generation order. Most of the pre-defined or- ders (except for the random order and the balanced tree (BLT) order) perform reasonably well with In- DIGO on the three language pairs. The best score with a predefined word ordering is reached by the L2R order among the pre-defined orders except for En-Ja, where the R2L order works slightly better according to Ribes. This indicates that in machine translation, the monotonic orders are reasonable and reflect the languages. ODD, CF and RF show Model L2R SAO (b = 1) SAO (b = 8) Training (b/s) Decoding (ms/s) 4.21 1.12 0.58 12.3 12.5 12.8 Table 6: Comparison of the L2R order with SAO on running time, where b/s is batches per second and ms/s is ms per sentence. All experiments are conducted on 8 Nvidia V100 GPUs with 2000 to- kens per GPU. We also compare beam sizes of 1 and 8 for SAO to search the best orders during training. We report the decoding speed of all three models based on greedy decoding. similar performance, which is below the L2R and R2L orders by around 2 BLEU scores. The tree- based orders, such as the SYN and BLT orders do not perform well, indicating that predicting words following a syntactic path is not preferable. On the other hand, Table 3 shows that the model with SAO achieves competitive and even statistically significant improvements over the L2R order. The improvements are larger for Turkish and Japanese, indicating that a flexible generation order may im- prove the translation quality for languages with different syntactic structures from English. Code Generation The goal of this task is to gen- erate Python code based on a natural language de- scription, which can be achieved by using a stan- dard sequence-to-sequence generation framework such as the proposed Transformer-InDIGO. As shown in Table 4, SAO works significantly better than the L2R order in terms of both BLEU and ac- curacy. This shows that flexible generation orders are more preferable in code generation. Image Captioning For the captioning task, one caption is generated per image and is compared against five human-created captions during testing. As show in Table 4, we observe that SAO obtains higher BLEU and CIDEr-D (Vedantam et al., 2015) compared to the L2R order, and it implies that better captions are generated with different orders. 5.3 Ablation Study Model Variants Table 5 shows the results of the ablation studies using the machine translation task. SAO without bootstrapping nor beam-search de- generates by approximate 1 BLEU score on Ro-En, demonstrating the effectiveness of these two meth- ods. We also test SAO by bootstrapping from a model trained with a R2L order as well as a SYN Figure 4: An instantiated concrete example of the decoding process using InDIGO sampled from the En-Ja translation datset. The final output is reordered based on the predicted relative-position matrix. order, which obtains slightly worse yet compara- ble results compared to bootstrapping from L2R. This suggests that the SAO algorithm is quite ro- bust with different bootstrapping methods, and L2R bootstrapping performs the best. In addition, we re-implement a recent work (Stern et al., 2019), which adopts a similar idea of generating sequences through insertion operations for machine transla- tion. We use the best settings of their algorithm, i.e., training with binary-tree/uniform slot-losses and slot-termination, while removing the knowl- edge distillation for a fair comparison with ours. Our model obtains better performance compared to Stern et al. (2019) on WMT16 Ro-En. Running Time As shown in Table 6, InDIGO decodes sentences as efficient as the standard L2R autoregressive models. However, it is slower in terms of training time using SAO as the supervi- sion, as additional efforts are needed to search the generation orders, and it is difficult to parallelize the SAO. SAO with beam sizes 1 and 8 are 3.8 and 7.2 times slower compared to L2R, respectively. Note that enlarging the beam size during training won't affect the decoding time as searching the best orders only happen in the training time. We will investigate off-line searching methods to speed up SAO training and make InDIGO more scalable in the future. 5.4 Visualization Relative-Position Matrix In Figure 4, we show an instantiated example produced by InDIGO, which is randomly sampled from the validation set [Input] there are many shrines nation@@ wide with the same name .[Ground Truth] (cid:1602)(cid:2229)(cid:3)(cid:1905)(cid:2248)(cid:3)(cid:897)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:3)(cid:900)(cid:3)(cid:5151)(cid:5138)(cid:3)(cid:866)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:822)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:3)(cid:900)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:3)(cid:900)(cid:3)(cid:5151)(cid:5138)(cid:31)(cid:86)(cid:33)(cid:3)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:822)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:3)(cid:900)(cid:3)(cid:5151)(cid:5138)(cid:3)(cid:901)[Output] (cid:31)(cid:86)(cid:33)(cid:3)(cid:1602)(cid:2229)(cid:3)(cid:897)(cid:3)(cid:1910)(cid:35)(cid:35)(cid:3)(cid:1911)(cid:3)(cid:900)(cid:3)(cid:5151)(cid:5138)(cid:3)(cid:901)(cid:3)(cid:2394)(cid:869)(cid:3)(cid:2562)(cid:2241)(cid:3)(cid:879)(cid:929)(cid:3)(cid:3)(cid:3)(cid:822)(cid:31)(cid:18)(cid:86)(cid:33)(cid:3)(cid:31)(cid:40)(cid:81)(cid:71)(cid:16)(cid:82)(cid:73)(cid:16)(cid:39)(cid:72)(cid:70)(cid:82)(cid:71)(cid:76)(cid:81)(cid:74)(cid:33)(cid:17) Figure 5: Examples randomly sampled from three tasks that are instructed to decode using InDIGO with various learned generation order. Words in red and underlined are the inserted token at each step. For visually convenience, we reordered all the partial sequences to its correct positions at each decoding step. WMT16 Ro-En[source] acestia dezvaluie secre@@ tele pant@@ om@@ im@@ ei lor la bbc break@@ fast .[target] they reveal their pan@@ to secre@@ ts to bbc break@@ fast . -- InDIGO learned from Pre-defined R2L Order.fast .break@@ fast .bbc break@@ fast .the bbc break@@ fast .at the bbc break@@ fast .ts at the bbc break@@ fast .secre@@ ts at the bbc break@@ fast .their secre@@ ts at the bbc break@@ fast .reveal their secre@@ ts at the bbc break@@ fast .they reveal their secre@@ ts at the bbc break@@ fast .they reveal the secre@@ ts of their sho@@ esthey reveal the secre@@ ts of their sho@@ es to they reveal the secre@@ ts of their sho@@ es to the they reveal the secre@@ ts of their sho@@ es to the bbc they reveal the secre@@ ts of their sho@@ es to the bbc break@@ they reveal the secre@@ ts of their sho@@ es to the bbc break@@ fastthey reveal the secre@@ ts of their sho@@ es to the bbc break@@ fast . -- InDIGO learned from Pre-defined L2R Ordertheythey reveal they reveal the they reveal the secre@@ they reveal the secre@@ ts they reveal the secre@@ ts ofthey reveal the secre@@ ts of theirthey reveal the secre@@ ts of their sho@@ -- InDIGO learned from Pre-defined SYN Orderrevealthey revealthey reveal secre@@they reveal secre@@ tsthey reveal secre@@ ts .they reveal the secre@@ ts .they reveal the secre@@ ts of .they reveal the secre@@ ts of sho@@ .they reveal the secre@@ ts of sho@@ e .they reveal the secre@@ ts of their sho@@ e .they reveal the secre@@ ts of their sho@@ e in .they reveal the secre@@ ts of their sho@@ e in break@@ .they reveal the secre@@ ts of their sho@@ e in break@@ fast .they reveal the secre@@ ts of their sho@@ e in bbc break@@ fast . -- InDIGO learned from Searched Adaptive Order (SAO).the .the bbc .the bbc break@@ .the bbc break@@ fast .they the bbc break@@ fast .they the the bbc break@@ fast .they the secre@@ the bbc break@@ fast .they the secre@@ ts the bbc break@@ fast .they the secre@@ ts of the bbc break@@ fast .they the secre@@ ts of their the bbc break@@ fast .they the secre@@ ts of their sho@@ the bbc break@@ fast .they the secre@@ ts of their sho@@ e the bbc break@@ fast .they the secre@@ ts of their sho@@ e at the bbc break@@ fast .they reveal the secre@@ ts of their sho@@ e at the bbc break@@ fast . -- InDIGO learned from Pre-defined RF Orderrevealreveal secrecyreveal secrecy sho@@reveal secrecy sho@@ esreveal secrecy sho@@ es bbcreveal secrecy sho@@ es bbc break@@reveal secrecy sho@@ es bbc break@@ fastthey reveal secrecy sho@@ es bbc break@@ fastthey reveal the secrecy sho@@ es bbc break@@ fast they reveal the secrecy of sho@@ es bbc break@@ fast they reveal the secrecy of their sho@@ es bbc break@@ fast they reveal the secrecy of their sho@@ es at bbc break@@ fast they reveal the secrecy of their sho@@ es at the bbc break@@ fastthey reveal the secrecy of their sho@@ es at the bbc break@@ fast .[caption-1] a tall woman is standing in a small kitchen[caption-2] a girl is standing in a kitchen with a mug in her hands .[caption-3] woman in knitted jump pants and yellow slee@@ v@@ eless top , in kitchen scene with matching yellow tone area .[caption-4] a woman standing in a kitchen near a refrigerator and a stove[caption-5] a woman with pi@@ g@@ tails is standing in a kitchen . -- InDIGO learned from Pre-defined L2R Ordera a man a man standinga man standing ina man standing in aa man standing in a kitchen a man standing in a kitchen holdinga man standing in a kitchen holding aa man standing in a kitchen holding a bananaa man standing in a kitchen holding a banana . -- InDIGO learned from Searched Adaptive Order (SAO)a a woman a woman standinga woman standing in a woman standing in fronta woman standing in front ofa woman standing in front of aa woman standing in front of a refrigeratora woman standing in front of a refrigerator .a woman in standing in front of a refrigerator .a woman in a standing in front of a refrigerator .a woman in a kitchen standing in front of a refrigerator .MS-COCO[source instruction] if tok starts with _STR:0_ ,[target Python code] if tok . startswith ( ' _STR:0_ ' ) : -- InDIGO learned from Searched Adaptive Order (SAO)if if parserif parser .if parser . (if parser . ( 'if parser . ( ' ' if parser . ( ' ' )if parser . ( ' ' ) :Djangoif parser . ( ' _STR:0_ ' ) :if parser . startswith ( ' _STR:0_ ' ) : of the KFTT En-Ja dataset. The relative-position matrices (Rt) and their corresponding absolute po- sitions (zt) are shown at each step. We argue that relative-position matrices are flexible to encode po- sition information, and its append-only property enables InDIGO to reuse previous hidden states. Case Study We demonstrate how InDIGO works by uniformly sampling examples from the valida- tion sets for machine translation (Ro-En), image captioning and code generation. As shown in Fig- ure 5, the proposed model generates sequences in different orders based on the order used for learn- ing (either pre-defined or SAO). For instance, the model generates tokens approximately following the dependency parse wheb we used the SYN order for the machine translation task. On the other hand, the model trained using the RF order learns to first produce verbs and nouns first, before filling up the sequence with remaining functional words. We observe several key characteristics about the inferred orders of SAO by analyzing the model's output for each task: (1) For machine translation, the generation order of an output sequence does not deviate too much from L2R. Instead, the sequences are shuffled with chunks, and words within each chunk are generated in a L2R order; (2) In the examples of image captioning and code generation, the model tends to generate most of the words in the L2R order and insert a few words afterward in certain locations. Moreover, we provide more examples in the appendix. 6 Related Work Decoding for Neural Models Neural autoregres- sive modelling has become one of the most success- ful approaches for generating sequences (Sutskever et al., 2011; Mikolov, 2012), which has been widely used in a range of applications, such as machine translation (Sutskever et al., 2014), dialogue re- sponse generation (Vinyals and Le, 2015), im- age captioning (Karpathy and Fei-Fei, 2015) and speech recognition (Chorowski et al., 2015). An- other stream of work focuses on generating a se- quence of tokens in a non-autoregressive fashion (Gu et al., 2018; Lee et al., 2018; van den Oord et al., 2018), in which the discrete tokens are gen- erated in parallel. Semi-autoregressive modelling (Stern et al., 2018; Wang et al., 2018a) is a mix- ture of the two approaches, while largely adhering to left-to-right generation. Our method is differ- ent from these approaches as we support flexible generation orders, while decoding autoregressively. Non-L2R Orders Previous studies on genera- tion order of sequences mostly resort to a fixed set of generation orders. Wu et al. (2018) empir- ically show that R2L generation outperforms its L2R counterpart in a few tasks. Ford et al. (2018) devises a two-pass approach that produces partially- filled sentence "templates" and then fills in missing tokens. Zhu et al. (2019) also proposes to generate tokens by first predicting a text template and infill the sentence afterwards while in a more general way. Mehri and Sigal (2018) proposes a middle- out decoder that firstly predicts a middle-word and simultaneously expands the sequence in both direc- tions afterwards. Previous studies also focused on decoding in a bidirectional fashion such as (Sun et al., 2017; Zhou et al., 2019a,b). Another line of work models sequence generation based on syn- tax structures (Yamada and Knight, 2001; Char- niak et al., 2003; Chiang, 2005; Emami and Je- linek, 2005; Zhang et al., 2016; Dyer et al., 2016; Aharoni and Goldberg, 2017; Wang et al., 2018b; Eriguchi et al., 2017). In contrast, Transformer- InDIGO supports fully flexible generation orders during decoding. There are two concurrent work (Welleck et al., 2019; Stern et al., 2019), which study sequence gen- eration in a non-L2R order. Welleck et al. (2019) propose a tree-like generation algorithm. Unlike this work, the tree-based generation order only pro- duces a subset of all possible generation orders compared to our insertion-based models. Further, Welleck et al. (2019) find L2R is superior to their learned orders on machine translation tasks, while transformer-InDIGO with searched adaptive orders achieves better performance. Stern et al. (2019) propose a very similar idea of using insertion oper- ations in Transformer for machine translation. The major difference is that they directly use absolute positions, while ours utilizes relative positions. As a result, their model needs to re-encode the partial sequence at every step, which is computationally more expensive. In contrast, our approach does not necessitate re-encoding the entire sentence during generation. In addition, knowledge distillation was necessary to achieve good performance in Stern et al. (2019), while our model is able to match the performance of L2R even without bootstrapping. 7 Conclusion We have presented a novel approach -- InDIGO -- which supports flexible sequence generation. Our model was trained with either pre-defined orders or searched adaptive orders. In contrast to conven- tional neural autoregressive models which often generate from left to right, our model can flexibly generate a sequence following an arbitrary order. Experiments show that our method achieved com- petitive or even better performance compared to the conventional left-to-right generation on four tasks, including machine translation, word order recovery, code generation and image captioning. For future work, it is worth exploring a trainable inference model to directly predict the permuta- tion (Mena et al., 2018) instead of beam-search. Also, the proposed InDIGO could be extended for post-editing tasks such as automatic post-editing for machine translation (APE) and grammatical error correction (GEC) by introducing additional operations such as "deletion" and "substitution". Acknowledgement We specially thank our action editor Alexandra Birch and all the reviewers for their great efforts to review the draft. We also would like to thank Douwe Kiela, Marc'Aurelio Ranzato, Jake Zhao and our colleagues at FAIR for the valuable feed- back, discussions and technical assistance. This work was partly supported by Samsung Advanced Institute of Technology (Next Generation Deep Learning: from pattern recognition to AI) and Sam- sung Electronics (Improving Deep Learning using Latent Structure). KC thanks for the support of eBay and Nvidia. References Roee Aharoni and Yoav Goldberg. 2017. Towards string-to-tree neural machine translation. In Pro- ceedings of the 55th Annual Meeting of the Asso- ciation for Computational Linguistics (Volume 2: Short Papers), volume 2, pages 132 -- 140. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Represen- tations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. Satanjeev Banerjee and Alon Lavie. 2005. Meteor: An automatic metric for mt evaluation with im- proved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pages 65 -- 72. Eugene Charniak, Kevin Knight, and Kenji Ya- mada. 2003. Syntax-based language models for statistical machine translation. In In MT Summit IX. Intl. Assoc. for Machine Translation. Cite- seer. David Chiang. 2005. A hierarchical phrase-based model for statistical machine translation. In Pro- ceedings of the 43rd Annual Meeting on Associ- ation for Computational Linguistics, pages 263 -- 270. Association for Computational Linguistics. Kyunghyun Cho. 2016. Noisy parallel approx- imate decoding for conditional recurrent lan- guage model. arXiv preprint arXiv:1605.03835. Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. 2015. Attention-based models for speech recog- nition. In NIPS, pages 577 -- 585. Chris Dyer, Adhiguna Kuncoro, Miguel Balles- teros, and Noah A. Smith. 2016. Recurrent In NAACL HLT neural network grammars. 2016, The 2016 Conference of the North Amer- ican Chapter of the Association for Computa- tional Linguistics: Human Language Technolo- gies, San Diego California, USA, June 12-17, 2016, pages 199 -- 209. Ahmad Emami and Frederick Jelinek. 2005. A neu- ral syntactic language model. Machine learning, 60(1-3):195 -- 227. Akiko Eriguchi, Yoshimasa Tsuruoka, and Kyunghyun Cho. 2017. Learning to parse and translate improves neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 2: Short Papers, pages 72 -- 78. Nicolas Ford, Daniel Duckworth, Mohammad Norouzi, and George E. Dahl. 2018. The impor- tance of generation order in language modeling. In Proceedings of the 2018 Conference on Empir- ical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 2942 -- 2946. European conference on computer vision, pages 740 -- 755. Springer. Jiatao Gu, James Bradbury, Caiming Xiong, Vic- tor O.K. Li, and Richard Socher. 2018. Non- autoregressive neural machine translation. In 6th International Conference on Learning Represen- tations, ICLR 2018, Vancouver, Canada, April 30-May 3, 2018, Conference Track Proceedings. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. 2016. Incorporating copying mecha- nism in sequence-to-sequence learning. In Pro- ceedings of the 54th Annual Meeting of the As- sociation for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Vol- ume 1: Long Papers. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In Proceedings of the IEEE confer- ence on computer vision and pattern recognition, pages 770 -- 778. Matthew Honnibal and Ines Montani. 2017. spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing. To appear. Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Kat- suhito Sudoh, and Hajime Tsukada. 2010. Auto- matic evaluation of translation quality for distant language pairs. In Proceedings of the 2010 Con- ference on Empirical Methods in Natural Lan- guage Processing, pages 944 -- 952. Association for Computational Linguistics. Andrej Karpathy and Li Fei-Fei. 2015. Deep visual-semantic alignments for generating image descriptions. In Proceedings of the IEEE confer- ence on computer vision and pattern recognition, pages 3128 -- 3137. Jason Lee, Elman Mansimov, and Kyunghyun Cho. 2018. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empir- ical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 1173 -- 1182. Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Pi- otr Doll´ar, and C Lawrence Zitnick. 2014. Mi- crosoft coco: Common objects in context. In Wang Ling, Phil Blunsom, Edward Grefenstette, Karl Moritz Hermann, Tom´as Kocisk´y, Fumin Wang, and Andrew W. Senior. 2016. Latent pre- dictor networks for code generation. In Proceed- ings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Shikib Mehri and Leonid Sigal. 2018. Middle- out decoding. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural In- formation Processing Systems 31, pages 5523 -- 5534. Curran Associates, Inc. Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. 2018. Learning latent permu- tations with gumbel-sinkhorn networks. In 6th International Conference on Learning Represen- tations, ICLR 2018, Vancouver, Canada, April 30-May 3, 2018, Conference Track Proceedings. Tom´as Mikolov. 2012. Statistical language mod- els based on neural networks. Presentation at Google, Mountain View, 2nd April. Graham Neubig. 2011. The Kyoto free translation task. http://www.phontron.com/kftt. Yusuke Oda, Hiroyuki Fudaba, Graham Neubig, Hideaki Hata, Sakriani Sakti, Tomoki Toda, and Satoshi Nakamura. 2015. Learning to generate pseudo-code from source code using statistical machine translation. In Proceedings of the 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), ASE '15, pages 574 -- 584, Lincoln, Nebraska, USA. IEEE Computer Society. Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, Norman Casagrande, Dominik Grewe, Seb Noury, Sander Dieleman, Erich Elsen, Nal Kalchbrenner, Heiga Zen, Alex Graves, Helen King, Tom Walters, Dan Belov, and Demis Hass- abis. 2018. Parallel WaveNet: Fast high-fidelity In Proceedings of the 35th speech synthesis. International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 3918 -- 3926, Stockholmsmssan, Stockholm Sweden. PMLR. Chris Pal, Charles Sutton, and Andrew McCallum. 2006. Sparse forward-backward using minimum divergence beams for fast training of conditional In Acoustics, Speech and Sig- random fields. nal Processing, 2006. ICASSP 2006 Proceed- ings. 2006 IEEE International Conference on, volume 5, pages V -- V. IEEE. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for au- tomatic evaluation of machine translation. In Proceedings of the 40th annual meeting on as- sociation for computational linguistics, pages 311 -- 318. Association for Computational Lin- guistics. Alexander M. Rush, Sumit Chopra, and Jason We- ston. 2015. A neural attention model for abstrac- tive sentence summarization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 379 -- 389, Lisbon, Portugal. Association for Computational Linguistics. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Com- putational Linguistics (Volume 1: Long Papers), pages 1715 -- 1725, Berlin, Germany. Association for Computational Linguistics. Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position repre- sentations. In Proceedings of the 2018 Confer- ence of the North American Chapter of the Asso- ciation for Computational Linguistics: Human Language Technologies, Volume 2 (Short Pa- pers), pages 464 -- 468, New Orleans, Louisiana. Association for Computational Linguistics. Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. 2006. A study of translation edit rate with targeted human annotation. In In Proceedings of Association for Machine Translation in the Americas, pages 223 -- 231. Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. 2019. Insertion transformer: Flexible sequence generation via insertion oper- ations. arXiv preprint arXiv:1902.03249. Mitchell Stern, Noam Shazeer, and Jakob Uszkor- eit. 2018. Blockwise parallel decoding for deep autoregressive models. In Advances in Neural Information Processing Systems, pages 10107 -- 10116. Qing Sun, Stefan Lee, and Dhruv Batra. 2017. Bidi- rectional beam search: Forward-backward infer- ence in neural sequence models for fill-in-the- blank image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pat- tern Recognition, pages 6961 -- 6969. Ilya Sutskever, James Martens, and Geoffrey E Hinton. 2011. Generating text with recurrent In Proceedings of the 28th neural networks. International Conference on Machine Learning (ICML-11), pages 1017 -- 1024. Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014. Sequence to sequence learning with neu- ral networks. In Advances in Neural Informa- tion Processing Systems 27: Annual Confer- ence on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 3104 -- 3112. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. At- tention is all you need. In Proceedings of the Annual Conference on Neural Information Pro- cessing Systems (NIPS). Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. 2015. Cider: Consensus-based im- age description evaluation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4566 -- 4575. Ashwin K Vijayakumar, Michael Cogswell, Ram- prasath R Selvaraju, Qing Sun, Stefan Lee, David Crandall, and Dhruv Batra. 2016. Di- verse beam search: Decoding diverse solutions from neural sequence models. arXiv preprint arXiv:1610.02424. Oriol Vinyals, Samy Bengio, and Manjunath Kud- lur. 2016. Order matters: Sequence to sequence In 4th International Conference on for sets. Learning Representations, ICLR 2016, San Juan, Xingxing Zhang, Liang Lu, and Mirella Lapata. 2016. Top-down tree long short-term memory networks. In Proceedings of the 2016 Confer- ence of the North American Chapter of the As- sociation for Computational Linguistics: Hu- man Language Technologies, pages 310 -- 320, San Diego, California. Association for Compu- tational Linguistics. Long Zhou, Jiajun Zhang, and Chengqing Zong. 2019a. Synchronous bidirectional neural ma- chine translation. Transactions of the Associa- tion for Computational Linguistics, 7:91 -- 105. Long Zhou, Jiajun Zhang, Chengqing Zong, and Heng Yu. 2019b. Sequence generation: From both sides to the middle. IJCAI. Wanrong Zhu, Zhiting Hu, and Eric Xing. arXiv e-prints, page 2019. Text Infilling. arXiv:1901.00158. Puerto Rico, May 2-4, 2016, Conference Track Proceedings. Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. 2015. Pointer networks. In Advances in Neural Information Processing Systems, pages 2692 -- 2700. Oriol Vinyals and Quoc Le. 2015. ral conversational model. arXiv:1506.05869. A neu- arXiv preprint Chunqi Wang, Ji Zhang, and Haiqing Chen. 2018a. Semi-autoregressive neural machine translation. In Proceedings of the 2018 Conference on Empir- ical Methods in Natural Language Processing, pages 479 -- 488, Brussels, Belgium. Association for Computational Linguistics. Xinyi Wang, Hieu Pham, Pengcheng Yin, and Gra- ham Neubig. 2018b. A tree-based decoder for neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4772 -- 4777, Brussels, Belgium. Association for Computa- tional Linguistics. Sean Welleck, Kiant´e Brantley, Hal Daum´e III, and Kyunghyun Cho. 2019. Non-monotonic arXiv preprint sequential arXiv:1902.02192. text generation. Lijun Wu, Xu Tan, Di He, Fei Tian, Tao Qin, Jian- huang Lai, and Tie-Yan Liu. 2018. Beyond er- ror propagation in neural machine translation: Characteristics of language also matter. In Pro- ceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3602 -- 3611, Brussels, Belgium. Association for Computational Linguistics. Kenji Yamada and Kevin Knight. 2001. A syntax- based statistical translation model. In Proceed- ings of the 39th Annual Meeting of the Associa- tion for Computational Linguistics. Pengcheng Yin and Graham Neubig. 2017. A syn- tactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 440 -- 450, Vancouver, Canada. Association for Com- putational Linguistics.
1906.08003
1
1906
2019-06-19T09:56:34
Code-Switching Detection Using ASR-Generated Language Posteriors
[ "cs.CL", "cs.SD", "eess.AS" ]
Code-switching (CS) detection refers to the automatic detection of language switches in code-mixed utterances. This task can be achieved by using a CS automatic speech recognition (ASR) system that can handle such language switches. In our previous work, we have investigated the code-switching detection performance of the Frisian-Dutch CS ASR system by using the time alignment of the most likely hypothesis and found that this technique suffers from over-switching due to numerous very short spurious language switches. In this paper, we propose a novel method for CS detection aiming to remedy this shortcoming by using the language posteriors which are the sum of the frame-level posteriors of phones belonging to the same language. The CS ASR-generated language posteriors contain more complete language-specific information on frame level compared to the time alignment of the ASR output. Hence, it is expected to yield more accurate and robust CS detection. The CS detection experiments demonstrate that the proposed language posterior-based approach provides higher detection accuracy than the baseline system in terms of equal error rate. Moreover, a detailed CS detection error analysis reveals that using language posteriors reduces the false alarms and results in more robust CS detection.
cs.CL
cs
Code-Switching Detection Using ASR-Generated Language Posteriors Qinyi Wang, Emre Yılmaz, Adem Derinel, Haizhou Li Dept. of Electrical and Computer Engineering, National University of Singapore, Singapore [email protected] 9 1 0 2 n u J 9 1 ] L C . s c [ 1 v 3 0 0 8 0 . 6 0 9 1 : v i X r a Abstract Code-switching (CS) detection refers to the automatic detection of language switches in code-mixed utterances. This task can be achieved by using a CS automatic speech recognition (ASR) system that can handle such language switches. In our previous work, we have investigated the code-switching detection perfor- mance of the Frisian-Dutch CS ASR system by using the time alignment of the most likely hypothesis and found that this tech- nique suffers from over-switching due to numerous very short spurious language switches. In this paper, we propose a novel method for CS detection aiming to remedy this shortcoming by using the language posteriors which are the sum of the frame- level posteriors of phones belonging to the same language. The CS ASR-generated language posteriors contain more complete language-specific information on frame level compared to the time alignment of the ASR output. Hence, it is expected to yield more accurate and robust CS detection. The CS detection exper- iments demonstrate that the proposed language posterior-based approach provides higher detection accuracy than the baseline system in terms of equal error rate. Moreover, a detailed CS detection error analysis reveals that using language posteriors reduces the false alarms and results in more robust CS detec- tion. Index Terms: code-switching detection, language posteriors, automatic speech recognition, language switches, multilingual- ism 1. Introduction Code-switching (CS), the alternating use of two or more lan- guages in a single conversation, is a common phenomenon in multilingual communities. There is increasing research inter- est in developing CS automatic speech recognition (ASR) sys- tems [1 -- 14] as most of the off-the-shelf systems are monolin- gual and cannot handle code-switched speech. Our previous re- search has focused on developing an all-in-one CS ASR system using a Frisian-Dutch bilingual acoustic and language model that allows language switches [11, 15]. Performing CS detection on a code-switched speech can automatically determine the points of code-switching and lan- guage identities of words in the code-switched utterances which can eventually be used for speech recognition tasks, such as spoken term detection and improving the CS ASR perfor- mance. Among two main types of code-switching, namely inter-sentential (which occurs between sentences) and intra- sentential (which occurs within a single sentence) [16], the de- tection of the latter is more challenging due to shorter duration between the CS points. Despite considerable research effort on language recogni- tion (LR) and diarization, there is little previous work available on CS detection [15, 17 -- 20]. It is worth mentioning that the CS detection task is more challenging than the standard LR ex- perimental setting due to: (1) considerably shorter monolingual segment duration (i.e., intra-sentential CS durations can be as short as a few seconds) and (2) uncertainty over the language boundaries. One previous work on detecting language switches uses multiple monolingual ASR systems in parallel and assigns lan- guage identities to words with the language of the system with highest likelihood score [20]. In our earlier work, we have de- scribed a CS detection technique which uses a Frisian-Dutch CS ASR system to recognize the most likely transcription of each utterance and detect language switches based on the time alignment of the ASR output [15]. In our latest work, we have investigated this code-switching detection performance using data-augmented CS ASR systems and observed that this technique suffers from over-switching due to numerous very short spurious language switches [21]. To cope with shortcoming, this paper introduces a new method for code-switching detection which uses frame-level language posteriors which are created using a CS ASR system. This technique extracts a posterior probability for each language by summing the phone posteriors belonging to the same language. A frame-level decision is then made by choosing the language with the highest language posterior. We present CS detection results on the FAME! corpus [22] using various detection systems including (1) the baseline sys- tem relying on the time alignment of the ASR output, (2) an intermediate system which makes a decision based on the maxi- mum phone posteriors, and (3) the proposed language posterior- based technique. After reporting the detection performance, an analysis of the hypothesized CS by each technique is pro- vided by reporting the total number of hypothesized language switches and duration distribution of the monolingual segments to provide further insight into the quality of the hypothesized language switches. The proposed technique has not only given lower equal error rates but also hypothesized language switches that most closely resembles the human annotations compared to the baseline CS detection technique. The rest of the paper is organized as follows. Section 3 details the baseline and proposed CS detection techniques and Section 4 summarizes the experimental setup and implementa- tion details. Section 5 presents and discusses the CS detection results and analyses before the conclusion given in Section 6. 2. Frisian-Dutch Radio Broadcast Database West Frisian is one of the three Frisian languages (together with East and North Frisian spoken in Germany) and it has approx- imately half a million speakers mostly living in the province Fryslan located in the northwest of the Netherlands. The native speakers of West Frisian (Frisian henceforth) are mostly bilin- gual and often code-switch in daily conversations due to the extensive influence of the Dutch language [23]. The bilingual FAME! speech database has been collected in the scope of the Frisian Audio Mining Enterprise project and contains radio broadcasts in Frisian and Dutch from the archive of the regional public broadcaster Omrop Fryslan (Frisian Broadcast Organization). This bilingual data contains Frisian- only and Dutch-only utterances as well as mixed utterances with inter-sentential, intra-sentential and intra-word CS. These recordings include language switching cases and speaker diver- sity, and have a large time span (1966 -- 2015). The longitudinal and bilingual nature of the material enables to perform research into language variation in Frisian over years, formal versus in- formal speech, language change across the life-span, dialec- tology, code-switching trends, speaker tracking and diarization over a large time period. For further details, we refer the reader to [22]. 3. CS detection techniques The code-switching detection task involves detection of lan- guage boundaries (switching points) and identification of the language identity of preceding and following subsegments in a code-switched utterance. The following subsections details the baseline CS detection technique which uses the time alignment of the most likely ASR hypothesis and the techniques relying on phone and language posteriors. 3.1. Baseline approach: time alignment of CS ASR output One way of obtaining frame-level language labels hypothesized by a CS ASR is to align the most likely hypothesis and as- sign each frame language labels using language tags appended to the words. CS ASR employs a bilingual acoustic model that captures the phonetic characteristics of both languages and a bilingual language model (LM) which can assign prob- abilities to code-mixed word sequences as well as monolin- gual word sequences from both languages. The current sys- tem uses data-augmented models described in [24]. The acous- tic model is trained on automatically transcribed data from the same archive and a large amount of monolingual data from the high-resourced language (Dutch) together with the manually transcribed data form the FAME! corpus. Moreover, we have created CS text, which is almost nonexistent, in multiple ways providing perplexity reductions on the development and test set transcriptions. The data-augmented models have been shown to provide better CS detection in terms of equal error rate, but have the tendency to hypothesize much more language switches compared to the human annotations [21]. 3.2. Proposed approach: language posteriors Rather than relying on the most likely hypothesis, code- switching detection can also be achieved at frame level using the phone posteriors. Each phone having a language tag, the phones tagged with the same language are further summed to obtain a posterior probability for each language. The CS ASR- generated language posteriors contain more complete language- specific information at frame level than the time alignment of the most likely hypothesis. Therefore, using language poste- riors for CS detection is expected to yield more accurate and robust CS detection. The silences are considered as a third class as they do not belong to any language. To reduce the confusion of acoustically similar phones in both languages, a phone LM is incorporated during the phone posterior extraction. The language decision per frame is made in two ways based on: (1) the language tag of the phone with the highest poste- rior and (2) the highest language posterior. Figure 1 illustrates an example of phone posteriors for a code-switched utterance with the corresponding language decision based on the maxi- (a) Phone posteriors (b) Language posteriors Figure 1: Phone posteriors of a code-switched utterance and the corresponding language posteriors obtained by summing all same-language phone posteriors mum phone and language posteriors. The CS detection based on the maximum phone posterior is more susceptible to uncer- tainty between phones than the maximum language posterior as it can be seen from the example. Summing the posterior probabilities assigned to all phones of a language yields a more reliable evidence for the language identity resulting in a more robust CS detection. 4. Experimental Setup 4.1. Speech and text data The training data of the FAME! speech corpus comprises 8.5 hours and 3 hours of speech from Frisian and Dutch speakers respectively. The development and test sets consist of 1 hour of speech from Frisian speakers and 20 minutes of speech from Dutch speakers each. All speech data has a sampling frequency of 16 kHz. The amount of automatically annotated speech data extracted from the target broadcast archive is 125.5 hours. Monolingual Dutch speech data comprises the complete Dutch and Flemish (language variety spoken in Belgium) com- ponents of the Spoken Dutch Corpus (CGN) [25] that con- tains diverse speech material including conversations, inter- views, lectures, debates, read speech and broadcast news. This corpus contains 442.5 and 307.5 hours of Dutch and Flemish Table 1: EER (%) provided by different CS detection systems on the development and test data CS Detection System Development Baseline [21] Phone posterior Language posterior 9.7 9.2 8.7 Test 6.3 5.2 4.8 In this version of the CS ASR system, we have updated the spelling of certain Frisian words in the text corpora, pronunci- ation lexicon and transcriptions according to the latest spelling rules proposed in 2016 by Fryske Akademy, which is the main difference compared to the previous system in [24]. The pho- netic transcriptions of the words that do not appear in the initial lexicons are learned by applying grapheme-to-phoneme (G2P) bootstrapping [30, 31]. The lexicon learning is carried out only for the words that appear in the training data using the G2P model learned on the corresponding language. We use the Phonetisaurus G2P system [32] for creating phonetic transcrip- tions. This CS ASR system provided a word error rate of 24.9% and 23.0% on the development and test set of the FAME! speech corpus, respectively. 4.3. CS detection experiments For the baseline CS detection system, we trained a monolin- gual Frisian and Dutch LM, and interpolated between them with varying weights. This effectively varies the prior for the de- tected language. The most likely hypothesis is obtained for each utterance using each interpolated LM and its time align- ment on phone level is stored in a .ctm format. By comparing these alignments with the ground truth word-level alignments (obtained by applying forced alignment using the recognizer), a duration-based CS detection accuracy metric has been calcu- lated. The missed Frisian (Dutch) time is calculated as the ra- tio of total duration of frames with Frisian (Dutch) tag in the reference alignment which is aligned to frames without Frisian (Dutch) tag to the total number of frames with Frisian (Dutch) tag in the reference alignment. The same procedure is followed for the approaches using phone and language posteriors, except the use of interpolated phone LMs with varying weights for manipulating the language priors. After extracting the phone posteriors for each utterance using different phone LMs, a language label is assigned to each frame based on the maximum phone or language posteriors. These frame-level language labels are stacked in a vector for each utterance and later converted to a .ctm file which marks the start times and durations of each monolingual segment. The same duration-based metric is used to evaluate the CS detection accuracy. The CS detection accuracy is evaluated by reporting the equal error rates (EER) calculated based on the detection error tradeoff (DET) graph [33] plotted for visualizing the CS detec- tion performance. In previous work, we have observed that this duration-based CS detection metric penalizes very short erro- neous language switches less compared to incorrect language tags assigned over longer segments which gives a better indica- tion of the general language recognition capability of the corre- sponding ASR system. Therefore, we further analyze the num- ber of hypothesized language switches and duration distribution of the monolingual segments to gain insight about the CS detec- tion behavior of each system. Figure 2: Performance of code-switching detection systems im- plemented with different methods on FAME! development and test data data respectively. The bilingual text corpus used for LM training contains 107.3M words in total (monolingual Frisian text with 37M words, monolingual Dutch text with 8.8M Dutch words and automatically generated CS text with 61.5M words). Almost all Frisian text is extracted from monolingual resources such as Frisian novels, news articles, Wikipedia articles. The Dutch text is extracted from the transcriptions of the CGN speech cor- pus which has been found to be very effective for LM training compared to other text extracted from written sources. The tran- scriptions of the FAME! training data is the only source of CS text and contains 140k words. The remaining CS text is auto- matically generated as described in [24]. 4.2. Implementation details The CS ASR system used in these experiments is trained us- ing the Kaldi ASR toolkit [26]. We train a conventional con- text dependent Gaussian mixture model-hidden Markov model (GMM-HMM) system with 40k Gaussians using 39 dimen- sional mel-frequency cepstral coefficient (MFCC) features in- cluding the deltas and delta-deltas to obtain the alignments for training a lattice-free maximum mutual information (LF- MMI) [27] TDNN-LSTM [28] AM (1 standard, 6 time-delay and 3 LSTM layers). We use 40-dimensional MFCC as features combined with i-vectors for speaker adaptation [29]. The LM used for the baseline CS detection system is a standard bilin- gual 3-gram with interpolated Kneser-Ney smoothing. Further details are provided in [24]. We compute phone posteriors from the denominator graph (created using a phone LM estimated from the phone alignments of the training data) of the chain model and map them to phones using the existing implementa- tion in Kaldi (nnet3-chain-compute-post). The output obtained for each frame is l1-normalized and the resulting normalized vectors are used for CS detection. The bilingual lexicon contains 110k Frisian and Dutch words. The number of entries in the lexicon is approximately 160k due to the words with multiple phonetic transcriptions. Missed Frisian time (%)Missed Dutch time (%)251020251020●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●develtestBaselinePhone post.Lang post. Figure 3: Hypothesized language switch counts 5. Results and Discussion The EERs and DET curves provided by the three CS detection systems are given in Table 1 and Figure 2, respectively. The baseline CS detection system has an EER of 9.7% on the de- velopment and 6.3% on the test set. CS detection based on the language tag of phone with the maximum phone posterior has a reduced EER of 9.2% on the development and 5.2% on the test data. The lowest EERs are given by the system using the lan- guage posteriors. The consistent improvements on the develop- ment and test sets indicate the improved overall CS performance over the baseline and phone posterior-based system. We further compare the number of language switches hy- pothesized by each CS detection system with the manually an- notated switches in Figure 3. Additionally, the histograms of the duration distributions of the monolingual speech segments are shown in Figure 4. These plots reveal that all CS detection sys- tems tend to overestimate the number of language switches in the code-switched speech. These false alarms are mainly due to a large number of monolingual segments that are shorter than 2 seconds as shown in Figure 4. Using language posteriors helps reducing the amount of false alarms on both sets. In general, the proposed language posterior-based CS de- tection system provides a higher overall CS detection accuracy than the baseline technique using the time alignment of the mostly likely hypothesis. Although all systems still suffer from false alarms (by incorrectly hypothesizing very short-duration language switches), using a language posterior-based CS detec- tion system alleviates this problem. This indicates that the pro- posed CS detection system is more robust compared with other systems. Further investigation needs to be done to reduce these false alarms which remains as a future work. 6. Conclusion This paper addresses code-switching (CS) detection problem and introduces a new method for CS detection by using frame- level language posteriors produced by a CS ASR system. The language posteriors are obtained by summing the posteriors of the same-language phones extracted using the bilingual acoustic model in conjunction with a phone language model. The perfor- mance of this CS detection system is compared with a baseline system that uses the time alignment of the most likely hypothe- sis. The CS detection experiments indicate that the proposed CS detection system provides the lowest EERs on development and test set of the FAME! corpus. We also demonstrate that using language posterior for CS detection yields more robust detec- tion with a considerably reduced number of false alarms due to Figure 4: Duration distribution of monolingual segments incorrectly hypothesized very short language switches. Future work directions include investigating smoothing techniques to address the overestimation problem and exploiting the CS de- tection results to improve the CS ASR performance. 7. Acknowledgements This research is supported by National Research Foundation through the AI Singapore Programme, the AI Speech Lab: Au- tomatic Speech Recognition for Public Service Project AISG- 100E-2018-006. 8. References [1] Y. Li and P. Fung, "Code switching language model with transla- tion constraint for mixed language speech recognition," in Proc. COLING, Dec. 2012, pp. 1671 -- 1680. [2] H. Adel, N. Vu, F. Kraus, T. Schlippe, H. Li, and T. Schultz, "Recurrent neural network language modeling for code switching conversational speech," in Proc. ICASSP, 2013, pp. 8411 -- 8415. [3] H. Adel, K. Kirchhoff, D. Telaar, N. T. Vu, T. Schlippe, and T. Schultz, "Features for factored language models for code- switching speech," in Proc. SLTU, May 2014, pp. 32 -- 38. [4] Z. Zeng, H. Xu, T. Y. Chong, E.-S. Chng, and H. Li, "Improving N-gram language modeling for code-switching speech recogni- tion," in Proc. APSIPA ASC, 2017, pp. 1 -- 6. [5] I. Hamed, M. Elmahdy, and S. Abdennadher, "Building a first language model for code-switch Arabic-English," Procedia Com- puter Science, vol. 117, pp. 208 -- 216, 2017. [6] E. van der Westhuizen and T. Niesler, "Synthesising isiZulu- English code-switch bigrams using word embeddings," in Proc. INTERSPEECH, 2017, pp. 72 -- 76. [7] G. Stemmer, E. Noth, and H. Niemann, "Acoustic modeling of foreign words in a German speech recognition system," in Proc. EUROSPEECH, 2001, pp. 2745 -- 2748. [8] D.-C. Lyu, R.-Y. Lyu, Y.-C. Chiang, and C.-N. Hsu, "Speech recognition on code-switching among the Chinese dialects," in Proc. ICASSP, vol. 1, May 2006, pp. 1105 -- 1108. Development SetTest Set020040060080010001200140016001800Language switch countsBaselinePhone post.Lang post.Manual Annot024681012141618020040060080010001200BaselinePhone post.Lang post.Manual Annot0246810121416180100200300400500600700BaselinePhone post.Lang post.Manual AnnotMonolingual Segment Duration (sec.)Counts(a) Development Set(b) Test Set [9] N. T. Vu, D.-C. Lyu, J. Weiner, D. Telaar, T. Schlippe, F. Blaicher, E.-S. Chng, T. Schultz, and H. Li, "A first speech recognition sys- tem for Mandarin-English code-switch conversational speech," in Proc. ICASSP, March 2012, pp. 4889 -- 4892. [10] T. I. Modipa, M. H. Davel, and F. De Wet, "Implications of Se- pedi/English code switching for ASR systems," in Pattern Recog- nition Association of South Africa, 2015, pp. 112 -- 117. [11] E. Yılmaz, H. Van den Heuvel, and D. A. Van Leeuwen, "Investi- gating bilingual deep neural networks for automatic speech recog- nition of code-switching Frisian speech," in Proc. SLTU, May 2016, pp. 159 -- 166. [12] J. Weiner, N. T. Vu, D. Telaar, F. Metze, T. Schultz, D.-C. Lyu, E.-S. Chng, and H. Li, "Integration of language identification into a recognition system for spoken conversations containing code- switches," in Proc. SLTU, May 2012. [13] D.-C. Lyu, E.-S. Chng, and H. Li, "Language diarization for code- switch conversational speech," in Proc. ICASSP, May 2013, pp. 7314 -- 7318. [14] Y.-L. Yeong and T.-P. Tan, "Language identification of code switching sentences and multilingual sentences of under- resourced languages by using multi structural word information," in Proc. INTERSPEECH, Sept. 2014, pp. 3052 -- 3055. [15] E. Yılmaz, H. van den Heuvel, and D. van Leeuwen, "Code- switching detection using multilingual DNNs," in IEEE Spoken Language Technology Workshop (SLT), Dec 2016, pp. 610 -- 616. [16] C. Myers-Scotton, "Codeswitching with English: types of switch- ing, types of communities," World Englishes, vol. 8, no. 3, pp. 333 -- 346, 1989. [17] M. Volk and S. Clematide, "Detecting code-switching in a multi- lingual alpine heritage corpus," in CodeSwitch@EMNLP, 2014. [18] C.-H. Wu, H.-P. Shen, and C.-S. Hsu, "Code-switching event de- tection by using a latent language space model and the delta- bayesian information criterion," IEEE/ACM Transactions on Au- dio, Speech, and Language Processing, vol. 23, no. 11, pp. 1892 -- 1903, Nov 2015. [19] E. Yılmaz, H. Van den Heuvel, and D. A. Van Leeuwen, "Exploit- ing untranscribed broadcast data for improved code-switching de- tection," in Proc. INTERSPEECH, Aug. 2017, pp. 42 -- 46. [20] D. Amazouz, M. Adda-Decker, and L. Lamel, "Addressing code- switching in French/Algerian Arabic speech," in Proc. INTER- SPEECH, 2017, pp. 62 -- 66. [21] E. Yılmaz, H. van den Heuvel, and D. A. van Leeuwen, "Code- switching detection with data-augmented acoustic and language models," in Proc. SLTU, 2018, pp. 127 -- 131. [22] E. Yılmaz, M. Andringa, S. Kingma, F. Van der Kuip, H. Van de Velde, F. Kampstra, J. Algra, H. Van den Heuvel, and D. Van Leeuwen, "A longitudinal bilingual Frisian-Dutch ra- dio broadcast database designed for code-switching research," in Proc. LREC, 2016, pp. 4666 -- 4669. [23] J. Popkema, Frisian Grammar: The Basics. Afuk, Leeuwarden, 2013. [24] E. Yılmaz, H. Van den Heuvel, and D. A. Van Leeuwen, "Acous- tic and textual data augmentation for improved ASR of code- switching speech," in Proc. INTERSPEECH, Sept. 2018, pp. 1933 -- 1937. [25] N. Oostdijk, "The spoken Dutch corpus: Overview and first eval- uation," in Proc. LREC, 2000, pp. 886 -- 894. [26] D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz, J. Silovsky, G. Stemmer, and K. Vesely, "The Kaldi speech recog- nition toolkit," in Proc. ASRU, Dec. 2011. [27] D. Povey, V. Peddinti, D. Galvez, P. Ghahremani, V. Manohar, X. Na, Y. Wang, and S. Khudanpur, "Purely sequence-trained neu- ral networks for ASR based on lattice-free MMI," in Proc. INTER- SPEECH, 2016, pp. 2751 -- 2755. [28] V. Peddinti, Y. Wang, D. Povey, and S. Khudanpur, "Low latency acoustic modeling using temporal convolution and LSTMs," IEEE Signal Processing Letters, vol. 25, no. 3, pp. 373 -- 377, March 2018. [29] G. Saon, H. Soltau, D. Nahamoo, and M. Picheny, "Speaker adap- tation of neural network acoustic models using i-vectors," in Proc. ASRU, Dec 2013, pp. 55 -- 59. [30] M. Davel and E. Barnard, "Bootstrapping for language resource generation," in Pattern Recognition Association of South Africa, 2003, pp. 97 -- 100. [31] S. R. Maskey, A. B. Black, and L. M. Tomokiyo, "Bootstrapping phonetic lexicons for new languages," in Proc. ICLSP, 2004, pp. 69 -- 72. [32] J. R. Novak, N. Minematsu, and K. Hirose, "Phonetisaurus: Ex- ploring grapheme-to-phoneme conversion with joint n-gram mod- els in the WFST framework," Natural Language Engineering, pp. 1 -- 32, 9 2015. [33] A. Martin, G. Doddington, T. Kamm, M. Ordowski, and M. Przy- bocki, "The DET curve in assessment of detection task perfor- mance," in Proc. Eurospeech, Sep. 1997, pp. 1895 -- 1898.
1807.07961
2
1807
2018-08-07T01:25:05
Twitter Sentiment Analysis via Bi-sense Emoji Embedding and Attention-based LSTM
[ "cs.CL", "cs.MM" ]
Sentiment analysis on large-scale social media data is important to bridge the gaps between social media contents and real world activities including political election prediction, individual and public emotional status monitoring and analysis, and so on. Although textual sentiment analysis has been well studied based on platforms such as Twitter and Instagram, analysis of the role of extensive emoji uses in sentiment analysis remains light. In this paper, we propose a novel scheme for Twitter sentiment analysis with extra attention on emojis. We first learn bi-sense emoji embeddings under positive and negative sentimental tweets individually, and then train a sentiment classifier by attending on these bi-sense emoji embeddings with an attention-based long short-term memory network (LSTM). Our experiments show that the bi-sense embedding is effective for extracting sentiment-aware embeddings of emojis and outperforms the state-of-the-art models. We also visualize the attentions to show that the bi-sense emoji embedding provides better guidance on the attention mechanism to obtain a more robust understanding of the semantics and sentiments.
cs.CL
cs
Twitter Sentiment Analysis via Bi-sense Emoji Embedding and Attention-based LSTM Yuxiao Chen∗ Department of Computer Science University of Rochester Rochester, NY [email protected] Quanzeng You Microsoft Research AI Redmond, WA [email protected] Jianbo Yuan∗ Department of Computer Science University of Rochester Rochester, NY [email protected] Jiebo Luo Department of Computer Science University of Rochester Rochester, NY [email protected] ABSTRACT Sentiment analysis on large-scale social media data is important to bridge the gaps between social media contents and real world activities including political election prediction, individual and pub- lic emotional status monitoring and analysis, and so on. Although textual sentiment analysis has been well studied based on platforms such as Twitter and Instagram, analysis of the role of extensive emoji uses in sentiment analysis remains light. In this paper, we propose a novel scheme for Twitter sentiment analysis with extra attention on emojis. We first learn bi-sense emoji embeddings under positive and negative sentimental tweets individually, and then train a sentiment classifier by attending on these bi-sense emoji embeddings with an attention-based long short-term memory net- work (LSTM). Our experiments show that the bi-sense embedding is effective for extracting sentiment-aware embeddings of emojis and outperforms the state-of-the-art models. We also visualize the attentions to show that the bi-sense emoji embedding provides bet- ter guidance on the attention mechanism to obtain a more robust understanding of the semantics and sentiments. CCS CONCEPTS • Information systems → Sentiment analysis; • Computing methodologies → Learning latent representations; KEYWORDS Sentiment analysis, emoji, bi-sense embedding, attention ACM Reference Format: Yuxiao Chen, Jianbo Yuan, Quanzeng You, and Jiebo Luo. 2018. Twitter Sentiment Analysis via Bi-sense Emoji Embedding and Attention-based ∗Yuxiao Chen and Jianbo Yuan contributed equally to this work. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. MM '18, October 22 -- 26, 2018, Seoul, Republic of Korea © 2018 Association for Computing Machinery. ACM ISBN 978-1-4503-5665-7/18/10...$15.00 https://doi.org/10.1145/3240508.3240533 LSTM. In 2018 ACM Multimedia Conference (MM '18), October 22 -- 26, 2018, Seoul, Republic of Korea. ACM, New York, NY, USA, 9 pages. https://doi.org/ 10.1145/3240508.3240533 1 INTRODUCTION The rapid growth of social media platforms such as Twitter provides rich multimedia data in large scales for various research opportu- nities, such as sentiment analysis which focuses on automatically sentiment (positive and negative) prediction on given contents. Sen- timent analysis has been widely used in real world applications by analyzing the online user-generated data, such as election predic- tion, opinion mining and business-related activity analysis. Emojis, which consist of various symbols ranging from cartoon facial ex- pressions to figures such as flags and sports, are widely used in daily communications to express people's feelings 1. Since their first release in 2010, emojis have taken the place of emoticons (such as ":-)" and ":-P") [37] to create a new form of language for social media users [4]. According to recent science reports, there are 2,823 emojis in unicode standard in Emoji 11.0 2, with over 50% of the Instagram posts containing one or more emojis [11] and 92% of the online population using emojis [40]. The extensive use of emojis has drawn a growing attention from researchers [19, 25] because the emojis convey fruitful semantical and sentimental information to visually complement the textual in- formation which is significantly useful in understanding the embed- ded emotional signals in texts [6]. For example, emoji embeddings have been proposed to understand the semantics behind the emojis [12, 26], and the embedding vectors can be used to visualize and predict emoji usages given their corresponding contexts. Previous work also shows that, it is useful to pre-train a deep neural network on an emoji prediction task with pre-trained emoji embeddings to learn the emotional signals of emojis for other tasks including senti- ment, emotion and sarcasm prediction [15]. However, the previous literatures lack in considerations of the linguistic complexities and diversity of emoji. Therefore, previous emoji embedding methods fail to handle the situation when the semantics or sentiments of the learned emoji embeddings contradict the information from the corresponding contexts [19], or when the emojis convey multiple 1Real time emoji tracker: http://emojitracker.com/ 2https://emojipedia.org/emoji-11.0/ Table 1: Tweet examples with emojis. The sentiment ground truth is given in the second column. The examples show that inconsistent sentiments exist between emojis and texts. Emoji Sentiment Positive Negative Tweets . Good morning Justin!!! I hope u have an amazing Friday :) Don't forget to smile That's awesome :) I'm super keen to hear/see it all I really hate times square personally it's too busy (I'm claustrophobic Not very good when your sat waiting for your food and there is a queue forming to complain to a manager This weather is perfect! The dresses I ordered arrived this morning and they're so pretty . It's just the change I needed. ). . . Positive Negative Worst headache ever and feel so sick, mum where are you . This nurse always comes mad early in the morning I'm mad tired . and senses of semantics and sentiments such as ( ). In practice, emojis can either summarize and emphasis the original tune of their contexts, or express more complex semantics such as irony and sar- casm by being combined with contexts of contradictory semantics or sentiments. For the examples shown in Table 1, the emoji ( ) is of consistent sentiment with text to emphasis the sentiment, but is of the opposite sentiment (positive) to the text sentiment (negative) example 3 and 4 to deliver a sense of sarcasm. Conventional emoji analysis can only extract single embedding of each emoji, and such embeddings will confuse the following sentiment analysis model by inconsistent sentiment signals from the input texts and emojis. Moreover, we consider the emoji effect modeling different from the conventional multimodal sentiment analysis which usually in- cludes images and texts in that, image sentiment and text sentiment are usually assumed to be consistent [45] while it carries no such assumption for texts and emojis. To tackle such limitations, we propose a novel scheme that con- sists of an attention-based recurrent neural network (RNN) with robust bi-sense emoji embeddings. Inspired by the word sense em- bedding task in natural language processing (NLP) [21, 24, 39] where each sense of an ambiguous word responds to one unique embedding vector, the proposed bi-sense embedding is a more ro- bust and fine-grained representation of the complicated semantics for emojis where each emoji is embedded into two distinct vectors, namely positive-sense and negative-sense vector, respectively. For our specific task which is Twitter sentiment analysis [23, 38], we initialize the bi-sense embedding vectors together with word em- bedding vectors using word embedding algorithm fasttext [7] by extracting two distinct embeddings for each emoji according to the sentiment of its corresponding textual contexts, namely bi-sense em- bedding. A long short-term memory (LSTM) based recurrent neural network is then used for predicting sentiments which is integrated with the pre-trained emoji embedding features by a context-guide and self-selected attention mechanism. Because most of the pre- vious Twitter sentiment datasets exclude emojis and there exists little resource that contains sufficient emoji-tweets with sentiment labels, we construct our own emoji-tweets dataset by automati- cally generating weak labels using a rule-based sentiment analysis algorithm Vader [20] for pre-traning the networks, and manually labeling a subset of tweets for fine tuning and testing purposes. The experimental results demonstrate that the bi-sense emoji em- bedding is capable of extracting more distinguished information from emojis and outperforms the state-of-the-art sentiment anal- ysis models with the proposed attention-based LSTM networks. We further visualize the bi-sense emoji embedding to obtain the sentiments and semantics learned by the proposed approach. The main contributions of this paper are summarized as follows. • We propose a novel bi-sense embedding scheme that learns more robust and fine-grained representations of the complex semantic and sentiment information from emojis. • We propose attention-based LSTM networks to encode both texts and bi-sense emoji embedding which outperform the state-of-the-art sentiment analysis models. The networks can be further extended to tackle tasks with multi-sense embedding inputs. 2 RELATED WORK 2.1 Sentiment Analysis Sentiment analysis is to extract and quantify subjective informa- tion including the status of attitudes, emotions and opinions from a variety of contents such as texts, images and audios [47]. Sentiment analysis has been drawing great attentions because of its wide appli- cations in business and government intelligence, political science, sociology and psychology [2, 3, 13, 33]. From a technical perspec- tive, textual sentiment analysis is first explored by researchers as an NLP task. Methods range from lexical-based approaches using features including keywords [5, 36] where each word corresponds to a sentiment vector with entries representing the possibility of the word and each sentiment and phase-level features (n-grams and unigrams) [34, 43], to deep neural network based embedding ap- proaches including skip-grams, continuous bag-of-words (CBoW) and skip-thoughts [7, 22, 29, 30]. It was until recent years when researchers start focusing on image and multimodal sentiments [8, 46] and analyzing how to take advantage of the cross-modality resources [44, 45]. For multimodal sentiment analysis, an underly- ing assumption is that both modalities express similar sentiment and such similarity is enforced in order to train a robust sentiment inference model [45]. However, the same assumption does not stand in modeling textual tweets and emojis because the complexities of natural language exist extensively, such as the use of irony, jokes, sarcasm, etc. [15]. 2.2 Emojis and Sentiment Analysis With the overwhelming development of Internet of Things (IOT), the growing accessibility and popularity of subjective contents have provided new opportunities and challenges for sentiment analysis [35]. For example, social medias such as Twitter and Instagram have been explored because the massive user-generated contents with rich user sentiments [1, 16, 34] where emojis (and emoticons) are extensively used. Non-verbal cues of sentiment, such as emoticon which is considered as the previous generation of emoji, has been studied for their sentiment effect before emojis take over [18, 27, 48]. For instance, [18, 48] pre-define sentiment labels to emoticons and construct a emoticon-sentiment dictionary. [27] applies emoticons for smoothing noisy sentiment labels. Similar work from [31] first considers emoji as a component in extracting the lexical feature for further sentiment analysis. [32] constructs an emoji sentiment rank- ing based on the occurrences of emojis and the human-annotated sentiments of the corresponding tweets where each emoji is as- signed with a sentiment score from negative to positive 3, similar to the SentiWordNet [14]. However, the relatively intuitive use of emojis by lexical- and dictionary-based approaches lacks insightful understanding of the complexed semantics of emojis. Therefore, inspired by the success of word semantic embedding algorithms such as [7, 30], [12] obtains semantic embeddings of each emoji by averaging the words from its descriptions 4 and shows it is effective to take advantage of the emoji embedding for the task of Twitter sentiment analysis. [26] proposes a convoluntional neural network to predict the emoji occurrence and jointly learns the emoji em- bedding via a matching layer based on cosine similarities. Despite the growing popularity of Twitter sentiment analysis, there is a limited number of emoji datasets with sentiment labels available because previous studies usually filter out urls, emojis and some- times emoticons. However, [15] shows that it is effective to extract sentiment information from emojis for emotion classification and sarcasm detection tasks in the absence of learning vector-based emoji representations by pre-training a deep neural network to predict the emoji occurrence. 3 METHODOLOGY We propose two mechanisms, namely Word-guide Attention-based LSTM and Multi-level Attention-based LSTM, to take advantage of bi-sense emoji embedding for the sentiment analysis task. The frameworks of these two methods are shown in Figure 1 and Figure 2, respectively. Our workflow includes the following steps: initial- ization of bi-sense emoji embedding, generating senti-emoji embed- ding based on self-selected attention, and sentiment classification via the proposed attention-based LSTM networks. 3.1 Bi-sense Embedding Recent research shows great success in word embedding task such as word2vec and fasttext [7, 29]. We use fasttext to initialize emoji embeddings by considering each emoji as a special word, together with word embeddings. The catch is, different from conventional approaches where each emoji responds to one embedding vector (as we call word-emoji embedding), we embed each emoji into 3http://kt.ijs.si/data/Emoji_sentiment_ranking/ 4http://www.unicode.org/emoji/charts/ Figure 1: Sentiment analysis via bi-sense emoji embedding and attention-based LSTM network (WATT-BiE-LSTM). two distinct vectors (bi-sense emoji embedding): we first assign two distinct tokens to each emoji, of which one is for the particular emoji used in positive sentimental contexts and the other one is for this emoji used in negative sentimental contexts (text sentiment initialized by Vader [20], details will be discussed in Section 4.1), respectively; the same fasttext training process is used to embed each token into a distinct vector, and we thus obtain the positive- sense and negative-sense embeddings for each emoji. The word2vec is based on the skip-gram model whose objective is to maximize the log likelihood calculated by summing the proba- bilities of current word occurrences given a set of the surrounding words. The fasttext model is different by formatting the problem as a binary classification task to predict the occurrence of each context word, with negative samples being randomly selected from the ab- sent context words. Given an input word sequence {w1, w2, ..., wT }, and the context word set Wct and the set of negative word samples Wnt of the current word wt , the objective function is obtained based on binary logistic loss as in Equation 1:  L (s (wt , wc)) +  T t =1   wc ∈Wct wn ∈Wnt L (s (wt , wn)) (1) where L(s(·, ·)) denotes the logistic loss of the score function s(· , ·) which is computed by summing up the scalar products between the n-gram embeddings of the current word and the context word embedding which is different from word2vec where the score is the scalar product between the current word and the context word embedding. We select fasttext over word2vec mainly because its computational efficiency. In general, the two models yield competi- tive performances and the comparison between word embeddings is beyond our discussion. Therefore we only show the results derived by the fasttext initialization within the scope of this work. Bi-sense Emoji EmbedingSenti-emoji EmbedingLSTM FC Layer PredictionConcatenateWord EmbedingTweetFasttext word_1, word_2, ...EmojiFasttextAttend on EmojisAttentionWeightsDot 3.2 Word-guide Attention-based LSTM Long short-term memory (LSTM) units have been extensively used to encode textual contents. The basic encoder model consists of a text embedding layer, LSTMs layer, and fully-connected layers for further tasks such as text classifications based on the encoded feature. The operations in an LSTM unit for time step t is formulated in Equation 2: it = σ(Wixt + Uiht−1 + bi) ft = σ(Wf xt + Uf ht−1 + bf ) ot = σ(Woxt + Uoht−1 + bo) gt = tanh(Wcxt + Ucht−1 + bc) ct = ft ⊙ ct−1 + it ⊙ gt ht = ot ⊙ tanh(ct) (2) where ht and ht−1 represent the current and previous hidden states, xt denotes the current LSTM input and here we use the embedding wt of the current word wt , andW and U denote the weight matrices [17]. In order to take advantage of the bi-sense emoji embedding, we modify the input layer into the LSTM units. We first obtain the senti-emoji embedding as an weighted average of the bi-sense emoji embedding based on the self-selected attention mechanism. Let et,i , i ∈ (1, m) represent the i-th sense embedding of emoji et (m = 2 in our bi-sense embedding), and fatt( · , wt) denote the attention function conditioned on the current word embedding, the attention weight αi and senti-emoji embedding vector vt is formulated as follows: αt,i = ut,i = fatt(et,i , wt) exp(ut,i) i =1 exp(ut,i) m m (cid:0)αt,i · et,i(cid:1) vt = i =1 (3) We choose a fully-connected layer with ReLU activation as the attention function, and the attention vector vt is concatenated with the word embedding as the new input of the LSTM. Thus the input vector xt in Equation 2 becomes [wt , vt]. The output of the final LSTM unit is then fed into a fully-connected layer with siдmoid activation to output the tweet sentiment and binary cross-entropy loss is used as the objection function (Equation 4) where N is the total number of samples. The motivation behind this model is that each context word guides the attention weights in order to enforce the model to self-select which embedding sense it should attend on. Therefore we denote this model as the Word-guide Attention-based LSTM with Bi-sense emoji embedding (WATT-BiE-LSTM). (yi log(pi) + (1 − yi) log(1 − pi)) (4) N i =1 L(θ) = − 1 N 3.3 Multi-level Attention-based LSTM There is another way of formulating the attention mechanism where the attention weights indicate how the image information (which is emoji in our case) is distributed through the context words as proposed in [9, 42]. The modified senti-emoji embedding vector v is thus at the tweet-level instead of the word-level in Equation 3 by Figure 2: Multi-level attention-based LSTM with bi-sense emoji embedding (MATT-BiE-LSTM). replacing the wt with the final state vector h outputted from the last LSTM unit, as shown in Equation 5: exp(fatt(ei , h)) i =1 exp(fatt(ei , h)) (αi · ei) αi = v′ = m m i =1 (5) m ′ t = The derived senti-emoji embedding v′ is then used to calculate an additional layer of attention following [9, 42]. Given the input tweet sequence {w1, w2, ..., wT }, the attention weight α′ t , t ∈ (1,T) conditioned on the senti-emoji embedding is formulated as follows: exp(fatt(wt , v′)) i =1 exp(fatt(wt , v′)) α (6) Therefore, we construct the new input ut to each LSTM unit by concatenating the original word embedding and the attention vector in Equation 7 to distribute the senti-emoji information to each step. This model is called Multi-level Attention-based LSTM with Bi- sense Emoji Embedding (MATT-BiE-LSTM). We choose the same binary cross-entropy as the loss function with the same network configuration with WATT-BiE-LSTM. ′ t · v′] u = [wt , α (7) 4 EXPERIMENTS 4.1 Data Collection and Annotation Data Collection We construct our own Twitter sentiment dataset by crawling tweets through the REST API 5 which consists of 350,000 users and is mag- nitude larger comparing to previous work. We collect up to 3,200 5https://developer.twitter.com/en/docs Senti-emoji EmbedingConcatenateWord EmbedingAttend on EmojisLSTM EncoderSentence EmbedingAttend on WordsLSTM FC Layer PredictionDotAttended Emoji EmbedingBi-sense Emoji EmbedingAttentionWeights Table 2: Top-10 Most Frequently Used Emojis. AA-Sentiment HA-Sentiment Positive Negative 62,816 164,677 4,715 146,498 4,566 105,329 66,905 2,678 2,155 62,369 2,079 53,913 24,519 31,077 42,543 4,212 3,182 42,919 38,316 4,514 Pos-Ratio Positive Negative Pos-Ratio 0.724 0.969 0.958 0.962 0.967 0.963 0.559 0.910 0.931 0.895 333 184 181 194 93 101 56 128 91 112 162 32 23 7 7 13 177 19 25 24 0.673 0.852 0.887 0.965 0.930 0.886 0.240 0.871 0.784 0.824 Ranking Emoji 1 2 3 4 5 6 7 8 9 10 tweets from each user and follow the standard tweet preprocess- ing procedures to remove the tweets without emojis and tweets containing less than ten words, and contents including the urls, mentions, and emails. Data Annotation For acquiring the sentiment annotations, we first use Vader which is a rule-based sentiment analysis algorithm [20] for text tweets only to generate weak sentiment labels. The algorithm outputs sentiment scores ranging from -1 (negative) to 1 (positive) with neutral in the middle. We consider the sentiment analysis as a binary classification problem (positive sentiment and negative sentiment), we filter out samples with weak prediction scores within (−0.60, 0.60) and keep the tweets with strong sentiment signals. Emoji occurrences are calculated separately for positive tweets and negative tweets, and threshold is set to 2,000 to further filter out emojis which are less frequently used in at least one type of sentimental text. In the end, we have constructed a dataset with 1,492,065 tweets and 55 frequently used emojis in total. For the tweets with an absolute sentiment score over 0.70, we keep the auto-generated sentiment label as ground truth because the automatic annotation is reliable with high sentiment scores. On the other hand, we select a subset of the tweets with absolute sentiment scores between (0.60, 0.70) for manual labeling by randomly sampling, following the distribution of emoji occurrences where each tweet is labeled by two graduate students. Tweets are discarded if the two annotations disagree with each other or they are labeled as neutral. In the end, we have obtained 4,183 manually labeled tweets among which 60% are used for fine-tuning and 40% are used for testing purposes. The remainder of the tweets with automatic annotations are divided into three sets: 60% are used for pre-training the bi-sense and conventional emoji embedding, 10% for validation and 30% are for testing. We do not include a "neutral" class because it is difficult to obtain valid neutral samples. For auto-generated labels, the neutrals are the samples with low absolute confidence scores and their sentiments are more likely to be model failures other than "true neutrals". Moreover, based on the human annotations, most of the tweets with emojis convey non-neutral sentiment and only few neutral samples are observed during the manual labeling which are excluded from the manually labeled subset. In order to valid our motivation that emojis are also extensively used in tweets that contain contradictory information to the emoji sentiments, we calculate the emoji usage in Table 2 according to the sentiment labels where Pos-Ratio means the percentage of each emoji occurs in the positive tweets over its total number of oc- currences, AA and HA indicate automatic-annotation and human- annotation, respectively. We present the top-10 most frequently used emojis in our dataset and observe a slight difference in the Pos-Ratios between AA and HA dataset because of the randomness involved in the sampling process. Results from both of the datasets show a fair amount of emoji use in both positive and negative tweets. For example, it is interesting to notice that emoji ( ) oc- curs more in the positive tweets in with the automatic annotations, while emojis with strong positive sentiment have also been used in negative tweets with about 5% occurrences, such as ( , and ). Given the averaged positive ratio among all emojis in the whole dataset is about 74% and that most emojis have been extensively used in tweets containing both positive and negative sentiments, it suggests that distinguishing the emoji occurrences in both senti- ments via bi-sense embedding is worth investigating. Additionally, we observe the Pos-Ratios of the AA-sentiment and HA-sentiment have little differences which are due to two main reasons: 1) Some tweets we sampled to construct the HA-sentiment are discarded because the annotators have disagreements and we only keep the samples that we are confident about; 2) Tweets with absolute sen- timent scores between (0.60,0.70) are selected for manual labeling as discussed in Section 4.1, which are lower than the tweets used to construct the AA-sentiment (0.7 and above). The lower senti- ment scores indicate that Vader is less reliable on the samples of HA-sentiment dataset and the sentiments of these tweets are more likely to be affected by emojis. , 4.2 Sentiment Analysis Models We set up the baselines and proposed models as follows: LSTM with text embedding: CNNs and LSTMs are widely used to encode textual contents for sentiment analysis in [10, 41] and many online tutorials. Here we select the standard LSTM with pre-trained Table 3: Twitter Sentiment Analysis. Models T-LSTM E-LSTM ATT-E-LSTM BiE-LSTM MATT-BiE-LSTM WATT-BiE-LSTM AA-Sentiment Precision Recall ROC Area Accuracy 0.921 0.944 0.948 0.961 0.972 0.949 0.901 0.86 0.890 0.891 0.895 0.895 0.931 0.933 0.954 0.966 0.975 0.960 0.866 0.855 0.879 0.890 0.900 0.883 F1 Score 0.911 0.900 0.918 0.924 0.932 0.921 HA-Sentiment Precision Recall ROC Area Accuracy 0.708 0.816 0.825 0.822 0.831 0.830 0.825 0.825 0.868 0.881 0.872 0.889 0.774 0.855 0.878 0.898 0.890 0.899 0.707 0.794 0.820 0.824 0.826 0.834 F1 Score 0.762 0.820 0.846 0.850 0.851 0.859 word embedding as input, and add one fully-connected layer with sigmoid activation top of the LSTM encoder (same as all other models), denoted as T-LSTM. LSTM with emoji embedding: We consider the emoji as one special word and input both pre-trained text and emoji embeddings into the same LSTM network, namely E-LSTM. Similarly, we concatenate the pre-trained bi-sense emoji embedding as one special word to feed into the LSTM network. This model is called BiE-LSTM. Attention-based LSTM with emojis:We also use the word-emoji em- bedding to calculate the emoji-word attention following Equation 6 and 7, and the only difference is that we replace the attention- derived senti-emoji embedding with the pre-trained word-emoji embedding by fasttext, denoted as ATT-E-LSTM. LSTM with bi-sense emoji embedding (proposed): As we have in- troduced in Section 3.2, we propose two attention-based LSTM networks based on bi-sense emoji embedding, denoted as MATT- BiE-LSTM and WATT-BiE-LSTM. Evaluation We evaluate the baseline and proposed models on sentiment analy- sis by F1 scores and accuracies based on the auto-annotated test- ing set (AA-Sentiment) and human-annotated testing set (HA- Sentiment), as shown in Table 3. We only test the models after fine-tuning with a subset of the samples with human annotations because training exclusively on the samples with auto-generated weak labels results in relatively poor performances when tested with human annotated data indicating the models after fine-tuning are more robust. The F1 scores and accuracies are overall higher with the AA-Sentiment than the results with HA-sentiment, in- dicating that the HA-Sentiment is a more challenging task and the sentiments involved are more difficult to identify supported by their relatively lower sentiment scores returned from Vader. We still, however, observe competitive results from HA-Sentiment showing that the models are well-trained and robust to noisy labels with the help of fine-tuning with human annotated data. The T-LSTM baseline achieves decent performance in both experiments with accuracies of 86.6% and 70.7% showing that LSTM is an effective encoder for sentiment analysis as suggested by the references. The models with proposed bi-sense emoji embedding obtain accura- cies over 82.4% and we observe improvements on the performance with the attention-based LSTM from our proposed model MATT- BiE-LSTM and WATT-BiE-LSTM, which is consistent with that ATT-E-LSTM ([email protected]%, [email protected]% on HA-Sentiment) out- performs significantly T-LSTM and E-LSTM. Emoji information is useful in sentiment analysis. Most models outperforms the baseline T-LSTM in both dataset suggesting that the emoji information is useful for sentiment analysis as a complement to the textual contents, even with the naive use of emoji embeddings (E-LSTM) when tested with HA-Sentiment. We observe that E-LSTM obtains similar performance to T-LSTM with AA-Sentiment but a significant gain over the T-LSTM when tested with HA-Sentiment indicating that sentiment information is helpful and necessary when the hidden sentiment is relatively subtle and the task is more challenging. Bi-sense emoji embedding helps. All the models using bi- sense emoji embedding perform significantly better than the base- line models without emoji feature or with word-emoji embedding. BiE-LSTM outperforms T-LSTM and E-LSTM significantly with the same utilization of emoji embedding indicates that the proposed bi-sense emoji embedding is capable of extracting more informative and distinguishable vectors over the use of conventional word em- bedding algorithms, which is consistent based on the comparisons between the proposed models (MATT-BiE-LSTM and WATT-BiE- LSTM) with bi-sense emoji embedding and the baseline model ATT-E-LSTM with word-emoji embedding and attention. Attention mechanism aligns and performs well with bi- sense embedding. MATT-BiE-LSTM and WATT-BiE-LSTM ob- tain similar performances when tested on both Vader and human annotated samples, though their ways of computing the attention (weights and vectors) are different that WATT computes attention weights and the senti-emoji embeddings guided by each word, and MATT obtains the senti-emoji embedding based on the LSTM en- coder on the whole contexts and computes the attention weights of the senti-emoji embedding across all words. Both models outper- forms the state-of-the-art baseline models including ATT-E-LSTM. The proposed attention-based LSTM can be further extended to handle tasks involving multi-sense embedding as inputs, such as the word-sense embedding in NLP, by using context-guide attention to self-select how much to attend on each sense of the embeddings each of which correspond to a distinct sense of semantics or senti- ments. In this way we are able to take advantage of the more robust and fine-grained embeddings. 4.3 Qualitative Analysis In order to obtain insights about why the more fine-grained bi-sense emoji embedding helps in understanding the complexed sentiments behind tweets, we visualize the attention weights for ATT-E-LSTM words which could raise confusions. The senti-emoji embedding is capable of extracting representations of complexed semantics and sentiments which help guide the attentions even in cases when the word sentiment and emoji sentiment are somewhat contradictory to each other. From Figure 3(b) and (c) we can observe that the ATT- E-LSTM assigns more weights on the sentiment-irrelevant words than the MATT-BiE-LSTM such as "hoodies", "wait" and "after", indicating that the proposed model is more robust to irrelevant words and concentrates better on important words. Because of the senti-emoji embedding obtained through bi-sense emoji embedding and the sentence-level LSTM encoding on the text input (described in Section 3.2), we are able to construct a more robust embedding based on the semantic and sentiment information from the whole context compared to the word-emoji embedding used in ATT-E- LSTM which takes only word-level information into account. 4.4 Bi-sense Emoji Embedding Visualization To gain further insights on the bi-sense emoji embedding, we use t-SNE [28] to project high-dimensional bi-sense embedding vectors into a two-dimensional space and preserving the relative distances between the embedding vectors at the same time. In Figure 4 we visualize the bi-sense emoji embedding, positive-sense embedding, negative-sense embedding and the subtraction between positive and negative sense embeddings of each emoji, respectively. The sub- traction of an emoji between its two sense embeddings indicates the semantic differences between emoji usages in positive and negative sentimental contexts, similarly to the objective of word embeddings (a) OMG no pressure, I'll be happy to hang out with whichever lovely people are there. (b) This feels both ridiculous & desperate. I'd pay $100 max for a hoodie. Am I cheap? (c) Amazing! Can't wait to read this after I'm finished with the first. Figure 3: Attention weights obtained by senti-emoji embed- ding and word-emoji embedding across words. Tweet con- texts are given in sub-captions. (a) Bi-sense Emoji Embedding (b) Positive-sense Embedding and MATT-BiE-LSTM for comparison. The example tweets with corresponding attention weights calculated by word-emoji embed- ding and senti-emoji embedding are shown in Figure 3, where the contexts are presented in the captions. The emojis used are , and , respectively. , In Figure 3(a), the ATT-E-LSTM model (baseline) assigns rela- tively more weights on the word "no" and "pressure", while MATT- BiE-LSTM attends mostly on the word "happy" and "lovely". The different attention distributions suggest that the proposed senti- emoji embedding is capable of recognizing words with strong sen- timents that are closely related to the true sentiment even with the presence of words with conflicting sentiments, such as "pressure" and "happy". while ATT-E-LSTM tends to pick up all sentimental (c) Negative-sense Embedding (d) Positive-sense − Negative-sense Figure 4: t-SNE visualization of bi-sense emoji embed- ding. Positive-sense embeddings are paired with red circles, negative-sense embeddings are paired with green circles, and their subtractions are paired with yellow circles, respec- tively. Best viewed when zoomed in. , , , and and ), and the negative-sense [30]. The positive-sense of emoji ( of emoji ( ) are embedded far from the two main clusters as observed in Figure 4(a), suggesting that the semantics of these emojis are different from the other popular emojis. The positive- sense embedding and negative-sense embeddings are clustered well with no intersection with each other. Such observation supports our objective of applying bi-sense emoji embedding because there exist such significant differences in the semantics of each emoji when appears in positive and negative sentimental contexts, and it is well-motivated to consider the emoji usages individually according to the sentiment of the contexts to extract the more fine-grained bi-sense embedding. Additionally, we observe consistent patterns in the Figure 4(b), (c) and (d) where the sentiments conveyed in the emojis become an important factor. For example, emojis with and positive sentiments such as ( ), and emojis with negative sentiment such as ( and ) are embedded into one clusters in both positive-sense and negative-sense space. The embedding subtractions of emojis in Figure 4(d) shows the different usages of emojis across sentiments are similar between emojis and preserve the cluster patterns observed in Figure 4 (b) and (c). 5 CONCLUSIONS In this paper, we present a novel approach to the task of sentiment analysis and achieve the state-of-the-art performance. Different from the previous work, our method combines a more robust and fine-grained bi-sense emoji embedding that effectively represents complex semantic and sentiment information, with attention-based LSTM networks that selectively attend on the correlated sense of the emoji embeddings, and seamlessly fuse the obtained senti-emoji embeddings with the word embeddings for a better understanding of the rich semantics and sentiments involved. In the future, we plan to further extend our attention-based LSTM with bi-embedding work frame to tackle tasks involving multi-sense embedding such as the learning and applications of word-sense embedding. ACKNOWLEDGEMENT We would like to thank the support of New York State through the Goergen Institute for Data Science, and NSF Award #1704309. REFERENCES [1] Apoorv Agarwal, Boyi Xie, Ilia Vovsha, Owen Rambow, and Rebecca Passonneau. 2011. Sentiment analysis of twitter data. In Proceedings of the workshop on languages in social media. Association for Computational Linguistics, 30 -- 38. [2] Hanaa A. Aldahawi. 2015. Mining and analysing social network in the oil business: Twitter sentiment analysis and prediction approaches. Ph.D. Dissertation. Cardiff University, UK. [3] Ghaith Abdulsattar A. Jabbar Alkubaisi, Siti Sakira Kamaruddin, and Husniza Husni. 2018. Stock Market Classification Model Using Sentiment Analysis on Twitter Based on Hybrid Naive Bayes Classifiers. Computer and Information Science 11, 1 (2018), 52 -- 64. [4] Hamza Alshenqeeti. 2016. Are emojis creating a new or old visual language for new generations? A socio-semiotic study. Advances in Language and Literary Studies 7, 6 (2016), 56 -- 69. [5] Stefano Baccianella, Andrea Esuli, and Fabrizio Sebastiani. 2010. SentiWordNet 3.0: An Enhanced Lexical Resource for Sentiment Analysis and Opinion Mining. In Proceedings of the International Conference on Language Resources and Evaluation, LREC 2010, 17-23 May 2010, Valletta, Malta. [6] Francesco Barbieri, Germán Kruszewski, Francesco Ronzano, and Horacio Sag- gion. 2016. How Cosmopolitan Are Emojis?: Exploring Emojis Usage and Mean- ing over Different Languages with Distributional Semantics. In Proceedings of the 2016 ACM Conference on Multimedia Conference, MM 2016, Amsterdam, The Netherlands, October 15-19, 2016. 531 -- 535. [7] Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching Word Vectors with Subword Information. TACL 5 (2017), 135 -- 146. [8] Damian Borth, Tao Chen, Rongrong Ji, and Shih-Fu Chang. 2013. Sentibank: large-scale ontology and classifiers for detecting sentiment and emotions in visual content. In Proceedings of the 21st ACM international conference on Multimedia. ACM, 459 -- 460. [9] Tianlang Chen, Yuxiao Chen, Han Guo, and Jiebo Luo. 2018. When E-commerce Meets Social Media: Identifying Business on WeChat Moment Using Bilateral- Attention LSTM. In Proceedings of the 27th International Conference on World Wide Web Companion, Lyon, France, April, 2018. [10] Mathieu Cliche. 2017. BB_twtr at SemEval-2017 Task 4: Twitter Sentiment Analysis with CNNs and LSTMs. In Proceedings of the 11th International Workshop on Semantic Evaluation, SemEval@ACL 2017, Vancouver, Canada, August 3-4, 2017. 573 -- 580. [11] Thomas Dimson. 2015. Emojineering part 1: Machine learning for emoji trends. Instagram Engineering Blog 30 (2015). [12] Ben Eisner, Tim Rocktäschel, Isabelle Augenstein, Matko Bosnjak, and Sebastian Riedel. 2016. emoji2vec: Learning Emoji Representations from their Description. In Proceedings of The Fourth International Workshop on Natural Language Process- ing for Social Media, SocialNLP@EMNLP 2016, Austin, TX, USA, November 1, 2016. 48 -- 54. [13] Tarek Elghazaly, Amal Mahmoud, and Hesham A. Hefny. 2016. Political Sentiment Analysis Using Twitter Data. In Proceedings of the International Conference on Internet of Things and Cloud Computing, Cambridge, UK, March 22-23, 2016. 11:1 -- 11:5. [14] Andrea Esuli and Fabrizio Sebastiani. 2006. SENTIWORDNET: A Publicly Avail- able Lexical Resource for Opinion Mining. In Proceedings of the Fifth International Conference on Language Resources and Evaluation, LREC 2006, Genoa, Italy, May 22-28, 2006. 417 -- 422. [15] Bjarke Felbo, Alan Mislove, Anders Søgaard, Iyad Rahwan, and Sune Lehmann. 2017. Using millions of emoji occurrences to learn any-domain representations for detecting sentiment, emotion and sarcasm. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017. 1615 -- 1625. [16] Roberto González-Ibánez, Smaranda Muresan, and Nina Wacholder. 2011. Identi- fying sarcasm in Twitter: a closer look. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies: Short Papers-Volume 2. Association for Computational Linguistics, 581 -- 586. [17] Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation 9, 8 (1997), 1735 -- 1780. [18] Alexander Hogenboom, Daniella Bal, Flavius Frasincar, Malissa Bal, Franciska de Jong, and Uzay Kaymak. 2013. Exploiting emoticons in sentiment analysis. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, SAC '13, Coimbra, Portugal, March 18-22, 2013. 703 -- 710. [19] Tianran Hu, Han Guo, Hao Sun, Thuy-vy Thi Nguyen, and Jiebo Luo. 2017. Spice Up Your Chat: The Intentions and Sentiment Effects of Using Emojis. In Proceedings of the Eleventh International Conference on Web and Social Media, ICWSM 2017, Montréal, Québec, Canada, May 15-18, 2017. 102 -- 111. [20] Clayton J. Hutto and Eric Gilbert. 2014. VADER: A Parsimonious Rule-Based Model for Sentiment Analysis of Social Media Text. In Proceedings of the Eighth International Conference on Weblogs and Social Media, ICWSM 2014, Ann Arbor, Michigan, USA, June 1-4, 2014. [21] Ignacio Iacobacci, Mohammad Taher Pilehvar, and Roberto Navigli. 2015. SensEm- bed: Learning Sense Embeddings for Word and Relational Similarity. In Proceed- ings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL 2015, July 26-31, 2015, Beijing, China, Volume 1: Long Papers. 95 -- 105. [22] Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Skip-thought vectors. In Advances in neural information processing systems. 3294 -- 3302. [23] Efthymios Kouloumpis, Theresa Wilson, and Johanna D. Moore. 2011. Twitter Sentiment Analysis: The Good the Bad and the OMG!. In Proceedings of the Fifth International Conference on Weblogs and Social Media, Barcelona, Catalonia, Spain, July 17-21, 2011. [24] Jiwei Li and Dan Jurafsky. 2015. Do Multi-Sense Embeddings Improve Natural Language Understanding?. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015. 1722 -- 1732. [25] Weijian Li, Yuxiao Chen, Tianran Hu, and Jiebo Luo. 2018. Mining the Rela- tionship between Emoji Usage Patterns and Personality. In Proceedings of the Twelfth International Conference on Web and Social Media, ICWSM 2018, Stanford, California, USA, June 25-28, 2018. 648 -- 651. [26] Xiang Li, Rui Yan, and Ming Zhang. 2017. Joint Emoji Classification and Embed- ding Learning. In Asia-Pacific Web (APWeb) and Web-Age Information Manage- ment (WAIM) Joint Conference on Web and Big Data. Springer, 48 -- 63. [27] Kun-Lin Liu, Wu-Jun Li, and Minyi Guo. 2012. Emoticon Smoothed Language Models for Twitter Sentiment Analysis. In Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence, July 22-26, 2012, Toronto, Ontario, Canada. [28] Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-SNE. Journal of machine learning research 9, Nov (2008), 2579 -- 2605. [29] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient Estimation of Word Representations in Vector Space. CoRR abs/1301.3781 (2013). [30] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems. 3111 -- 3119. [31] Petra Kralj Novak, Jasmina Smailović, Borut Sluban, and Igor Mozetič. 2015. Sentiment of emojis. PloS one 10, 12 (2015), e0144296. [32] Petra Kralj Novak, Jasmina Smailovic, Borut Sluban, and Igor Mozetic. 2015. Sentiment of Emojis. CoRR abs/1509.07761 (2015). arXiv:1509.07761 http://arxiv. org/abs/1509.07761 [33] Nazan Öztürk and Serkan Ayvaz. 2018. Sentiment analysis on Twitter: A text mining approach to the Syrian refugee crisis. Telematics and Informatics 35, 1 (2018), 136 -- 147. [34] Alexander Pak and Patrick Paroubek. 2010. Twitter as a Corpus for Sentiment Analysis and Opinion Mining. In Proceedings of the International Conference on Language Resources and Evaluation, LREC 2010, 17-23 May 2010, Valletta, Malta. [35] Bo Pang, Lillian Lee, et al. 2008. Opinion mining and sentiment analysis. Foun- dations and Trends® in Information Retrieval 2, 1 -- 2 (2008), 1 -- 135. [36] Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. 2002. Thumbs up?: sen- timent classification using machine learning techniques. In Proceedings of the ACL-02 conference on Empirical methods in natural language processing-Volume 10. Association for Computational Linguistics, 79 -- 86. [37] Umashanthi Pavalanathan and Jacob Eisenstein. 2015. Emoticons vs. Emojis on Twitter: A Causal Inference Approach. CoRR abs/1510.08480 (2015). [38] Aliza Sarlan, Chayanit Nadam, and Shuib Basri. 2014. Twitter sentiment analysis. In Information Technology and Multimedia (ICIMU), 2014 International Conference on. IEEE, 212 -- 216. [39] Linfeng Song, Zhiguo Wang, Haitao Mi, and Daniel Gildea. 2016. Sense Em- bedding Learning for Word Sense Induction. In Proceedings of the Fifth Joint Conference on Lexical and Computational Semantics, *SEM@ACL 2016, Berlin, Germany, 11-12 August 2016. docs/reports/2016_emoji_report.pdf. [40] Emoji Research Team. 2016. 2016 Emoji Report. (2016). http://cdn.emogi.com/ [41] Quan-Hoang Vo, Huy-Tien Nguyen, Bac Le, and Minh-Le Nguyen. 2017. Multi- channel LSTM-CNN model for Vietnamese sentiment analysis. In Knowledge and Systems Engineering (KSE), 2017 9th International Conference on. IEEE, 24 -- 29. [42] Yequan Wang, Minlie Huang, Li Zhao, et al. 2016. Attention-based lstm for aspect-level sentiment classification. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. 606 -- 615. [43] Theresa Wilson, Janyce Wiebe, and Paul Hoffmann. 2005. Recognizing contextual polarity in phrase-level sentiment analysis. In Proceedings of the conference on human language technology and empirical methods in natural language processing. Association for Computational Linguistics, 347 -- 354. [44] Quanzeng You. 2016. Sentiment and emotion analysis for social multimedia: methodologies and applications. In Proceedings of the 2016 ACM on Multimedia Conference. ACM, 1445 -- 1449. [45] Quanzeng You, Liangliang Cao, Hailin Jin, and Jiebo Luo. 2016. Robust Visual- Textual Sentiment Analysis: When Attention meets Tree-structured Recursive Neural Networks. In Proceedings of the 2016 ACM Conference on Multimedia Conference, MM 2016, Amsterdam, The Netherlands, October 15-19, 2016. 1008 -- 1017. [46] Jianbo Yuan, Sean Mcdonough, Quanzeng You, and Jiebo Luo. 2013. Sentribute: image sentiment analysis from a mid-level perspective. In Proceedings of the Second International Workshop on Issues of Sentiment Discovery and Opinion Mining. ACM, 10. [47] Jianbo Yuan, Quanzeng You, and Jiebo Luo. 2015. Sentiment Analysis Using Social Multimedia. In Multimedia Data Mining and Analytics - Disruptive Innovation. 31 -- 59. https://doi.org/10.1007/978-3-319-14998-1_2 [48] Jichang Zhao, Li Dong, Junjie Wu, and Ke Xu. 2012. MoodLens: an emoticon- based sentiment analysis system for chinese tweets. In The 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '12, Beijing, China, August 12-16, 2012. 1528 -- 1531.
1911.12753
1
1911
2019-11-28T15:38:53
Inducing Relational Knowledge from BERT
[ "cs.CL", "cs.AI" ]
One of the most remarkable properties of word embeddings is the fact that they capture certain types of semantic and syntactic relationships. Recently, pre-trained language models such as BERT have achieved groundbreaking results across a wide range of Natural Language Processing tasks. However, it is unclear to what extent such models capture relational knowledge beyond what is already captured by standard word embeddings. To explore this question, we propose a methodology for distilling relational knowledge from a pre-trained language model. Starting from a few seed instances of a given relation, we first use a large text corpus to find sentences that are likely to express this relation. We then use a subset of these extracted sentences as templates. Finally, we fine-tune a language model to predict whether a given word pair is likely to be an instance of some relation, when given an instantiated template for that relation as input.
cs.CL
cs
Inducing Relational Knowledge from BERT Zied Bouraoui Jose Camacho-Collados CRIL - CNRS & Univ Artois, France Cardiff University, UK Steven Schockaert Cardiff University, UK [email protected] [email protected] [email protected] Abstract One of the most remarkable properties of word embeddings is the fact that they capture certain types of semantic and syntac- tic relationships. Recently, pre-trained language models such as BERT have achieved groundbreaking results across a wide range of Natural Language Processing tasks. However, it is unclear to what extent such models capture relational knowl- edge beyond what is already captured by standard word em- beddings. To explore this question, we propose a methodol- ogy for distilling relational knowledge from a pre-trained lan- guage model. Starting from a few seed instances of a given relation, we first use a large text corpus to find sentences that are likely to express this relation. We then use a subset of these extracted sentences as templates. Finally, we fine-tune a language model to predict whether a given word pair is likely to be an instance of some relation, when given an instantiated template for that relation as input. 1 Introduction Relation induction is the problem of predicting likely in- stances of a given relation based on some example instances of that relation. For instance, given the example pairs (paris, france), (tokyo, japan), (canberra, australia), a relation in- duction system should predict other instances of the capital- of relation (without explicitly being told that the relation of interest is the capital-of relation). By far the most common strategy is to treat this problem as a relation extraction prob- lem. In such a case, sentences mentioning the example pairs are extracted from a large corpus and some neural network model is trained on these sentences. To predict new instances of the relation, the resulting model can then be applied to other sentences from the given corpus. One of the most surprising aspects of word embeddings, such as those learned using Skip-gram (Mikolov et al. 2013) and GloVe (Pennington, Socher, and Manning 2014), is the fact that they capture relational knowledge, despite essen- tially being trained to capture word similarity. This is most clearly illustrated in the fact that predicting analogical word pairs is a commonly used benchmark for evaluating word embeddings. The problem of relation induction using word Copyright c(cid:13) 2020, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. embeddings has also been studied (Vylomova et al. 2016; Drozd, Gladkova, and Matsuoka 2016; Bouraoui, Jameel, and Schockaert 2018; Vuli´c and Mrksi´c 2018; Camacho- Collados, Espinosa-Anke, and Schockaert 2019). In this case, new instances of the relation are predicted based only on pre-trained word vectors. Compared to relation extrac- tion methods, the use of word vectors has the advantage that word pairs may be predicted even if they never co-occur in the same sentence, intuitively because they are sufficiently similar to the example pairs. Moreover, models that directly make predictions based on word vectors are much faster, among others because they do not have to retrieve relevant sentences from the corpus. On the other hand, relation in- duction methods based on word embeddings can be more noisy than those that rely on relation extraction. Recently, the use of pre-trained language models such as BERT (Devlin et al. 2019), GPT-2 (Radford et al. 2019), and XLNet (Yang et al. 2019) has led to substantial perfor- mance increases in a variety of Natural Language Processing (NLP) tasks. A natural question is thus whether such lan- guage models capture more relational knowledge than stan- dard word embeddings, and in particular whether they can lead to improved performance on the relation induction task. In particular, language models such as BERT and XLNet are trained to complete sentences containing blanks. By choos- ing sentences that express a relational property, we may thus be able to extract relational knowledge from these models. To explore this strategy, Table 1 contains some predictions made by BERT for a number of different sentences1. As can be seen, the performance is rather mixed. For example, this model does not seem to capture color properties, predict- ing either yellow or white for all examples, whereas it seems to have learned the capital-of relation well (notwithstanding the incorrect prediction for Brazil). The most important in- sight from Table 1 comes from the two sentences about the cause of recessions, where the addition of the word often makes a difference between a sensible prediction (inflation) and a meaningless one (stress). This suggests that even if language models capture relational knowledge, it is impor- 1We experimented with XLNet as well, but its predictions were less accurate than those of BERT, possibly due to the short length of these test sentences. Sentence The color of the banana is The color of the avocado is The color of the carrot is The color of the tomato is The color of the kiwi is The capital of Japan is The capital of France is The capital of Australia is The capital of the US is The capital of Brazil is . . . . . . . . . . Recessions are caused by . Recessions are often caused by Hangovers are caused by I took my umbrella because it was . He didn't go to school because it was a . . for breakfast. I like to have Her favorite subject in school was His favorite day of the week is They saw lots of scary animals such as and most other vegetables. He likes . . BERT yellow yellow yellow white white tokyo paris canberra washington santos inflation stress stress warm secret them english christmas bears potatoes . . Table 1: Predictions by the BERT-Large-Uncased pre- trained language model for selected sentences. tant to find the right sentences to extract that knowledge. In this paper, we propose a methodology for finding such trigger sentences based on a large text corpus. Similar as in relation extraction systems, we start by finding all sentences from the corpus that mention the example word pairs we have been given. We then filter these sentences to identify those that express the considered relation. To test whether a new word pair (s, t) is an instance of the same relation, we then replace the example word pairs from the remaining sentences by the pair (s, t) and use a language model (BERT in our experiments) to determine whether the resulting sen- tence is still natural. Crucially, note that the prediction about the pair (s, t) does not rely on any sentences from the corpus mentioning s and t. This means in particular that the accu- racy of the predictions relies purely on the relational knowl- edge that is captured in the pre-trained language model. We only use the text corpus to find predictive trigger sentences. 2 Related Work Inducing knowledge from word embeddings. Several au- thors have studied to what extent word embeddings capture meaningful attributional and relational knowledge. Most of these works are inspired by the finding of Mikolov, Yih, and Zweig (2013) that word embeddings capture analogies. For instance, Rubinstein et al. (2015) analyzed how well pre- trained Skip-gram and GloVe vectors are able to predict properties of nouns, focusing on both taxonomic properties (e.g. being a bird) and attributive properties (e.g. being dan- gerous). In general, they obtained encouraging results for taxonomic properties but concluded that the ability of word vectors to predict attributive properties is limited. Similarly, Gupta et al. (2015) show that word vectors can to some ex- tent predict ordinal attributes of cities and countries. For in- stance, they showed that countries can be ranked by GDP by training a linear regression model on the word vectors of the countries. The extent to which vector differences and other linear transformations between two words capture their re- lationship was also analyzed by subsequent works (Vylo- mova et al. 2016; Drozd, Gladkova, and Matsuoka 2016; Bouraoui, Jameel, and Schockaert 2018). While proved suc- cessful in many cases, and even somewhat supported by the- oretical insights (Arora et al. 2016; Allen and Hospedales 2019), simple linear transformations of word vectors have been found limiting in more general settings (Levy, Gold- berg, and Ramat-Gan 2014; Linzen 2016; Rogers, Drozd, and Li 2017; Nissim, van Noord, and van der Goot 2019). Another line of work has therefore advocated to directly learn relation vectors from distributional statistics, i.e. vec- tors encoding the relationship between two words (Washio and Kato 2018a; Jameel, Bouraoui, and Schockaert 2018; Espinosa Anke and Schockaert 2018; Joshi et al. 2019; Washio and Kato 2018b; Camacho-Collados et al. 2019). Inducing knowledge from language models. Recently, probing tasks have been used to better understand the na- ture of the representations learned by neural language mod- els, although most works have generally focused on lin- guistic aspects (Hewitt and Manning 2019; Goldberg 2019; Jawahar, Sagot, and Seddah 2019; Tenney, Das, and Pavlick 2019). More closely related to our work, Forbes, Holtzman, and Choi (2019) analyze to what extent properties and af- fordances of objects can be predicted using neural language models, by relying on manually chosen sentences. For in- stance, to determine whether accordions are squishy, they consider the sentence "An accordion is squishy". Whether the property applies or not is then predicted from the result- ing output of the language model (e.g. the output vector of the [CLS] token in the case of BERT). When training this classifier, they also fine-tune the pre-trained language model. Our work differs in that we consider arbitrary relations (as opposed to the object-property and object-affordance rela- tions) and the fact that we automatically identify the most appropriate trigger sentences for each relation. The prob- lem of extracting relational knowledge from the BERT lan- guage model was also studied very recently in Petroni et al. (2019). In this work, a wide range of relations is consid- ered, but their approach again depends on manually chosen trigger sentences. Another difference with our work is that they focus on predicting tail words t that are related to a given source word s, whereas we focus on relation classifi- cation. Finally, Bosselut et al. (2019) propose an automatic knowledge graph construction method based on transformer language models. However, they rely on large amounts of training data2, whereas we focus on settings where only a handful of training examples are given, thereby relying on the relational knowledge captured by BERT instead of the ability of the model to generalize. Within a broader context, the importance of finding the 2100K triples for learning 34 relation types for their Concept- Net experiments, and 710K training triples for ATOMIC. right input sentences when extracting knowledge from lan- guage models was also considered by Amrami and Gold- berg (2018). Specifically, they consider the problem of char- acterizing word senses using language models. For instance to characterize the sense of the word sound in the sentence "I liked the sound of the harpsichord", a standard approach would be to look at the predictions of a language model for of the harpsichord". However, they the input "I liked the found that better results can be obtained by instead consid- of the harpsi- ering the sentence "I liked the sound and chord". Finally, Logan IV et al. (2019) have pointed out that neural language models are severely limited in their ability to capture factual knowledge, which they use as a motivation to study knowledge graph enhanced language models. 3 Methodology In this section we describe a method for relation induction using language models. As highlighted in the introduction, a key challenge is to find the right linguistic pattern to use as input to the language model. Let us write φ(h, t) to denote a sentence which mentions some head word h and tail word t. For instance, consider the following sentence: φ(Paris, France) = Paris is the capital of France. We will treat such sentences as templates, which can be in- stantiated with different word pairs, e.g.: φ(Rome, Italy) = Rome is the capital of Italy. φ(Rome, France) = Rome is the capital of France. φ(Trump, Obama) = Trump is the capital of Obama. Our main intuition is that a language model should be able to recognize that the sentence φ(Rome, Italy) is natural, while φ(Rome, France) and φ(Trump, Obama) are not. Note, how- ever, that this example relies on the fact that the template φ is indicative of the capital-of relation. Clearly this is not the case for all sentences mentioning Paris and France. For in- stance, consider the following sentence: φ′(Paris, France) = The Eiffel tower is in Paris, France. A sentence such as φ′(Rome, Italy) is clearly not natural, hence we cannot use φ′ to find new instances of the capital- of relation. Let us assume that the following examples of a given relation are given: {(s1, t1), ..., (sn, tn)}. Based on the aforementioned intuitions, we propose a strategy for finding likely additional instances of that relation, consist- ing of the following three steps: 1. Find all sentences φ(si, ti) mentioning the source and tar- get word of one of the given examples. 2. Filter the resulting templates φ, keeping only those which seem to express the considered relationship. In partic- ular, to determine the adequacy of a template φ, we check whether a pre-trained language model can predict the corresponding tail words t1, ..., tn from the sentences φ(s1, ), ..., φ(sn, ) and the corresponding head words h1, ..., hn from the sentences φ( , t1), ..., φ( , tn). 3. Fine-tune a language model to predict from instantiations φ(s, t) of the remaining templates whether (s, t) is likely to be an instance of the relation. We now explain these steps in more detail. 3.1 Finding Candidate Sentences The first step is straightforward. Given a set of word pairs R = {(s1, t1), ..., (sn, tn)}, we extract all sentences men- tioning one of these word pairs (si, ti). We will use a Wikipedia corpus for this purpose, although other large cor- pora would also be suitable. We only consider sentences with at most 100 words and a maximum window size of 15 between the occurrences of the words si and ti. 3.2 Filtering Templates Let φ1(x1, y1), ..., φm(xm, ym) be the set of all sentences extracted for the given set of word pairs R, where (xi, yi) ∈ R for every i. The aim of the filtering step is to select templates φj which are such that most of the sentences φj(s1, t1), ..., φj(sn, tn) are natural. In other words, we want to identify sentences φj (xj, yj) which express the con- sidered relationship in general, rather than being specifically about xj and yj . For many of the extracted sentences this may not be the case, as they might simply mention the two words for an unrelated reason (e.g. "Paris Hilton arrived in France today.") or they might only be sensible for the par- ticular word pair (e.g. "The Eiffel Tower is located in Paris, France."). Moreover, some sentences may not directly ex- press the considered relationship, but might nonetheless pro- vide some useful evidence. Consider for instance the follow- ing sentences: φ1 : φ2 : φ3 : Paris is located in central France. Paris is the largest city in France. Paris is one of the oldest cities in France. (1) (2) (3) While none of these sentences asserts the capital-of rela- tionship, a word pair (s, t) for which the assertions φ1(s, t), φ2(s, t) and φ3(s, t) are all true is nonetheless likely to be an instance of the capital-of relation. The problem we con- sider is thus to rank the templates φ1, ..., φm by their useful- ness. If there are any templates that directly express the rela- tion, then those should ideally be used. However, for many commonsense relations, we may not have such sentences as commonsense knowledge is rarely asserted explicitly (Gor- don and Durme 2013), in which case we have to instead rely on sentences providing indirect evidence, such as (1) -- (3). To assess the usefulness of the template φi, we use a pre- trained BERT model to fill in the blanks in the sentences φi(s1, ), ..., φi(sn, ) and φi( , t1), ..., φi( , tn), where we write e.g. φi(s1, ) for the sentence φi(s1, t1) in which t1 was replaced by a blank. Note that other masked language models such as XLNet could also be used. We then sim- ply count for how many of these 2n sentences the correct word was among the top-k predictions. Specifically, let us write Tij for the set of top-k predictions for the sentence φi(sj, ) and Sij for the set of top-k predictions for the sen- tence φi( , tj). The templates φi are then ranked based on the following score: score1(φi) = n X j=1 1[sj ∈ Sij] + 1[tj ∈ Tij] (4) where 1[sj ∈ Sij ] is 1 if sj ∈ Sij holds and 0 otherwise, and similar for 1[tj ∈ Tij]. Given the large number of extracted sentences and the possibly large set of pairs in R, applying this score to all sen- tences would be prohibitively expensive. Therefore, we first select a subset of the templates φ1, ..., φm based on a faster scoring function. In particular, for each sentence φi(xi, yi), we use the language model to obtain the top-k predictions Ti for the variant φi(xi, ), and the top-k predictions Si for the variant φi( , yi). Then we use the following score: score2(φi) = Si ∩ {s1, ..., sn} + Ti ∩ {t1, ..., tn} (5) Note that with this score, we only need to make two top-k predictions for each of the sentences, whereas (4) requires us to make 2n predictions for each sentence. The score (5) intuitively checks whether most of the top-k predictions are of the correct type. In other words, even if the predictions made by the language model are wrong, if they are at least of the correct type (e.g. the name of a country, if we are predicting the tail word of a capital-of relation), we can have some confidence that the template is meaningful. 3.3 Fine-tuning BERT Let us write ψ1, ..., ψk for the templates that were selected after the filtering step. It is straightforward to use these tem- plates for link prediction, which is the task of finding a tail word t, given some source word s, such that (s, t) is an in- stance of the considered relation. Indeed, to find plausible tail words t, we can simply aggregate the predictions that are made by a masked language model for the sentences φ1(s, ), ..., φk(s, ). Our main focus, however, is on re- lation induction. More specifically, given a candidate pair (s, t) we consider the problem of determining whether (s, t) is likely to be a correct instance of the considered relation. In this case, it is not sufficient that t is predicted for some sentence φi(s, ). To illustrate this, consider the following non-sensical instantiation of a capital-of template: The capital of Macintosh is . One of the top predictions3 by the BERT-Large-Uncased model is Apple, which might lead us to conclude that (Mac- intosh, Apple) is an instance of the capital-of relation. Rather than trying to classify a given word pair (s, t) by filling in blanks, we will therefore use the full sentence φ(s, t) as input to the BERT language model, and train a classifier on top of the output produced by BERT. In partic- ular, we use the output vector for the [CLS] token, which has been shown to capture the overall meaning of the sentence (Devlin et al. 2019). Our hypothesis is that the vector h[CLS] which is predicted for the [CLS] token will capture whether the input sentence is natural or unusual, and thus whether (s, t) is likely to be a valid instance of the relation. In partic- ular, we add a classification layer that takes the h[CLS] vec- tor as input and predicts whether the input sentence φi(s, t) is a correct assertion, i.e. whether the pair (s, t) is an in- stance of the considered relation. Note that a single classi- fier is trained for each given relation (i.e. regardless of which template φi was used to construct the input sentence). Since 3The only two higher ranked words were macintosh and mac. the way in which we use the output from BERT is differ- ent from how it was trained, we fine-tune the parameters of BERT while training the classification layer. The given set R contains positive examples of word pairs that have the considered relation. However, to train the clas- sifier we also need negative examples. To this end, fol- lowing Vylomova et al. (2016), we follow two strategies for corrupting the examples from R. First, for an instance (s, t) ∈ R we use (t, s) as a negative example (provided that (t, s) /∈ R). Second, we also construct negative exam- ples of the form (si, tj) by combining the source word of one pair from R with the tail word of another pair. For the classification layer, we use a linear activation function, with a binary cross-entropy loss. To optimize the loss function, we uses Adam with fixed weight decay and warmup linear schedule. 3.4 Relation Classification Given a word pair (s, t), we obtain k predictions about whether this pair is likely to be an instance of the relation, i.e. one prediction for each considered template. Let us write the corresponding probabilities as p1(s, t), ..., pk(s, t). To combine these predictions, we consider two strategies. With the first strategy, we predict (s, t) to be a positive example if maxi pi(s, t) > 1 − mini pi(s, t). We will refer to this model as BERTmax. In other words, in this case we check whether there is a positive prediction which has higher con- fidence than any of the negative predictions. For the second strategy, we instead look at an average (or sum) across all templates. In particular, we then predict (s, t) to be posi- tive if Pi pi(s, t) ≥ λ, with λ a threshold which is selected based on held-out tuning data. We will refer to this model as BERT∗. 4 Experiments In this section, we experimentally analyze the performance of our method. Our main question of interest is whether the proposed method allows us to model relations in a better way than is possible with pre-trained word vectors. 4.1 Experimental Setting Benchmark datasets. We consider relations taken from the following three standard benchmark datasets: • the Google analogy Test Set (Google), which contains 14 types of relations with a varying number of instances per relation (Mikolov et al. 2013); • the Bigger Analogy Test Set (BATS), which contains 40 relations with 50 instances per relation (Gladkova, Drozd, and Matsuoka 2016); • the DiffVec Test Set (DV) contains 36 relations with a varying number of instances per relation (Vylomova et al. 2016). Note that while these datasets contain both syntactic and semantic relationships, we can expect that the proposed method is mostly tailored towards semantic relationships. Experimental design. For all datasets, we consider the cor- responding relations in isolation, i.e. we model the relation SVMglove SVMsg Transglove Transsg BERTmax BERTmax BERTmax BERT∗ BERT∗ BERT∗ 50 50 100 1000 100 1000 Google DiffVec BATS pr 45.7 49.4 76.9 73.1 85.2 86.8 75.8 78.6 79.4 76.9 rec 70.2 68.9 72.5 74.3 67.1 69.3 58.2 61.8 63.7 51.0 f1 55.3 57.5 74.6 73.6 75.0 77.0 65.8 69.1 70.6 61.3 pr 32.7 38.5 39.6 47.3 58.1 59.5 52.9 51.1 63.2 53.1 rec 52.7 47.2 59.6 72.6 43.4 46.7 40.3 39.2 47.8 38.5 f1 40.3 42.4 47.5 57.2 49.6 52.8 45.7 44.3 54.4 44.6 pr 42.3 42.9 53.4 63.1 57.3 60.3 56.3 50.3 59.2 57.6 rec 55.6 61.3 65.6 70.6 36.5 41.7 37.1 32.4 44.5 35.3 f1 48.0 50.4 58.8 66.6 44.5 49.5 44.7 39.4 50.8 43.7 Table 2: Overview of the experimental results. induction task as a binary classification problem. To this end, for a given relation, we first split the set of available exam- ples in two sets: a training set that contains 90% of words pairs and a test set that contains the remaining 10%. We use the examples from the training set to find relevant sen- tences (i.e., sentences where these word pairs in the relation co-occur) from the English Wikipedia corpus4. These sen- tences are filtered to find predictive patterns, and to train the classifiers and fine-tune the BERT-Large-Uncased lan- guage model5. To filter the set of templates, we first select the top 1000 templates using (5), for each considered rela- tion. We then select the K most promising templates among them, using (4). We will separately show results for K = 50, K = 100 and K = 1000. The test set is used to evaluate the model. Note that the test set only contains positive examples. To generate nega- tive test examples, we follow the strategies proposed by Vy- lomova et al. (2016). First, we consider the two strategies that we also used for generating negative examples for train- ing the classifiers. In particular, for each pair (s, t) in the test set, we add (t, s) as a negative example, and for each source word s in the test set, we randomly sample two target words from the test set (provided that the test set contains enough pairs), each time verifying that the generated negative ex- amples do not in fact occur as positive examples. Further- more, for each positive example, we also randomly select an instance from one of the other relations. Finally, for each positive example, we generate one random word pair from the set of all words that occur in the dataset. This ensures that the evaluation involves negative examples that consist of related words as well as negative examples that consist of unrelated words. Note that the number of negative examples is thus five times higher than the number of positive exam- ples, which makes the task quite challenging. Baselines. The use of word vector differences is a common choice for modelling relations using pre-trained word em- beddings. As a first baseline we will consider a linear SVM classifier, but with more informative features than the vector difference. In particular, following Vu and Shwartz (2018) 4We used the dump of May 2016. 5We used the BERT implementation available at https://github. com/huggingface/transformers we will represent a given word pair (s, t) as s ⊕ t ⊕ (s ⊙ t), where we write ⊕ for vector concatenation, s and t are the vector representations of s and t, and we write s ⊙ t for the component-wise product of s and t. As a second baseline, we will use the model from Bouraoui, Jameel, and Schock- aert (2018), which learns a Gaussian distribution over vector differences that are likely to correspond to word pairs from the considered relation. This distribution is combined with two other Gaussian distributions, which respectively capture the distribution of words that are likely to appear as source words (in valid instances of the relation) and the distribution of words that are likely to appear as target words. We refer to this baseline as Trans. It was shown in (Bouraoui, Jameel, and Schockaert 2018) to outperform SVM classifiers trained on the vector difference. Note that while the SVM baseline uses the same positive and negative examples for training as our model, the Trans baseline is a generative model which only uses the positive examples. Word representation. As static word embeddings for the baselines, we will use the Skip-gram word vectors that were pre-trained from the 100B words Google News data set6 (SG-GN) and GloVe word vectors which were pre-trained from the 840B words Common Crawl data set7 (GloVe-CC). 4.2 Results An overview of the results is presented in Table 2. In this ta- ble, for our model, we show results for three different values of K (i.e. the number of selected templates after filtering), which are indicated in subscript. We can see that there are no consistent differences between the BERTmax and BERT∗ variants, and that the choices K = 100 outperforms K = 50 and K = 1000. Note that the choice K = 1000 corresponds to a setting where the scoring function (5) is not used. The weaker performance for that setting thus clearly shows the usefulness of our proposed scoring function. When compar- ing the results to the baselines, we can see that our model does not consistently outperform the Trans baseline. This is most notable in the case of BATS, where Trans performs overall much better. However, this is not unexpected given that these datasets contain a large number of morphological 6https://code.google.com/archive/p/word2vec/ 7https://nlp.stanford.edu/projects/glove/ Google gram1-adj-to-adv gram2-opposite gram3-comparative gram4-superlative gram5-present-participle gram6-nationality-adj gram7-past-tense gram8-plural gram9-plural-verbs l a c i g o l o h p r o M c currency i t n a m e S capital-common-countries capital-world family city-in-state 63.5 59.2 79.7 88.3 70.1 63.8 80.1 72.9 69.4 82.3 82.3 78.1 72.7 68.4 51.2 49.6 62.1 49.4 56.1 58.3 54.2 68.9 51.1 60.1 73.4 62.0 52.3 57.2 49.9 68.5 78.4 86.6 68.9 79.6 67.6 48.8 65.8 93.6 91.2 89.5 88.2 79.6 Table 3: Breakdown of results for the Google analogy dataset (F1). relationships (often also referred to as syntactic relations in this context), and there is not reason to expect why our pro- posed method should be able to perform well on such rela- tions. For instance, we are unlikely to find many meaningful templates which express that t is the plural of s. Therefore, in Tables 3 -- 5, we compare the performance for the individual relations contained in the three datasets. In this case, we only show results for the BERTmax 100 variant of our model. The results on the Google analogy dataset in Table 3 clearly show that for semantic relations, our model substantially outperforms the two baselines. This is most clear for the family relation (e.g. "boy is to girl like brother is to sister"), where we observe an improvement of more than 15 percentage points over Trans and almost 36 per- centage points over the SVM. This is especially surprising, since the family relation is largely about gender differences, which are normally captured well in word embeddings. For the morphological relations, as expected, our approach was outperformed by the Trans baseline. Note that this does not reflect the ability of language models to capture morpholog- ical relations, as neural language models are in fact known to be particularly strong in that respect. Rather, this is a con- sequence of the way in which our templates are obtained, and the fact that morphological relations are typically not explicitly asserted in sentences. The results for DiffVec in Table 4 follow a similar pat- tern. For the morphological relations, in this case, our model performs particularly poorly. For instance, for the Verb 3rd relation (e.g. accept-accepts), the Trans baseline achieves an F1 score of 97.0, compared to only 20.3 for our model. As already mentioned, however, it is not unexpected that our model is unsuitable for such relations. More surprising, per- haps, is the fact that our model also performs poorly on lex- ical relations such as hypernymy, where the Trans baseline achieves an F1 score of 73.6 compared to only 54.3 for our model. For the other types of relations however, our model consistently outperforms the baseline (with the Expression relation as the only exception). These other relations are about attributive knowledge, causality, and other forms of commonsense knowledge. Transsg SVMsg BERTmax 100 DiffVec Transsg SVMsg BERTmax 100 r t t A y t i l a s u a C a c i x e L e s n e s n o m m o C . Action:ObjectAttribute Object:State Object:TypicalAction Action/Activity:Goal Agent:Goal Cause:CompensatoryAction Cause:Effect EnablingAgent:Object Instrument:Goal Instrument:IntendedAction Prevention l Collective noun Hyper Lvc Mero Event Concealment Expression Knowledge Plan Representation Sign:Significant Attachment Contiguity Item:Location Loc:Action/Activity Loc:Instr/AssociatedItem Loc:Process/Product Sequence Time:Action/Activity l Noun Singplur a c i g o l o h p r o M Prefix re Verb 3rd Verb 3rd Past Verb Past Vn-Deriv 19.2 56.2 25.3 31.9 43.5 59.1 63.4 34.3 56.8 62.9 70.1 55.6 73.6 75.0 64.6 50.2 42.1 80.3 70.1 56.5 48.2 38.1 36.4 61.2 28.1 74.8 42.0 47.2 62.8 57.2 53.0 71.5 97.0 95.3 82.1 75.5 20.1 32.1 35.4 29.3 36.7 46.8 42.4 45.5 41.2 39.2 53.2 40.8 41.5 75.6 41.4 39.8 32.4 52.3 51.4 32.3 39.7 30.2 41.0 32.8 32.1 51.3 44.9 56.6 50.2 53.7 38.5 30.2 38.4 32.2 61.3 63.1 35.2 58.0 49.0 57.1 53.9 63.4 64.0 58.7 60.5 68.8 72.1 38.1 54.3 37.4 47.5 57.8 52.7 79.3 72.4 62.3 50.1 41.1 52.9 70.8 54.2 77.4 69.0 64.3 74.9 59.1 33.5 19.6 20.3 21.9 26.6 25.0 Table 4: Breakdown of results for the DiffVec dataset (F1). Finally, for BATS (Table 5) we see poor performance on morphological relations, mixed performance on lexical rela- tions such as hypernymy and meronymy, and strong results for encyclopedic relations, which is in line with the results we obtained for the other datasets. Note in particular that the model was able to obtain reasonable results for the has- color relation (thing:color), which was not possible with the simple hand-coded pattern we used in Table 1. 4.3 Qualitative analysis Finally, we shed some light on the kinds of templates that were identified with our method (see Section 3.2). Table 6 shows five templates which were obtained for the currency and capital-of relations. The first three examples on the right are templates which all explicitly mention the capital-of re- lationship, but they offer more linguistic context than typi- cal manually defined templates, which makes the sentences more natural. In general, we have found that BERT tends to struggle with shorter sentences. There are also patterns that give more implicit evidence of a capital-of relationships, such as the two last ones for the capital-of relation. These Currency Capital-of Sales of all products and services traded online in * in 2012 counted 311.6 billion * As is often the case in *, lottery ticket prices above the 80 * threshold are negotiable Summer olympics, which were in *, the capital of the home country, * The main international airport serves *, the capital of and most populous city in * The Government of * donated 300 million * to finance the school's construction in 1975 It is located in *, the capital of * On his return to *, he had made 18,000 * on an initial investment of 4,500 In 2006, he portrayed John Morton on a tour of * arranged by the US Embassy in * The cost of vertebroplasty in * as of 2010 was 2,500 * At the time, Jefferson was residing in *, while serving as American Minister to * Table 6: Automatically-extracted templates filtered by BERT associated with the currency and capital-of relations from the Google analogy dataset. BATS Regular plurals Plurals - orth. changes Comparative degree Superlative degree Infinitive: 3Ps.Sg Infinitive: participle Infinitive: past Participle: 3Ps.Sg Participle: past 3Ps.Sg: past Noun+less Un+adj Adj+ly Over+adh./Ved Adj+ness Re+verb Verb+able Verb+er Verb+ation Verb+ment Hypernyms animals Hypernyms misc Hyponyms misc Meronyms substance Meronyms member Meronyms part-whole Synonyms intensity Synonyms exact Antonyms gradable Antonyms binary Capitals Country:language UK city: county Nationalities Occupation Animals young Animals sounds Animals shelter thing:color male:female l a c i g o l o h p r o M l a c i x e L c i d e p o l c y c n E Transsg SVMsg BERTmax 100 76.3 76.0 76.2 82.1 82.0 79.4 70.9 78.3 76.3 86.4 62.5 71.2 73.0 71.1 72.5 75.1 73.8 60.2 58.9 60.6 63.6 78.1 54.6 53.1 70.2 49.5 46.7 41.3 49.3 49.6 68.6 62.8 61.6 83.3 61.8 51.2 60.1 45.8 75.6 76.9 40.8 48.1 47.5 59.5 59.8 62.7 52.0 62.9 56.7 65.8 43.8 40.5 39.8 41.5 53.6 56.8 55.3 53.3 46.6 48.1 64.5 56.2 50.9 37.8 57.1 52.3 35.6 29.9 51.9 33.3 52.1 53.5 48 61.5 49.9 50.7 45.9 45.2 58.9 49.3 35.0 25.5 50.2 53.3 25.5 33.3 35.1 29.9 36.7 25.9 26.6 28.8 35.5 36.7 30.5 33.9 25.4 42.3 28.8 40.7 71.8 78.8 61.3 50.4 56.6 58.2 50.8 48.7 48.5 54.5 73.2 69.5 71.8 84.4 72.6 68.2 63.1 63.3 76.5 79.0 Table 5: Breakdown of results for the BATS dataset (F1). capture indirect evidence, e.g. the fact that embassies are usually located in the capital of a country. We also carried out a preliminary comparison with the kind of short manually defined patterns that have been used in previous works. In our setting, we found the performance of such manually specified templates to be poor, which could suggest that BERT struggles with short sentences. In Table 7 we show some examples of simple hand-crafted templates Dataset Manual template Relation Score Hand Auto Google * is the capital of * * is the currency of * capital-world 51.4 46.2 currency DiffVec * is found in the * item:location 28.6 * is used to conceal * concealment 25.7 89.5 93.6 54.2 52.7 Table 7: Hand-crafted templates associated with specific re- lations and their F1 scores. The score obtained with our au- tomatic pipeline is shown as reference under "Auto". in the line of Petroni et al. (2019) and their performance in comparison with our automatically-constructed ones. Note that the results are not strictly comparable as our model uses multiple templates. However, this result does reinforce the importance of using automatic methods to extract templates. Moreover, for many of the diverse relationships which can be found in DiffVec, for example, it can be difficult to come up with meaningful patterns manually. 5 Conclusions We have studied the question of whether, or to what extent, relational knowledge can be derived from pre-trained lan- guage models such as BERT. In particular, we have shown that high-quality relational knowledge can be obtained in a fully automated way, without requiring any hand-coded tem- plates. The main idea is to identify suitable templates us- ing a text corpus, by selecting sentences that mention word pairs which are known to be instances of the considered rela- tion, and then filtering these sentences to identify templates that are predictive of the relation. We have experimentally obtained strong results, although the method is not suitable for all types of relations. In particular, as could be expected, we found that our proposed method is not suitable for mor- phological relations. More surprisingly, we also found that it performs broadly on par with methods that rely on pre- trained word vectors when it comes to lexical relations such as meronymy and hypernymy. However, for relations that re- quire encyclopedic or commonsense knowledge, we found that our model consistently, and often substantially, outper- formed methods relying on word vectors. This shows that the BERT language model indeed captures commonsense and factual knowledge to a greater extent than word vectors, and that such knowledge can be extracted from these models in a fully automated way. Acknowledgments. Steven Schockaert was funded by ERC Starting Grant 637277. References Allen, C., and Hospedales, T. M. 2019. Analogies explained: Towards understanding word embeddings. In Proc. ICML. Amrami, A., and Goldberg, Y. 2018. Word sense induction with neural biLM and symmetric patterns. In Proc. EMNLP, 4860 -- 4867. Arora, S.; Li, Y.; Liang, Y.; Ma, T.; and Risteski, A. 2016. A latent variable model approach to pmi-based word embed- dings. TACL 4:385 -- 399. Bosselut, A.; Rashkin, H.; Sap, M.; Malaviya, C.; Celiky- ilmaz, A.; and Choi, Y. 2019. COMET: Commonsense transformers for automatic knowledge graph construction. In Proc. ACL, 4762 -- 4779. Bouraoui, Z.; Jameel, S.; and Schockaert, S. 2018. Relation induction in word embeddings revisited. In Proc. COLING. Camacho-Collados, J.; Espinosa-Anke, L.; Jameel, S.; and Schockaert, S. 2019. A latent variable model for learning distributional relation vectors. In Proc. IJCAI. Camacho-Collados, J.; Espinosa-Anke, L.; and Schockaert, S. 2019. Relational word embeddings. In Proc. ACL. Devlin, J.; Chang, M.; Lee, K.; and Toutanova, K. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In Proc. NAACL-HLT. Drozd, A.; Gladkova, A.; and Matsuoka, S. 2016. Word embeddings, analogies, and machine learning: Beyond king - man + woman = queen. In Proc. COLING, 3519 -- 3530. Espinosa Anke, L., and Schockaert, S. 2018. SeVeN: Aug- menting word embeddings with unsupervised relation vec- tors. In Proc. COLING, 2653 -- 2665. Forbes, M.; Holtzman, A.; and Choi, Y. 2019. Do neu- ral language representations learn physical commonsense? Proc. of the Conference of the Cognitive Science Society. Gladkova, A.; Drozd, A.; and Matsuoka, S. 2016. Analogy- based detection of morphological and semantic relations with word embeddings: what works and what doesn't. In Proc. of the Student Research Workshop at NAACL, 8 -- 15. Goldberg, Y. 2019. Assessing bert's syntactic abilities. CoRR abs/1901.05287. Gordon, J., and Durme, B. V. 2013. Reporting bias and knowledge acquisition. In Proc. AKBC, 25 -- 30. Gupta, A.; Boleda, G.; Baroni, M.; and Pad´o, S. 2015. Dis- tributional vectors encode referential attributes. In Proc. EMNLP, 12 -- 21. Hewitt, J., and Manning, C. D. 2019. A structural probe for finding syntax in word representations. In Proc. NAACL, 4129 -- 4138. Jameel, S.; Bouraoui, Z.; and Schockaert, S. 2018. Unsu- pervised learning of distributional relation vectors. In Proc. ACL, 23 -- 33. Jawahar, G.; Sagot, B.; and Seddah, D. 2019. What does BERT learn about the structure of language? In Proc. ACL, 3651 -- 3657. Joshi, M.; Choi, E.; Levy, O.; Weld, D. S.; and Zettlemoyer, L. 2019. pair2vec: Compositional word-pair embeddings for cross-sentence inference. In Proc. NAACL. Levy, O.; Goldberg, Y.; and Ramat-Gan, I. 2014. Linguistic regularities in sparse and explicit word representations. In Proc. CoNLL, 171 -- 180. Linzen, T. 2016. Issues in evaluating semantic spaces using word analogies. In Proc. of the Workshop on Evaluating Vector-Space Representations for NLP, 13 -- 18. Logan IV, R. L.; Liu, N. F.; Peters, M. E.; Gardner, M.; and Singh, S. 2019. Barack's wife hillary: Using knowledge graphs for fact-aware language modeling. In Proc. ACL, 5962 -- 5971. Mikolov, T.; Chen, K.; Corrado, G.; and Dean, J. 2013. Effi- cient estimation of word representations in vector space. In Proc. ICLR. Mikolov, T.; Yih, W.-t.; and Zweig, G. 2013. Linguistic reg- ularities in continuous space word representations. In Proc. NAACL, 746 -- 751. Nissim, M.; van Noord, R.; and van der Goot, R. 2019. Fair is better than sensational:man is to doctor as woman is to doctor. arXiv preprint arXiv:1905.09866. Pennington, J.; Socher, R.; and Manning, C. D. GloVe: Global vectors for word representation. EMNLP, 1532 -- 1543. 2014. In Proc. Petroni, F.; Rocktaschel, T.; Riedel, S.; Lewis, P.; Bakhtin, A.; Wu, Y.; and Miller, A. 2019. Language models as knowl- edge bases? In Proc. EMNLP, 2463 -- 2473. Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; and Sutskever, I. 2019. Language models are unsupervised mul- titask learners. Technical Report. Rogers, A.; Drozd, A.; and Li, B. 2017. The (too many) problems of analogical reasoning with word vectors. In Proc. *SEM, 135 -- 148. Rubinstein, D.; Levi, E.; Schwartz, R.; and Rappoport, A. 2015. How well do distributional models capture different types of semantic knowledge? In Proc. ACL, 726 -- 730. Tenney, I.; Das, D.; and Pavlick, E. 2019. BERT rediscovers the classical NLP pipeline. In Proc. COLING, 4593 -- 4601. Vu, T., and Shwartz, V. 2018. Integrating multiplicative fea- tures into supervised distributional methods for lexical en- tailment. In Proc. *SEM, 160 -- 166. Vuli´c, I., and Mrksi´c, N. 2018. Specialising word vectors for lexical entailment. In Proc. NAACL, 1134 -- 1145. Vylomova, E.; Rimell, L.; Cohn, T.; and Baldwin, T. 2016. Take and took, gaggle and goose, book and read: Evaluating the utility of vector differences for lexical relation learning. In Proc. ACL. Washio, K., and Kato, T. 2018a. Filling missing paths: Mod- eling co-occurrences of word pairs and dependency paths for recognizing lexical semantic relations. In Proc. NAACL. Washio, K., and Kato, T. 2018b. Neural latent relational analysis to capture lexical semantic relations in a vector space. In Proc. EMNLP, 594 -- 600. Yang, Z.; Dai, Z.; Yang, Y.; Carbonell, J.; Salakhutdinov, R.; and Le, Q. V. 2019. XLNet: Generalized autoregressive pretraining for language understanding. arXiv:1906.08237.
1703.09825
1
1703
2017-03-28T22:05:20
Semi-Supervised Affective Meaning Lexicon Expansion Using Semantic and Distributed Word Representations
[ "cs.CL" ]
In this paper, we propose an extension to graph-based sentiment lexicon induction methods by incorporating distributed and semantic word representations in building the similarity graph to expand a three-dimensional sentiment lexicon. We also implemented and evaluated the label propagation using four different word representations and similarity metrics. Our comprehensive evaluation of the four approaches was performed on a single data set, demonstrating that all four methods can generate a significant number of new sentiment assignments with high accuracy. The highest correlations (tau=0.51) and the lowest error (mean absolute error < 1.1%), obtained by combining both the semantic and the distributional features, outperformed the distributional-based and semantic-based label-propagation models and approached a supervised algorithm.
cs.CL
cs
Semi-Supervised Affective Meaning Lexicon Expansion Using Semantic and Distributed Word Representations Areej Alhothali David R. Cheriton School of Computer Science University of Waterloo Jesse Hoey David R. Cheriton School of Computer Science University of Waterloo Waterloo, Ontario, N2L3G1 Waterloo, Ontario, N2L3G1 [email protected] [email protected] Abstract In this paper, we propose an extension to graph-based sentiment lexicon induction methods by incorporating distributed and semantic word representations in building the similarity graph to expand a three- dimensional sentiment lexicon. We also implemented and evaluated the label prop- agation using four different word repre- sentations and similarity metrics. Our comprehensive evaluation of the four ap- proaches was performed on a single data set, demonstrating that all four methods can generate a significant number of new sentiment assignments with high accuracy. The highest correlations (τ = 0.51) and the lowest error (mean absolute error < 1.1%), obtained by combining both the semantic and the distributional features, outperformed the distributional-based and semantic-based label-propagation models and approached a supervised algorithm. 1 Introduction Sentiment analysis (SA) is a rapidly growing area of interest in natural language processing (NLP). Sentiment analysis is useful for a variety of impor- tant applications, such as recommendation system, virtual assistants, and health informatics. Much SA relies on lexicons mapping words to senti- ment, which are either manually annotated or au- tomatically generated from a small set of seed words. Many researchers and companies have ex- plored methods of expanding and re-generating sentiment lexicons to reduce the cost of man- ual annotation and to compensate for the lack of existing annotated data and the dynamic and fluctuating nature of human emotion. However, most sentiment lexicon expansion methods at- tach a polarity value (i.e., negative, positive, or neutral) (Stone et al., 1968) or real-valued one- dimensional scores (Baccianella et al., 2010) to the words. It is well known; however, that one di- mension is insufficient to adequately characterise the complexity of emotion (Fontaine et al., 2007). In a large set of cross-cultural studies in the 1950s, Osgood showed that concepts carried a cul- turally dependent, shared affective meaning that could be characterised to a great extent using three simple dimensions of evaluation (good ver- sus bad), potency (powerful versus powerless), and activity (lively versus quiet) (Osgood, 1957). This semantic differential scale of evaluation, po- tency, and activity (EPA) is thought to represent universal and cross-cultural dimensions of affec- tive meaning for words. Based on this work, several three-dimensional sentiment lexicons have been manually labeled us- ing surveys in different countries (Heise, 2010). Words in these lexicons are measured on a scale from −4.3 (infinitely bad, powerless, or in- active) to +4.3 (infinitely good, powerful, or lively) (Berger and Zelditch, 2002; Heise, 2007).1 In these surveys, participants are asked to rate identities (e.g., teacher, mother), behaviors (e.g., help, coach), adjectives (e.g., big, stubborn), institutions (e.g., hospital, school) or scenarios (e.g. combinations of identities, behaviours, ad- (Heise, 2010) on 5- jectives and institutions) item scales ranging from "Infinitely negative (e.g., bad/powerless/inactive)" to "Infinitely pos- itive (e.g., good/powerful/active)", which are then mapped to the [−4.3, 4.3] scale. These man- 1The range [−4.3, 4.3] is a historical convention ual annotation methods are labor-intensive, time- consuming and they produce a relatively small number of words. In this paper, we utilize the semantic and distributed words representation to expand these three-dimensional sentiment lexicons in a semi- supervised fashion. We also evaluated four dif- ferent approaches of computing the affinity matrix using a semantic (dictionary-based) features, sin- gular value decomposition word embedding, neu- ral word embedding word vector, and combining both neural word embedding and semantic fea- tures. The highest results were obtained using the semantic and neural word embedding model with a rank correlation score τ = 0.51 on recreating two sentiment lexicon (Warriner et al., 2013) and the General Inquirer (Stone et al., 1968). The re- sults also show that the highest rank correlation scores of the three dimension were for evalua- tion (E) while the lowest were for the potency (P). We also evaluated our induced EPA scores against some of the state-of-the-art methods in lexicon ex- pansion, and our method shows an improvement in the τ correlation and F1 score over these algo- rithms. Our contributions are fivefold: 1) this is the first work that extensively examines methods of mul- tidimensional lexicon expansion (we compute the evaluation, potency, and activity (valence, domi- nance, and arousal) scores instead of only comput- ing the evaluative factor ( valence), 2) we propose a label propagation algorithm that is built upon both the semantic and distributed word represen- tations, 3) we performed a comprehensive evalu- ation of four algorithms against a manually anno- tated dataset as well as a supervised learning al- gorithm, 4) we sample seed words from the cor- pus or dictionary instead of using the commonly used fixed seed words (e.g., good, bad, happy, sad etc.), 5) we created a significantly large three- dimensional lexicon of ∼ 3M words that could be leveraged by researchers in fields of sentiment analysis and social science. Our proposed approaches 1) reduce the cost of manual annotation of sentiment lexicons; 2) inte- grate the affective meaning of today's' growing vocabulary (e.g., selfie, sexting), and 3) identify and incorporate the variance in attitudes towards words (e.g., same-sex marriage, abortion). 2 Related Work The lexicon augmentation methods in this study were performed using variations of word represen- tations and similarity metrics. This section pro- vides a short background about the various vector space models that are used. 2.1 Statistical language modeling Statistical language model (or vector space model (VSM)) is a distributional estimation of various language phenomena estimated by employing sta- tistical techniques on real world data. Represent- ing language phenomena in terms of parameters has proven to be useful in various natural language processing (NLP), speech recognition, and infor- mation retrieval (IR) tasks. To capture the seman- tic or syntactic properties and represent words as proximity in n-dimensional space, several VSMs have been proposed ranging from the simple one- hot representation that regards words as atomic symbols of the co-occurrence with other words in a vocabulary to a neural word embedding that rep- resents words in a dense and more compact repre- sentation. The most commonly used word representa- tion is the distributional word embeddings repre- senting word based on the co-occurrence statis- tics with other words in a document or cor- pora (Harris, 1981; Firth, 1957). The di- mensionality of this sparse representation can be reduced using Singular value decomposi- tion (Eckart and Young, 1936), Latent Semantic Analysis (Landauer and Dumais, 1997) or Princi- pal Component Analysis (Jolliffe, 2002). Neural word embeddings has recently gained a lot of attention in NLP and deep learning. Neu- ral word embeddings represent words in a low- dimensional, continuous space where each dimen- sion corresponds to semantic or syntactic latent features. Similar to distributional word embed- dings, neural word embeddings are usually based upon co-occurrence statistics, but they are more compact, less sensitive to data sparsity, and able to represent an exponential number of word clus- ters (Bengio et al., 2006) (Mikolov et al., 2010, 2011). 2.2 Acquisition of Sentiment Lexicon to other NLP tasks, Similar lexi- con induction methods can be achieved using two main approaches corpus-based or thesaurus- sentiment based. Turney and Littman (Turney et al., 2003) proposed a corpus-based lexicon learning method by first applying (TF-IDF) weighting on matrices of words and context, using SVD, and then com- puting the semantic orientation with a set of seed words. Thesaurus-based methods use the lexical rela- tionship such as the depth of a concept in taxon- omy tree (Wu and Palmer, 1994) or edge count- ing (Collins and Quillian, 1969) to build senti- ment lexicons. Similar to Turney's PMI approach (KAMPS, 2004) they use WordNet based related- ness metric between words and given seed words. Semi-supervised graph-based models that prop- lexical graphs have agate information over The polarity-propagation also been explored. or sense propagation algorithm induces senti- ment polarity of unlabeled words given seed words (positive, negative) and the lexical re- lationships between them (e.g., word-net syn- onym, antonym) (Strapparava and Valitutti, 2004; Esuli and Sebastiani, 2006). Some researchers have developed a weighted label propagation algorithm that propagates a continuous senti- ment score from seed words to lexically re- lated words (Godbole et al., 2007). Velikovich et al. (Velikovich et al., 2010) proposed web-based graph propagation to elicit polarity lexicons. The graph is built upon a co-occurrence frequency ma- trix and cosine similarity (edges) between words and seed words (nodes). Then, both a positive and a negative polarity magnitude will be computed for each node in the graph which is equal to the sum over the max weighted path from every seed word (either positive or negative). Several recent studies have utilized word em- beddings to generate sentiment lexicons, such as a regression model that uses structured skip- gram 600 word embedding to create a Twitter- based sentiment lexicon (Astudillo et al., 2015). Another study transforms dense word embed- ding vectors into a lower dimensional (ultra- dense) representation by training a two objec- tive function gradient descent algorithms on lex- icon resources (Rothe et al., 2016). A recent study has also proposed a label propagation based model that uses word embedding, built using singular value decomposition (SVD) and PMI, to induce a domain-specific sentiment lexi- con (Hamilton et al., 2016). Few studies have looked at multidimen- sional sentiment lexicon expansion. Kamps et al. (KAMPS, 2004) use a WordNet-based met- ric to elicit semantic orientation of adjectives. The generated lexicon was evaluated against the manually constructed list of Harvard IV-4 Gen- eral Inquirer (Stone et al., 1968). Kamps et al.'s work focuses only on adjectives and assigns them a binary value (either good or bad, potent or impotent, etc.). A three-dimensional sentiment lexicon was extended using a thesaurus-based label propagation algorithm based upon Word- Net similarity (Alhothali and Hoey, 2015), and their results were compared against the Ontario dataset (MacKinnon, 2006). 3 Method 3.1 Graph-based Label-Propagation other standard methods Andreevskaia and Bergler, Expanding sentiment lexicons using graph-based propagation algorithms was pursued previously and found to give higher accuracy in comparison (Hu and Liu, with 2004; 2006; To evaluate Rao and Ravichandran, 2009). the effectiveness of graph-based approaches in expanding multidimensional sentiment lexicons, in this paper, we use the label propagation algo- rithm (Zhu and Ghahramani, 2002; Zhou et al., 2004), combined with four methods for com- puting words vectors and word similarities. The label propagation algorithms rely on the idea of building a similarity graph with labeled (seed words/paradigm words) and unlabeled nodes (words). The labels or scores of the known nodes (words) are then propagated through the graph to the unlabeled nodes by repeatedly multiplying the weight matrix (affinity matrix) against the labels or scores vector. Following the same principle, the graph label propagation algorithm in this paper: 1) creates a set of labeled L = (Xl, Yl) and unlabeled data points or words U = (Xu, Yu) where U + L = V , V is all the words in the vocabulary set, X is the word, and Y is the sentiment (E, P, A scores) attached to that word; 2) constructs an undirected weighted graph G = {E, V, W } where V is a set of vertices (words), E edges, W is an V × V weight matrix ( where wij ≥ 0); 3) Compute the random walk normalized Laplacian matrix ∆ = D−1W (where D is the degree matrix); 4) ini- tializes the labeled nodes/words Yl with their EPA values, and the unlabeled nodes/words Yu with ze- roes; 4) propagates the sentiment scores to adja- cent nodes by computing Y ← ∆Y (weighted by a factor α) and clamps the labeled nodes Yl to their initial values L after each iteration. We implemented the label propagation algo- rithm using four different methods of computing affinity matrix and word representations. First, a semantic lexicon-based approach in which the graph is built based upon the semantic relation- ship between words (Semantic lexicon-based La- bel propagation or SLLP). Second, a distribu- tional based approach in which vocabulary and weights come from co-occurrence statistics in a corpus (corpus-based label propagation or CLP). Third, a neural word embeddings method (neural word embedding label propagation or NWELP), and fourth, a combination of semantic and distri- butional methods (semantic neural word embed- ding label propagation or SNWELP). The follow- ing subsections describe these four different meth- ods of label propagation. 3.1.1 Semantic Lexicon-based Label Propagation (SLLP) The SLLP algorithm follows the general principle of the graph-based label propagation approach as described in the previous section, but the affinity matrix W is computed using the semantic features obtained from semantic lexicons. Two semantic lexicons were used in this algorithm: WordNet dictionary (WN) (Miller, 1995) and the paraphrase database (PPDB) (Ganitkevitch et al., 2013). The SLLP algorithm constructs the vocabulary V from the words of the dictionaries and computes and normalizes the weight matrix W using the syn- onyms relationship between words. The semantic- based similarity wi,j of any pair of words xi and xj in the vocabulary V is calculated as follows: wi,j =(1.0 0.0 if xj is a synonym of xi otherwise (1) ∼ 265K blog articles and ∼ 734K news arti- cles (Corney et al., 2016) and the North American News (NAN) text corpus (Graff, 1995) which has ∼931K articles from a variety of news sources. These heuristics reduce the set The co-occurrence matrix R was computed on a window size of four words. Bigrams with stop words, words less than three letters, proper nouns, non-alpha words, and the bigrams that do not occur more than ten times were filtered into ∼ out. 80k and ∼ 40k, for SM and NAN corpora, re- spectively. We constructed the word vectors by computing the smoothed positive point-wise mu- tual information(SPPMI) (Levy et al., 2015) of the co-occurrence matrix R. This smoothing tech- nique reduces the PMI's bias towards rare words and found to improve the performance of NLP tasks (Levy et al., 2015). SPPMIij = max{(log2 p(wi, wj) p(wi)pα(wj) , 0)} (2) where p(wi, wj) is the empirical co-occurrence probability of a pair of words wi and wj and p(wi) and pα(wj) are the marginal probabil- ity of wi and the smoothed marginal probabil- ity of wj, respectively. We use α = 0.75 as it is found to give better results (Levy et al., 2015) (Mikolov et al., 2013) and we also exper- iment with the unsmoothed PPMI. The SPPMI matrix is then factorized with truncated Singular Value Decomposition (SVD) (Eckart and Young, 1936) as follows: SPPMI = U ∗ Σ ∗ VT (3) We take the top k rows of U as the word represen- tation or word vector (we used k=300): WSVD = Uk (4) The affinity matrix is then computed as: 3.1.2 Corpus-based Label Propagation (CLP) wij = cos(vi, vj) = Corpus-based label propagation (CLP) is one of the most commonly used methods for sentiment lexicon generation that uses the co-occurrence statistics aggregated from different corpora (news articles, Twitter, etc.) to build the similarity graph in the label propagation algorithms. We used an n-gram features from the signal media (SM) one million news articles dataset which contains vivj kvikkvjk , ∀vi, vj ∈ WSVD (5) 3.1.3 Neural Word Embeddings Label-propagation (NWELP) This method uses word embeddings (word- vectors) that capture syntactic and semantic properties. We use two pre-trained word embed- ding models that are trained on co-occurrence vector for word (Pennington et al., statistics. We used skip-gram word vector (SG) (Mikolov et al., 2013) that is trained on a skip-gram model of co-occurrence statis- tics aggregated from Google News dataset and Global representa- tion(GloVe) 2014) which have been trained on co-occurrence statistics aggregated from Wikipedia. The vocabulary V in this algorithm is all words in the word embeddings set (we filtered out non-alpha words and words that contain digits), and the affinity matrix W is computed using the cosine similarity (Equation 5) between word vectors (each vi ∈ V is a 300 dimensional vector). 3.1.4 Semantic and Neural Word Embeddings Label-propagation (SNWELP) To improve the results of the NWELP algorithm, we propose the SNWELP, a model that com- bines both semantic and distributional information obtained from the neural word embedding mod- els and a semantic lexicon (a dictionary). The SNWELP algorithm constructs the affinity matrix W using the neural word embeddings features (SG or GloVe) and semantic features obtained from a semantic lexicon (WN or PPDB). In this case, V is intersection between the words in lexicon and the word in the filtered embeddings set, W is the averaged cosine similarity scores (Equation 5) of the neural and the semantic word representations (Equation 1). 3.2 Sampling Methods Choosing the labeled words (also called paradigm or seed words) in the graph-based label prop- agation methods is one of the critical factors. We used two methods: 1) fixed seed sets (fixed-paradigms), and 2) words sampled from the vocabularies V used in the label propa- gation algorithm (vocabulary-paradigms). The fixed-paradigms set was chosen from Osgood et al's (Osgood, 1957) research as shown in Table 1 while the vocabulary-paradigms set was randomly sampled from the corpus' vocabulary for words with the highest and lowest EPA values (words with E, P or A ≤ −2.5 or ≥ 2.5). The objec- tive is to use words at extremes of each dimension E,P, and A, as paradigm words in order to propa- gate these highly influencing EPA throughout the graph. The seed words contribute to no more than 1% of all words in each algorithm. We tested with EPA Seed words E+={good, nice, excellent, positive, warm, correct, superior} E-={bad, awful, nasty, negative, cold, wrong, inferior} P+={powerful, strong, potent, dominant, big, forceful ,hard} P-={powerless, weak, impotent, small, incapable, hopeless, soft} A+={active, fast, noisy, lively, energetic, dynamic, quick, vital} A-={quiet, clam, inactive, slow, stagnant, inoperative, passive} Table 1: Osgood's fixed seed words (+ positive word and - negative words) the fixed-paradigms sets, but the results of the vocabulary-paradigms were significantly better. 3.3 Evaluation Metrics To evaluate the effectiveness of the algorithm in generating a multidimensional sentiment lexicon, we chose the most recent manually-annotated af- fective dictionary (Warriner et al., 2013) as base- line. We use the (Warriner et al., 2013) dictio- nary in the lexicon induction procedure by sam- pling the paradigm words from it and we com- pare the generated lexicon against it. We ran- domly divided the (Warriner et al., 2013) affective dictionary (original-EPA) into EPA-training (third of the set equal to 5566 words) and EPA-testing (two-thirds of the set equal to 8349 words). The seed words for all algorithms are sampled from the EPA-training set only, and all results are presented on the EPA-testing set. The EPA scores of (Warriner et al., 2013) ini- tially range ∈ [1, 9] and we rescaled them to ∈ [−4.3, +4.3] to follow the same EPA scale used in the other lexicons we have considered (Heise, 2010). The [−4.3, +4.3] scale is the standard scale used by most of the researchers in the sociology field who study or measure individuals' emotions towards terms. Four evaluation metrics were used to compare the induced EPA (EPA-induced) against the man- ually annotated EPA (EPA-testing): mean abso- lute error (MAE), Kendall τ rank correlation, F1-binary (positive and negative), and F1-ternary (positive, neutral, and negative). We used F1- binary to evaluate the binary classification per- formance of the model (positive ≥ 0 and neg- ative < 0 ) and similar to most recently pro- posed studies in the field (Hamilton et al., 2016), we computed F1-ternary to measure the ternary classification accuracy: positive ∈ (1, 4.3], neutral ∈ [−1, 1], and negative ∈ [−4.3, −1). To calcu- late the F1-ternary, we used the class-mass nor- malization (CMN) methods (Zhu et al., 2003) that rescale the predicted label (yi,l) for a point xi by incorporating the class prior as follows : γ = 0.0 for training and is trained on the full train- ing set (EPA-training). argmax wl yi,l l 4 Results where wl is the label mass normalization which is equal to pl/ml where pl is the prior probabil- ity of a label l (computed from the labeled data), and ml is the estimated weight of label l over the unlabeled sets. This scaling method is known to improve the results in comparison with the typical decision function argmaxl yi,l. 3.4 Baseline and State-of-the-art Comparison We compared our induced results against some of the standard state-of-art algorithms for inducing the valence (evaluation scores). We implemented the PMI-IR algorithm proposed by (Turney et al., 2003) which estimates the sentiment orientation (either positive or negative) of a word by com- puting the difference between the strength of the word associations with positive paradigm words and with negative paradigm words using the co- occurrence statistics aggregated from search en- gines' results. We also compare our results against the reported results of (Rothe et al., 2016)'s or- thogonal transformation of word vectors, and a label spreading algorithm trained on ( a domain- specific) SVD word vector model (Hamilton et al., 2016). We also experimented with the retrofitted word vector model improves the neural word embedding vectors using semantic fea- tures obtained from the lexical resources (WN, PPDB) (Faruqui et al., 2014). that Inquirer to recreate the General To make a fair comparison, we imple- mented our label propagation algorithm and the retrofitted word vector approach (Faruqui et al., 2014) lex- icon (Stone et al., 1966) with valence score ∈ R from (Warriner et al., 2013) lexicon to compare our results to (Hamilton et al., 2016) and (Rothe et al., 2016).We also ignored the neu- tral class and used the same seed set used by (Hamilton et al., 2016) and other researchers in the field. We also compare all the results against the EPA scores obtained from a supervised learn- ing algorithm. We trained a support vector regres- sion (SVR) model on a co-occurrence statistics model derived from the skip-gram word embed- ding model (SG) (Mikolov et al., 2013) and senti- ment lexicon resource (Warriner et al., 2013). The SVR model uses RBF kernel with C = 10, and In this section, we present the results of compar- ing the induced EPA scores using the label propa- gation algorithms against their corresponding val- ues in the EPA-testing. As shown in Table 2, us- ing SVD word embeddings in the CLP algorithm generated the lowest ranking correlation τ and the highest error rate (MAE) in comparison with the other label propagation methods. The results of comparing the induced EPA scores against their true values in the testing set show that the MAE ranged between 0.99 and 1.3 and the ranking cor- relation 2 τ was less than 0.2 using cosine simi- larity and hard clamping ( α = 1.0) assumption. We also experimented with the unsmoothed point- wise mutual information (PPMI), but there was not a significant difference between the smooth and the unsmoothed PMI. We also tried differ- ent dimension of the SVD word vector k=100 and k=300, but there was no significant difference be- tween them as well. The results of the SLLP algorithm that uses the semantic features obtained from either WN or PPDB lexicons generated a total of ∼50K words, where ∼ 4K words are in the testing set (EPA- testing). The results of comparing the induced EPA scores to their corresponding values in the testing set (EPA-testing) show that the MAE less than 1.0, F1-binary greater than 0.70, F1-ternary greater than or equal to 0.60, and the ranking cor- relation τ ≥ 0.2 suggesting that there is a rea- sonable degree of agreement between the induced EPA score using dictionary-based features and the manually labeled EPA values. The τ correlations scores show that neural word embedding label propagating NWELP out- performed the semantic based, and corpus-based label propagation algorithms, as shown in Ta- ble 2. The MAE and F1-scores of the semantic- based and neural word embedding label propaga- tion were close. The MAE of the neural word em- bedding ranged from 0.84 to 1.09, F-1 scores were between 0.67 and 0.80, and τ ranged from 0.1 to 0.44. Comparing the results of the two pre-trained neural word embedding shows that the skip-gram based (SG) model performed better than (GloVe). 2The p-value for all the reported τ scores are less than 0.001 Method Corpus W τ P E F1-binary F1-ternary A E P E P A CLP SLLP NWELP SM NAN WN 5,109 0.219 0.0263 0.162 4,653 0.122 0.060 0.084 4,801 0.388 0.244 0.329 PPDB 4,621 0.391 0.181 0.309 SG 8,072 0.437 0.283 0.350 GloVe 4,867 0.430 0.113 0.357 PPDB+GloVe 4,867 0.434 0.209 0.360 SNWELP WN+GloVe 4,867 0.445 0.220 0.366 PPDB+SG 4,818 0.510 0.284 0.459 WN+SG 5,367 0.510 0.291 0.461 0.53 0.51 0.72 0.73 0.70 0.73 0.74 0.75 0.76 0.76 0.44 0.54 0.83 0.76 0.80 0.81 0.81 0.82 0.80 0.80 A 0.56 0.54 0.73 0.71 0.67 0.70 0.70 0.71 0.75 0.75 MAE P 1.09 1.0 A 0.85 0.99 E 1.1 1.3 0.45 0.44 0.42 0.45 0.42 0.50 0.65 0.62 0.60 0.75 0.60 0.65 0.91 0.92 0.79 0.71 0.89 0.79 0.69 0.65 0.79* 0.84 0.68 0.64 0.78 1.09 0.68 0.68 0.68 0.68 0.64 0.77 0.64 0.64 0.78 0.78 0.64 0.78 1.09 1.07 1.10 1.10 1.08 1.07 1.07 1.05 0.97 0.95 0.88 0.84 0.84 0.84 0.84 0.83 SL WESVR 8,271 0.628* 0.422* 0.500* 0.83* 0.84* 0.78* 0.72* 0.65* 0.68 0.60* 0.60* 0.56* Table 2: The results of the label propagation algorithms and the supervised learning (SL) method (support vector regression (WESVR)) using the sampled seed words in comparison with the ground truth EPA values (Method= the algorithm used for lexicon induction, W= the number of the induced words that has label in the dictionary, τ = Kendall's τ correlation, F1-binary= F1 measure of the binary classification, F1-ternary= F1 scores of the ternary classification, MAE=Mean Absolute Error). The highest scores of the label propagation algorithms are in a boldface. The highest scores of all the algorithm are in boldface*. We experimented with different thresholds (0.0, 0.3, and 0.5) of the cosine similarities and the re- sult using different threshold varied a lot in respect to the number of induced words and the accuracy. Higher thresholds provided more accurate results and less noise in the results, but with less num- ber of induced words. The reported results in Ta- ble 2 and 3 are using cosine similarity threshold equal to 0.0 since the adjacency matrix of both SG and Glove contain negative values. Combining the semantic and neural word embedding features improved the results with τ ranged between 0.43 and 0.51 and MAE ≤ 1.1 for the evaluation scores (E). The results of the supervised SVR model sig- nificantly outperformed the results obtained from the semi-supervised method with τ equal to 0.628, 0.422 and 0.500 for E, P, and A, respectively, F- 1 scores equal to 0.83, 0.84, and 0.78, and MAE close to 0.6, but the results of the SNWELP were comparable. Comparing the results across the different affec- tive dimensions (E,P, and A) shows that the rank correlation τ of comparing the potency (P) to their counterpart scores in testing set was low in com- parison with the scores of evaluation (E) and ac- tivity (A) in both the semi-supervised algorithms and the supervised algorithm. While the rank cor- relation τ of the evaluation (E) scores were the highest in all the algorithms which indicate that words with similar word embeddings have a simi- lar evaluation score. Table 4 shows some of the in- duced EPA scores and their corresponding values Method SNWELP (SG+WN) (Hamilton et al., 2016) NWELP (SG) (Rothe et al., 2016) (Faruqui et al., 2014) (Turney and Littman, 2002) τ 0.51 0.50 0.48 0.44 0.40 0.14 F1-ternary ACC 0.94 0.93 0.94 0.91 0.84 0.55 0.67 0.62 0.67 0.59 0.62 0.47 Table 3: The results of comparing evaluation (E) of the Gen- eral Inquirer induced lexicon using the pre-trained Neural Word Embeddings label propagation (NWELP) and Seman- tic Neural Word Embeddings label propagation (SNWELP) and fixed seed words with the results reported by the state of the are results in method in lexicon induction ( τ = Kendall's τ correlation, ACC= the binary accuracy, F1= the ternary F- measure) in (Warriner et al., 2013) dataset. The table also shows some examples of the same words and their induced EPA scores using different word represen- tations. Comparing our induced evaluation scores (E) with some of the state-of-the-art methods, as shown in Table 3, indicates that our label prop- agation algorithms significantly performed better than (Turney and Littman, 2002)'s unsupervised method. The result also shows that semantic neu- ral word embedding (SNWELP) model outper- formed (Rothe et al., 2016) and (Hamilton et al., 2016) approaches. Also, the neural word embed- ding and semantic neural word embedding algo- rithms perform better than the label propagation that uses the retrofitted word vector (the reported results are of the improved skip-gram model (SG) using semantic features obtained from wordnet (WN)) (Faruqui et al., 2014). Word Method Induced EPA True EPA injustice injustice WN GloVe [-1.9, 0.3, -1.7] [-2.7, 1.6, -1.86] [-1.3, 1.4 , -1.8] [-2.7, 1.6, -1.86] injustice GloVe+WN [-1.4, 0.2, -1.3] [-2.7, 1.6, -1.86] injustice SG+ WN [-1.9, 0.3, -1.7 ]* [-2.7, 1.6, -1.86] evil evil evil evil PPDB GLoVe [-1.3 , 0.05, -1.1] [-2.9, 0.7, -1.5] [-2.1, 2.5, -3.1] [-2.9, 0.7, -1.5] GLoVe+PPDB [-1.7 , 0.08, -1.2] [-2.9, 0.7, -1.5] SG+PPDB [-2.1, 0.1, -1.5] [-2.9, 0.7, -1.5] successful SG [ 2.15, 0.04, 1.6] [2.97, 0.09, 2.9] successful SG+PPDB [ 2.5, -0.6, 2.0] [2.97, 0.09, 2.9] Table 4: Some example of the induced EPA and their EPA ratings from Original-EPA-lexicon and the induced EPA val- ues using label propagation and different word representa- tions WN=wordnet, parahprese-database=PPDB, SG =skip- gram word vector, and GLoVe= the global vector for word representation. The starred example * show no change after adding the neural word vector features. 5 Discussion Sentiment analysis is a feature engineering prob- lem in which sentiment lexicons play a signifi- cant role in improving the model accuracy. One of the challenges of sentiment analysis is the in- creasing number of new words and terms in the social media or news resources (e.g., selfie, sex- ting, photobomb,etc.) that do not have a sentiment score attached to them. Also, there is a need to measure the variance in human attitudes towards some terms over a period of time (e.g., homosex- uality, abortion) and to explore other dimensions of humans' emotions. To overcome these limita- tions, reduce the cost of manual annotation, and increase the number of the annotated terms, we propose an extension and an evaluation of corpus and thesaurus-based algorithms to automatically induce a three-dimensional sentiment lexicon. Similar to any NLP applications, the vast major- ity of the work in lexicon induction uses distribu- tional word representations (corpus-based statis- tics). In this study, the corpus-based label prop- agation (CLP) algorithm generated the least accu- rate results. Also, despite the viability of distribu- tional word representations, exactly what syntac- tic and semantic information it captures is hard to determine, and not clear whether it is relevant for sentiment at all. The semantic lexicon-based label propagation (SLLP) was better than CLP. However, there are also some limitations of using the dictionary based approach 1) the synonym relationship can only be computed between words of the same part of speech, 2) the dictionary has a limited number of words and does not include words that are used in the social media and internet in general. sentiment Only one study have experimented with neural word embedding label propagation to expand the one-dimensional lexi- con (Hamilton et al., 2016) with only reporting the result of using SVD word embedding model. In our study, we report the results of using differ- ent neural word embedding models. The results show that our neural word embedding model per- formed better than the SVD word vector approach. These findings require further analysis and assess- ment on different corpora. The results of combining both the semantic and neural word embedding (NWELP) was better than the corpus-based or semantic lexicon-based algo- rithms. The semantic neural word embedding pro- vided a higher rank correlation scores and a slight- ing lower MAE in comparison with the semantic lexicon and neural word embedding-based algo- rithms. The results of the semantic neural label propagation algorithm are also comparable with those generated using a supervised learning algo- rithm (SVR) trained on word embeddings and a sentiment lexicon. Using the semi-supervised al- gorithm; however, does not require a large training dataset and allows to annotate the words indepen- dently from the previously human-coded lexica. 6 Conclusion In this study, we propose an extension to the graph-based lexicon induction algorithms to ex- pand sentiment lexicons and explore other dimen- sions of sentiments. This study to the best of our knowledge is the first work that expands a multi- dimension sentiment lexicon and the first to incor- porates both the semantic and neural word rep- resentations in the label propagation algorithm. We also provided an extensive evaluation of la- bel propagation algorithms using a variety of word representations that have been found to provide higher accuracy in many NLP tasks in compar- ison with other standard methods. The results show that the word semantic neural word embed- ding label propagation generates the highest corre- lations compared with the corpus-based, semantic lexicon-based, and neural word embedding algo- rithms. References Areej Alhothali and Jesse Hoey. 2015. Good news or bad news: Using affect control theory to ana- lyze readers reaction towards news articles. In Proc. Conference of the North American Chapter of the Association for Computational Linguistics - Human Language Technologies (NAACL HLT). Denver, CO. Alina Andreevskaia and Sabine Bergler. 2006. Seman- tic tag extraction from wordnet glosses. In Proceed- ings of 5th International Conference on Language Resources and Evaluation (LREC06). Citeseer. Ramon F Astudillo, Silvio Amir, Wang Ling, Bruno Martins, M´ario Silva, Isabel Trancoso, and Rua Alves Redol. 2015. Inesc-id: A regression model for large scale twitter sentiment lexicon in- duction. SemEval-2015 page 613. Stefano Baccianella, Andrea Esuli, and Fabrizio Sebas- tiani. 2010. Sentiwordnet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining. In LREC. volume 10, pages 2200–2204. Juri Ganitkevitch, Benjamin Van Durme, and Chris Ppdb: The paraphrase Callison-Burch. 2013. database. In HLT-NAACL. pages 758–764. Namrata Godbole, Manja Srinivasaiah, and Steven Skiena. 2007. Large-scale sentiment analysis for news and blogs. ICWSM 7. David Graff. 1995. North american news text corpus. William L Hamilton, Kevin Clark, Jure Leskovec, and Dan Jurafsky. 2016. Inducing domain-specific sentiment lexicons from unlabeled corpora. arXiv preprint arXiv:1606.02820 . Zellig S Harris. 1981. Distributional structure. Springer. David R Heise. 2007. Expressive order: Confirming sentiments in social actions. Springer. David R. Heise. 2010. Surveying Cultures: Discover- ing Shared Conceptions and Sentiments. Wiley. Yoshua Bengio, Holger Schwenk, Jean-S´ebastien Sen´ecal, Fr´ederic Morin, and Jean-Luc Gauvain. 2006. Neural probabilistic language models. In Innovations in Machine Learning, Springer, pages 137–186. Minqing Hu and Bing Liu. 2004. Mining and summa- rizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowl- edge discovery and data mining. ACM, pages 168– 177. Joseph Berger and Morris Zelditch. 2002. New Direc- tions in Contemporary Sociological Theories. Row- man & Littlefield. Allan M Collins and M Ross Quillian. 1969. Re- trieval time from semantic memory. Journal of ver- bal learning and verbal behavior 8(2):240–247. David Corney, Dyaa Albakour, Miguel Martinez, and Samir Moussa. 2016. What do a million news ar- ticles look like? In Proceedings of the First In- ternational Workshop on Recent Trends in News In- formation Retrieval co-located with 38th European Conference on Information Retrieval (ECIR 2016), Padua, Italy, March 20, 2016.. pages 42–47. Carl Eckart and Gale Young. 1936. The approximation of one matrix by another of lower rank. Psychome- trika 1(3):211–218. Andrea Esuli and Fabrizio Sebastiani. 2006. Senti- wordnet: A publicly available lexical resource for opinion mining. In Proceedings of LREC. volume 6, pages 417–422. Manaal Faruqui, Jesse Dodge, Sujay K Jauhar, Chris Dyer, Eduard Hovy, and Noah A Smith. 2014. Retrofitting word vectors to semantic lexicons. arXiv preprint arXiv:1411.4166 . John Rupert Firth. 1957. A synopsis of linguistic the- ory, 1930-1955. Johnny RJ Fontaine, Klaus R Scherer, Etienne B Roesch, and Phoebe C Ellsworth. 2007. The world of emotions is not two-dimensional. Psychological science 18(12):1050–1057. Ian Jolliffe. 2002. Principal component analysis. Wi- ley Online Library. Jaap KAMPS. 2004. Using wordnet to measure se- mantic orientation of adjectives. In Proceedings of the 4th International Conference on Language Re- sources and Evaluation (LREC 2004). pages 1115– 1118. Thomas K Landauer and Susan T Dumais. 1997. A solution to plato's problem: The latent semantic analysis theory of acquisition, induction, and rep- resentation of knowledge. Psychological review 104(2):211. Omer Levy, Yoav Goldberg, and Ido Dagan. 2015. Im- proving distributional similarity with lessons learned from word embeddings. Transactions of the Associ- ation for Computational Linguistics 3:211–225. Neil J. MacKinnon. 2006. Mean affective ratings of 2, 294 concepts by guelph university undergraduates, ontario, canada. In 2001-3 [Computer file]. Tomas Mikolov, Martin Karafi´at, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. 2010. Recur- rent neural network based language model. In IN- TERSPEECH. pages 1045–1048. Tomas Mikolov, Stefan Kombrink, Lukas Burget, JH Cernocky, and Sanjeev Khudanpur. 2011. Ex- tensions of recurrent neural network language model. In Acoustics, Speech and Signal Processing (ICASSP), 2011 IEEE International Conference on. IEEE, pages 5528–5531. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- rado, and Jeff Dean. 2013. Distributed representa- tions of words and phrases and their compositional- ity. In Advances in neural information processing systems. pages 3111–3119. Zhibiao Wu and Martha Palmer. 1994. Verbs semantics and lexical selection. In Proceedings of the 32nd an- nual meeting on Association for Computational Lin- guistics. Association for Computational Linguistics, pages 133–138. Dengyong Zhou, Olivier Bousquet, Thomas Navin Lal, Jason Weston, and Bernhard Scholkopf. 2004. Learning with local and global consistency. Ad- vances in neural information processing systems 16(16):321–328. Xiaojin Zhu and Zoubin Ghahramani. 2002. Learning from labeled and unlabeled data with label propa- gation. Technical report, Technical Report CMU- CALD-02-107, Carnegie Mellon University. Xiaojin Zhu, Zoubin Ghahramani, John Lafferty, et al. 2003. Semi-supervised learning using gaussian fields and harmonic functions. In ICML. volume 3, pages 912–919. George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM 38(11):39– 41. Charles Egerton Osgood. 1957. The measurement of meaning, volume 47. University of Illinois Press. Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In EMNLP. volume 14, pages 1532– 43. Delip Rao and Deepak Ravichandran. 2009. Semi- supervised polarity lexicon induction. In Proceed- ings of the 12th Conference of the European Chap- ter of the Association for Computational Linguistics. Association for Computational Linguistics, pages 675–682. Sascha Rothe, Sebastian Ebert, and Hinrich Schutze. 2016. Ultradense word embeddings by orthogonal transformation. arXiv preprint arXiv:1602.07572 . Philip Stone, Dexter C Dunphy, Marshall S Smith, and DM Ogilvie. 1968. The general inquirer: A com- puter approach to content analysis. Journal of Re- gional Science 8(1):113–116. Philip J Stone, Dexter C Dunphy, and Marshall S Smith. 1966. The general inquirer: A computer ap- proach to content analysis. . Carlo Strapparava and Alessandro Valitutti. 2004. Wordnet affect: an affective extension of wordnet. In LREC. volume 4, pages 1083–1086. Peter Turney and Michael L Littman. 2002. Unsu- pervised learning of semantic orientation from a hundred-billion-word corpus . Peter Turney, Michael L Littman, Jeffrey Bigham, and Victor Shnayder. 2003. Combining independent modules to solve multiple-choice synonym and anal- ogy problems . Leonid Velikovich, Sasha Blair-Goldensohn, Kerry Hannan, and Ryan McDonald. 2010. The viabil- ity of web-derived polarity lexicons. In Human Language Technologies: The 2010 Annual Confer- ence of the North American Chapter of the Associa- tion for Computational Linguistics. Association for Computational Linguistics, pages 777–785. Amy Beth Warriner, Victor Kuperman, and Marc Brys- baert. 2013. Norms of valence, arousal, and dom- inance for 13,915 english lemmas. Behavior re- search methods 45(4):1191–1207.
1607.05408
1
1607
2016-07-19T05:38:58
Discriminating between similar languages in Twitter using label propagation
[ "cs.CL" ]
Identifying the language of social media messages is an important first step in linguistic processing. Existing models for Twitter focus on content analysis, which is successful for dissimilar language pairs. We propose a label propagation approach that takes the social graph of tweet authors into account as well as content to better tease apart similar languages. This results in state-of-the-art shared task performance of $76.63\%$, $1.4\%$ higher than the top system.
cs.CL
cs
Discriminating between similar languages in Twitter using label propagation Will Radford Xerox Research Centre Europe 6 chemin de Maupertuis 38240 Meylan, France [email protected] Matthias Gallé Xerox Research Centre Europe 6 chemin de Maupertuis 38240 Meylan, France [email protected] 6 1 0 2 l u J 9 1 ] L C . s c [ 1 v 8 0 4 5 0 . 7 0 6 1 : v i X r a ABSTRACT Identifying the language of social media messages is an im- portant first step in linguistic processing. Existing models for Twitter focus on content analysis, which is successful for dissimilar language pairs. We propose a label propaga- tion approach that takes the social graph of tweet authors into account as well as content to better tease apart sim- ilar languages. This results in state-of-the-art shared task performance of 76.63%, 1.4% higher than the top system. Categories and Subject Descriptors I.2.7 [Artificial Intelligence]: Natural Language Process- ing Keywords Language identification, Social media, Label propagation 1. INTRODUCTION Language identification is a crucial first step in textual data processing and is considered feasible over formal texts [4]. The task is harder for social media (e.g. Twitter) where text is less formal, noisier and can be written in wide range of languages. We focus on identifying similar languages, where surface-level content alone may not be sufficient. Our ap- proach combines a content model with evidence propagated over the social network of the authors. For example, a user well-connected to users posting in a language is more likely to post in that language. Our system scores 76.63%, 1.4% higher than the top submission to the tweetLID workshop.1 2. BACKGROUND Traditional language identification compares a document with a language fingerprint built from n-gram bag-of-words 1http://komunitatea.elhuyar.org/tweetlid Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Copyright 20XX ACM X-XXXXX-XX-X/XX/XX ...$15.00. (character or word level). Tweets carry additional meta- data useful for identifying language, such as geolocation [3], username [2, 3] and urls mentioned in the tweet [2]. Other methods expand beyond the tweet itself to use a histogram of previously predicted languages, those of users @-mentioned and lexical content of other tweets in a discus- sion [3]. Discriminating between similar languages was the focus of the VarDial workshop [7], and most submissions used content analysis. These methods make limited use of the social context in which the authors are tweeting -- our research question is "Can we identify the language of a tweet using the social graph of the tweeter?". Label propagation approaches [8] are powerful techniques for semi-supervised learning where the domain can natu- rally be described using an undirected graph. Each node contains a probability distribution over labels, which may be empty for unlabelled nodes, and these labels are propa- gated over the graph in an iterative fashion. Modified Ad- sorption (mad)[6], is an extension that allows more control of the random walk through the graph. Applications of lp and mad are varied, including video recommendation [1] and sentiment analysis over Twitter [5]. 3. METHOD Our method predicts the language (cid:96) for a tweet t by com- bining scores from a content model and a graph model that takes social context into account, as per Equation 1: λ1p((cid:96)t, θcontent) + λ2p((cid:96)t, θsocial) lang(t) = argmax (1) (cid:96) Where θcontent are the content model parameters, θsocial the social model parameters.2 3.1 Content model Our content model is a 1 vs. all (cid:96)2 regularised logistic regression model3 with character 2- to 5-grams features, not spanning over word boundaries. The scores for a tweet are normalised to obtain a probability distribution. 3.2 Social model We use a graph to model the social media context, relating tweets to one another, authors to tweets and other authors. Figure 1 shows the graph, composed of three types of nodes: tweets (T), users (U) and the "world" (W). Edges are created between nodes and weighted as follows: T-T the unigram cosine similarity between tweets, T-U weighted 100 between 2We do not optimise λ1 and λ2, setting them to 0.5. 3We use scikit-learn: http://scikit-learn.org Content P R F Content + Social P F R 92.64 89.81 81.14 77.42 56.93 92.41 100.00 66.67 95.69 92.58 87.19 76.18 52.93 76.29 89.56 10.98 94.14 91.17 84.06 76.79 54.85 83.58 94.49 18.85 93.55 94.87 85.22 77.86 65.15 94.41 100.00 45.06 95.89 92.52 90.17 70.53 50.35 68.01 85.54 28.54 94.70 93.68 87.62 74.01 56.80 79.06 92.21 34.95 es ♦ pt ♠ ca ♦ en gl ♠ eu amb und 72.67 82.13 avg 76.63 Table 1: Experimental results. ♦/♠ are similar pairs. 74.74 82.01 72.69 Figure 1: Graph topology. Rectangular nodes are tweets, circular nodes are users and the diamond represents the world. Some tweet nodes are labelled with an initial dis- tribution over language labels and others are unlabelled. a tweet and its author, U-U weighted 1 between two users in a "follows" relationship and U-W weighted 0.001 to ensure a connected graph for the mad algorithm. We create the graph using all data, and training set tweets have an initial language label distribution.4 A naıve ap- proach to building the tweet-tweet subgraph requires O(n2) comparisons, measuring the similarity of each tweet with all others. Instead, we performed k-nearest-neighbour classifi- cation on all tweets, represented as a bag of unigrams, and compared each tweet and the top-k neighbours.5 We use Junto (mad) [6] to propagate labels from labelled to unla- belled nodes. Upon convergence, we renormalise label scores for initially unlabelled nodes to find the value of θgraph. 4. EVALUATION The tweetLID workshop shared task requires systems to identify the language of tweets written in Spanish (es), Por- tuguese (pt), Catalan (ca), English (en), Galician (gl) and Basque (eu). Some language pairs are similar (es and ca; pt and gl) and this poses a challenge to systems that rely on content features alone. We use the supplied evaluation corpus, which has been manually labelled with six languages and evenly split into training and test collections. We use the official evaluation script and report precision, recall and F-score, macro-averaged across languages. This handles am- biguous tweets by permitting systems to return any of the annotated languages. Table 1 shows that using the content model alone is more effective for languages that are distinct in our set of languages (i.e. English and Basque). For sim- ilar languages, adding the social model helps discriminate them (i.e. Spanish, Portuguese, Catalan and Galician), par- ticularly those where a less-resourced language is similar to a more popular one. Using the social graph almost dou- bles the F-score for undecided (und) languages, either not in the set above or hard-to-identify, from 18.85% to 34.95%. Macro-averaged, our system scores 76.63%, higher than the best score in the competition: 75.2%. 4We assume a uniform distribution for amb tweets. 5We used scikit-learn with k = 0.25 ∗ ntweets. 5. CONCLUSION Our approach uses social information to help identify the language of tweets. This shows state-of-the-art performance, especially when discriminating between similar languages. A by-product of our approach is that users are assigned a language distribution, which may be useful for other tasks. 6. REFERENCES [1] S. Baluja, R. Seth, D. Sivakumar, Y. Jing, J. Yagnik, S. Kumar, D. Ravichandran, and M. Aly. Video suggestion and discovery for youtube: Taking random walks through the view graph. In Procs. of the 17th International Conference on World Wide Web, WWW '08, pages 895 -- 904, New York, NY, USA, 2008. ACM. [2] S. Bergsma, P. McNamee, M. Bagdouri, C. Fink, and T. Wilson. Language identification for creating language-specific twitter collections. In Procs. of the Second Workshop on Language in Social Media, LSM '12, pages 65 -- 74, Stroudsburg, PA, USA, 2012. ACL. [3] S. Carter, W. Weerkamp, and M. Tsagkias. Microblog language identification: Overcoming the limitations of short, unedited and idiomatic text. Lang. Resour. Eval., 47(1):195 -- 215, Mar. 2013. [4] P. McNamee. Language identification: A solved problem suitable for undergraduate instruction. J. Comput. Sci. Coll., 20(3):94 -- 101, Feb. 2005. [5] M. Speriosu, N. Sudan, S. Upadhyay, and J. Baldridge. Twitter polarity classification with label propagation over lexical links and the follower graph. In Procs. of the First workshop on Unsupervised Learning in NLP, pages 53 -- 63, Edinburgh, Scotland, July 2011. ACL. [6] P. P. Talukdar and K. Crammer. New regularized algorithms for transductive learning. In Procs. of the European Conference on Machine Learning and Knowledge Discovery in Databases: Part II, ECML PKDD '09, pages 442 -- 457, Berlin, Heidelberg, 2009. Springer-Verlag. [7] M. Zampieri, L. Tan, N. Ljubesi´c, and J. Tiedemann. A report on the dsl shared task 2014. In Proceedings of the First Workshop on Applying NLP Tools to Similar Languages, Varieties and Dialects, pages 58 -- 67, Dublin, Ireland, August 2014. ACL and DCU. [8] X. Zhu and Z. Ghahramani. Learning from labeled and unlabeled data with label propagation. Technical Report CMU-CALD-02-107, CMU, 2002. Tca=1Tes=0.5ca=0.50.8U100T0.6T0.41000.4U100U1001W0.0010.0010.001
1810.09073
1
1810
2018-10-22T03:38:23
Labeling Gaps Between Words: Recognizing Overlapping Mentions with Mention Separators
[ "cs.CL" ]
In this paper, we propose a new model that is capable of recognizing overlapping mentions. We introduce a novel notion of mention separators that can be effectively used to capture how mentions overlap with one another. On top of a novel multigraph representation that we introduce, we show that efficient and exact inference can still be performed. We present some theoretical analysis on the differences between our model and a recently proposed model for recognizing overlapping mentions, and discuss the possible implications of the differences. Through extensive empirical analysis on standard datasets, we demonstrate the effectiveness of our approach.
cs.CL
cs
Labeling Gaps Between Words: Recognizing Overlapping Mentions with Mention Separators Aldrian Obaja Muis and Wei Lu Singapore University of Technology and Design {aldrian_muis,luwei}@sutd.edu.sg At issue is the liability of a Pennsylvania ::::::::: GPE radio station under the federal wiretap statute. :::::::::::::::::::: ORG CAT expression directed by the IL2:: DNA ::::::::::::::: regulatory region or by a multimer of the NF-AT :::: PROT ::::::::::::: -binding site DNA DNA was lower. Figure 1: Examples of overlapping mentions. performance of many downstream tasks such as relation extraction (Mintz et al., 2009; Gupta and Andrassy, 2016), event extraction (Lu and Roth, 2012; Li et al., 2013; Nguyen et al., 2016), coref- erence resolution (Chang et al., 2013; Lu et al., 2016), question answering (Mollá et al., 2007), and equation parsing (Roy et al., 2016). Overlapping mention recognition is non-trivial, as existing methods that model mention recogni- tion as a sequence prediction problem -- e.g., us- ing linear-chain conditional random fields (CRF) (Lafferty et al., 2001) -- have difficulties in han- dling overlapping mentions (Alex et al., 2007). Finkel and Manning (2009) proposed to use a tree- based constituency parsing model to handle nested entities.2 Due to the tree structured representa- tion used, the resulting algorithm has a time com- plexity that is cubic in n for its inference proce- dure with n being the number of words in the sentence. This effectively makes the algorithm less scalable compared to models such as linear- chain CRF where the complexity is linear in n. Lu and Roth (2015) proposed an alternative ap- proach which shows a time complexity that is lin- ear in n. Their method differs from the conven- 2We note that nested entities are only one of the two kinds of overlapping entities, the other kind being crossing entities, where two entities overlap but neither is contained in another. However, it is extremely rare, and there is only one occur- rence of crossing entity in our datasets. Abstract In this paper, we propose a new model that is capable of recognizing overlapping mentions. We introduce a novel notion of mention separators that can be effectively used to capture how mentions overlap with one another. On top of a novel multigraph representation that we introduce, we show that efficient and exact inference can still be performed. We present some theoret- ical analysis on the differences between our model and a recently proposed model for recognizing overlapping mentions, and discuss the possible implications of the differences. Through extensive empirical analysis on standard datasets, we demon- strate the effectiveness of our approach. Introduction 1 Named entity recognition (NER), or in general the task of recognizing entity mentions1 in a text, has been a research topic for many years (Mc- Callum and Li, 2003; Nadeau and Sekine, 2007; Ratinov and Roth, 2009; Ling and Weld, 2012). However, as noted by Finkel and Manning (2009), many previous works ignored overlapping men- tions, although they are quite common. Figure 1 illustrates some examples of overlapping men- tions adapted from existing datasets. For example, the location mention Pennsylvania appears within the mention of type organization a Pennsylvania radio station. In practice, overlapping mentions have been found in many existing datasets across different domains (Doddington et al., 2004; Kim et al., 2003; Suominen et al., 2013). Developing algorithms that can effectively and efficiently ex- tract overlapping mentions can be crucial for the 1As noted in (Florian et al., 2004), mention recognition is more general than NER, where a mention can be either named, nominal, or pronominal. arXiv:1810.09073v1 [cs.CL] 22 Oct 2018 tional sequence labeling approach, in that a hyper- graph representation was used in their model. In this work, we make an observation that there exists an efficient model for recognizing overlap- ping mentions while still regarding the problem as a sequence labeling problem. As opposed to the conventional approach where we assign labels to natural language words, in our new approach we assign labels to the gaps between words, mod- eling the mention boundaries instead of model- ing the role of words in forming mentions. Fur- thermore, while these gap-based labels can be modeled using conventional graphical models like linear-chain CRFs, we also propose a novel multi- graph representation to utilize such gap-based la- bels efficiently. To the best of our knowledge, this is the first structured prediction model utilizing a gap-based annotation scheme to predict overlap- ping structures. In this paper we make the following major con- tributions: • We propose a set of mention separators which can be collectively used to define all possible mention combinations together with a novel multigraph representation, on top of which efficient and exact inference can be performed. • Theoretically, we show that unlike a recently proposed state-of-the-art model that we com- pare against, our model does not exhibit the spurious structures issue in its learning pro- cedure. On the other hand, it still maintains the same inference time complexity as the previous model. • Empirically, we show that our model is able to achieve higher F1-scores compared to pre- vious models in multiple datasets. We believe our proposed approach and the novel representations can be applied in other research problems involving predicting overlapping struc- tures, and we hope this work can inspire further research along such a direction. 2 Related Work NER or mention detection is normally regarded as a chunking task similar to base noun phrase chunking (Kudo and Matsumoto, 2001; Shen and Sarkar, 2005), and hence the entities or mentions are usually represented in a similar way, using BILOU (Beginning, Inside, Last, Outside, Unit- length mention) or the simpler BIO annotation scheme (Ratinov and Roth, 2009). As a chunking task, it is commonly modeled using sequence la- beling models, such as the linear-chain CRF (Laf- ferty et al., 2001), which has time complexity O(nT 2) with n being the number of words in the sentence and T the number of mention types. On the task of recognizing mentions that may overlap with one another, one of the earliest works that attempted to regard this task as a structured prediction task was by McDonald et al. (2005). They represented entity mentions as top-k predic- tions with positive score from a structured multil- abel classification model. Their model has a time complexity of O(n3T ). Alex et al. (2007) proposed a cascading ap- proach using multiple linear-chain CRF models, each handling a subset of all the possible mention types, where the models which come later in the pipeline have access to the predictions of the mod- els earlier in the pipeline. This results in the time complexity of roughly O(nT ) depending on how the pipeline was designed. Finkel and Manning (2009) later proposed a constituency parser to handle nested entities by converting each sentence into a tree, and each mention is represented as one of the subtrees. Their model has the standard time complexity for a constituency parser with binary grammar: O(n3 G), where G is the size of the grammar, which in this case is proportional to T in the best case, and T 3 in the worst case. They showed that their model outperforms a semi-CRF baseline (Sarawagi and Cohen, 2004) in terms of F1-score. Recently, Lu and Roth (2015) proposed a hypergraph-based model called mention hyper- graph that is able to handle overlapping mentions with a linear time complexity O(nT ). The model was shown to achieve competitive results com- pared to previous models on standard datasets. As we will be making extensive comparisons against this previous state-of-the-art model, we will de- scribe this approach in the next section. 3 Mention Hypergraph In the mention hypergraph model of Lu and Roth (2015), nodes and directed hyperedges3 are used together to encode mentions and their combina- tions. The following five types of nodes are used at the position k of a sentence: • Ak denotes all mentions starting at k or later, 3For brevity, in this paper we may also use edge to refer to hyperedge in some discussions. the A0 E0 T0 I0 X [human [TCF-1]2 protein]1 A1 E1 T1 I1 X X A2 E2 T2 I2 X A3 E3 T3 I3 X X X X A1 E1 T1 I1 A2 E2 T2 I2 X I3 X Figure 2: (left) An example mention hypergraph encoding two overlapping mentions. (right) An example of spurious structure. • Ek denotes all mentions starting at k, t denotes all mentions (type t) starting at k, • Tk t denotes all mentions (type t) covering k, • Ik • X denotes the end of a mention (leaf node). Different hyperedges connecting these nodes are used to represent how the semantics of a node is composed from those of its child nodes. 2, . . . , Tk Specifically, each Ak is connected to Ak+1 and Ek through the hyperedge Ak → (Ak+1, Ek), de- noting the fact that the set of mentions that start at k or later is the union of the set of mentions that start at k + 1 or later and the set of men- tions that start at k. Each Ek is connected to T through a hyperedge, denoting Tk the fact that the mentions that start at k must be t can be connected to one of the T types. Each Tk t through an edge (denoting there is a mention of Ik type t that starts at the k-th token) or to X through another edge (denoting there are no mentions of type t that start at the k-th token). Each Ik t can be connected to Ik+1 (denoting there is a mention continuing to the next token), to X (denoting there is a mention ending here), or to both (with a single hyperedge, denoting the two cases above occur at the same time, a case of overlapping mentions). 1, Tk t In this mention hypergraph, each possible men- tion is represented as a path from a T-node to the X-node through a sequence of I-nodes (each de- noting the words which are part of the mention), and the set of all mentions present in a given sen- tence forms a hyperpath from the root node A0 to the leaf node X. Figure 2 shows how the men- tion hypergraph represents the two mentions in the phrase "the human TCF-1 protein", which are "TCF-1" and "human TCF-1 protein". The edges T1 − I1 and T2 − I2 respectively denote that the words "human" and "TCF-1" are the beginning of a mention, and the edges from the I-nodes to the X-node define the end of the mentions. We remark that any mention hypergraph which encodes the mentions in a sentence, like this example, forms a hyperpath from the root node A0 to the leaf node X, where a hyperpath is defined as a subgraph of a hypergraph with the property that each node has exactly one outgoing (hyper)edge except the last node, and the root node is connected to all nodes. We refer the readers to Lu and Roth (2015) for more details on the model. 3.1 Spurious Structures Mention hypergraph is trained by maximizing the likelihood of the training data, similar to training a linear-chain CRF. Recall that the likelihood of the training data can be calculated by taking the score of the correct structures and divide it by the normalization term, which is the total score of all possible structures. Lu and Roth (2015) used a dynamic programming algorithm to calculate the normalization term. However, the normalization term calculated this way contains additional terms, which we call the spurious structures. This leads to the following: Theorem 3.1. Let Z0 be the normalization term as calculated using forward-backward algorithm on mention hypergraph, and let Z be the true nor- malization term. Then we have Z0 > Z. Due to space limitation, we provide a proof sketch here. We refer the reader to the supplemen- tal material for the details on spurious structures. Proof sketch. First note that Z0 includes all possi- ble hyperpaths, so Z0 ≥ Z. Next, due to the pres- ence of a node with multiple parents (e.g., node I2 in Figure 2 (left)), Z0 includes the score of that node multiple times with different children, which results in a subgraph which is not a hyperpath. For example, Z0 includes the score4 of the structure shown in Figure 2 (right), where node I2 has two children, and so it is not a hyperpath. Since Z is the sum of all hyperpaths, this structure is not part of Z, but it is included in Z0, so Z0 > Z. Later we will see how this issue may affect the model's performance in predicting mentions. 4 Mention Separators We now describe the mention separators which can be used to encode overlapping mentions in a sentence. Traditional encoding schemes that asso- ciate labels to words, such as BIO scheme, attach the semantics of the labels to the role of the words 4Note that structure scores exp(w· f ) are always positive. w w w [w w] w w] [w X S E ES w - w w -[w w]- w w]-[w ECS CS C EC Figure 3: An illustration of the 8 mention separa- tors. The opening bracket ([), closing bracket (]), and dash (-) respectively refer to S, E, and C. in forming mentions. For example, the label B in BIO scheme denotes the role of the word it is at- tached to, which is the first word of a mention. This BIO scheme cannot be used directly to en- code overlapping mentions, since they only en- code whether a word is part of a mention and pos- sibly their position in the mention. We notice that by encoding the mention boundaries instead, we can represent overlapping mentions. This can be accomplished by assigning what we call mention separators to the gaps between two words. At each gap, we consider eight possible types of mention separators based on the combination of the following three cases: 1. A mention is starting at the next word (S) 2. A mention is ending at the previous word (E) 3. A mention is continuing to the next word (C) Therefore, for each token, the possible combina- tions of cases are as follows: ECS, EC, CS, C, ES, E, S, and X, where X means none of the three cases applies. For example, the separator EC means there is a mention ending at the current token and another mention (overlapping) continuing to the next token. Note that there might be more than just two mentions involved here. Figure 3 shows an illustration of these separators, and Figure 4a shows how they can be used to encode the exam- ple in Figure 2. Now we prove that the following theorem holds: Theorem 4.1. For any combination of mentions in a sentence, there is exactly one sequence of men- tion separators that encodes it. Proof. Consider the gap between any two adja- cent words in the sentence. The combination of mentions present in the sentence uniquely defines what mention separator is associated with this gap. If there is a mention starting at the next word, then case S applies. Similarly, if there is a men- tion ending at the previous word, case E applies. And finally, if there is a mention covering both words, case C applies. By combining the cases, we get the corresponding mention separator for this gap. In this way, each gap in the sentence has a unique mention separator, which in turn defines the unique sequence of mention separators. Note that the converse of Theorem 4.1 is not true, as multiple mention combinations might en- code to the same sequence of mention separators. Now we describe two ways the mention separa- tors can be used to encode overlapping mentions. STATE-based The first is by directly using these mention separators to replace the standard mention encoding scheme (e.g., BIO encoding) in standard linear-chain CRF. So we assign each mention separator to a state in a linear-chain CRF model. Since this model encodes the gap between words and also the gap before the first word and after the last word, a sentence with n words is modeled by a sequence of n + 1 mention sepa- rators. Since each sequence of mention separa- tors can only encode mentions of the same type, we support multiple types by using multiple se- quences, one for each mention type. EDGE-based Now, we propose a novel way of utilizing these mention separators. Since the mention separators encode the gaps between words, it is more intuitive to assign the mention separators to the edges of a graphical model, as opposed to the states, as described in the previous paragraph. To do this, we need to define the states of the models in such a way that all possible se- quences of mention separators are accounted for. For this purpose we assign two states to each word at position k: • Ik: word at k is part of a mention, • Ok: word at k is not part of any mentions. Next we define the edges between the states ac- cording to the eight possible mention separators between adjacent words. More specifically, each mention separator is mapped to an edge connect- ing one state in the current position to another state in the next position depending on whether the sep- arator defines current and next word as part of an mention, so in total we have eight edges between two positions in the model. Some mention sep- arators may connect the same two states, for ex- ample, the ES and C separator both connect Ik to Ik+1 since in both cases the current word and the next word are part of a mention. In those cases, we simply define multiple edges between the pair of states. The resulting graph, where there can be multiple edges between two states, is known in graph theory literature as a multigraph5. 5In this work, the multigraph representation can also be the O0 X X [ human -[ TCF-1 ]- protein ] O1 O2 O3 S R X E R the O0 X X [ S I0 I1 CS I2 EC I3 I0 I1 (a) IL2 O1 ]- regulatory - region ] O2 O3 X E I2 C I3 EC (b) Figure 4: Our mention separator model with the EDGE representation encoding two phrases. the [human TCF-1 protein]1 R B I O B I O B I O B I O X Figure 6: A linear-chain CRF model encoding a mention in BIO scheme. encoded in our multigraph-based model as edges between adjacent positions. See the supplemental material for more discussion on this. 4.1 Training, Inference and Decoding We follow the log-linear approach to define our model, using regularized log-likelihood in training data D as our objective function, as follows: LD(w) = X(x,y)∈D w · f (e) − log Zw(x)#−λw2 "Xe∈y (1) Here, (x, y) is a training instance consisting of the sentence x and the correct output y, w is the weight vector, f (e) is the feature vector de- fined over the edge e, Zw(x) is the normalization term, and λ is the l2-regularization parameter. The objective function is then optimized until conver- gence using L-BFGS (Liu and Nocedal, 1989). We note the mention hypergraph model also de- fines the objective in a similar manner. For both of our models, the inference is done based on a generalized inside-outside algorithm. Both mod- els involve directed structures, on top of which the inference algorithm first calculates the inside score for each node from the leaf node to root, and then the outside score from the root to the leaf node, in very much the same way as how infer- ence is done in a classic graphical model. Specifi- cally, for our EDGE-based model, the inside scores are calculated using a bottom-up (right-to-left) dy- namic programming procedure, where we calcu- late the inside score at each node by summing up the scores associated with each path connecting the current node to one of its child nodes. Each X E X X O0 S X O1 S O2 S X O3 I3 CC E ES S EC ECS I2 CC E ES S EC ECS I1 CC E ES S EC ECS I0 X S R Figure 5: The full graph in EDGE-based model. The first I- and O-nodes in the sentence are con- nected to the root node, and the last I- and O- nodes are connected to the unique leaf node X. Figure 4a shows how the EDGE-based model encodes the two mentions "human TCF-1 protein" and "TCF-1" in the phrase "the human TCF-1 pro- tein", and Figure 4b shows the encoding of the phrase found in the second example in Figure 1. Note how each edge maps to a distinct mention separator visualized in the text in red. Figure 5 shows the full graph of our EDGE- based model, in a format similar to the trellis graph for linear-chain CRFs in Figure 6. We remark that the EDGE-based model can be seen as an exten- sion of linear-chain CRFs, with additional seman- tics attached to the edges. Also note that this graph encodes only one mention type. To support multi- ple types, similar to the STATE-based approach we can use multiple chains, one for each type. Note that the edges in our EDGE-based repre- sentations are directed, with nodes on the left serv- ing as parents to the nodes on the right. Such di- rected edges will be helpful when performing in- ference, to be discussed in the next section. We remark that the way we utilize multigraph in the EDGE-based model can also be applied to the discontiguous mention model (DMM) by Muis and Lu (2016). In fact, it can be shown that the number of canonical structures as calculated in the supplementary material of DMM paper matches the number of possible paths in our multigraph- based model, as the transition matrix in DMM corresponds to the number of possible transitions from one position to the next position, which is regarded as a lattice where edges are associated with labels. ACE-2004 Dev (%) 829 293 (35) 2,511 Test (%) 879 373 (42) 3,031 ACE-2005 Dev (%) 958 341 (36) Test (%) 1,047 Train (%) 7,336 2,686 (37) 24,687 9,937 (40) 1,192 (37) 1,184 (39) 5,044 (20) 638 (21) 330 (32) 3,027 3,217 GENIA Dev (%) 1,855 Test (%) 1,855 366 (20) 448 (24) 5,014 5,600 Train (%) 14,836 3,199 (22) 46,473 8,337 (18) 4,613 (10) Train (%) 6,799 2,685 (39) # sentence w/ o.l. # mentions 22,207 o.l. o.l. (s) 10,170 (46) 1,091 (43) 1,418 (47) 5,431 (24) 780 (26) 915 (18) 1,217 (22) 479 (10) 634 (11) Table 1: Statistics of the datasets used in the experiments. w/ o.l.: sentences containing overlapping mentions; o.l.: overlapping mentions; o.l. (s): overlapping mentions with the same type. 600 (19) 624 (25) such path score is defined as the product of the in- side score stored in that child node and the score defined over the edge connecting them. The com- putation of the outside scores can be done in an analogous manner from left to right. It can be ver- ified that the time complexity of this inference pro- cedure for our model is O(nT ), which is the same as the mention hypergraph model. Note that, how- ever, both of our models do not have the spurious structures issue, as for any path in these models there are no nodes with multiple incoming edges. During decoding, we perform MAP inference using a max-product procedure that is analogous to how the Viterbi decoding algorithm is used in conventional tree-structured graphical models to find out the highest-scoring subgraph, from which we extract mentions through the process that we call the interpretation process. As noted in previ- ous section, there could be multiple mention com- binations that correspond to the same sequence of mention separators, which presents an ambiguity during the interpretation process. For these am- biguous cases, we implemented the same inter- pretation process as that was done in the mention hypergraph model, which is by resolving ambigu- ous structures as nested mentions. For other cases, there is exactly one way to interpret the structure. For example, in Figure 4b, although there is only one gap marked as starting position (S) and two gaps marked as ending position (EC and E), the interpretation is clear that the two mentions here are "IL2" and "IL2 regulatory region". 5 Experiments 5.1 Datasets To assess our model's capability in recognizing overlapping mentions and make comparisons with previous models, we looked at datasets where overlapping mentions are explicitly annotated. Following the previous work (Lu and Roth, 2015), our main results are based on the standard ACE- 2004 and ACE-2005 datasets (Doddington et al., 2004). We also additionally looked at the GE- NIA dataset (Kim et al., 2003), which was used in the previous works (Finkel and Manning, 2009; Lu and Roth, 2015). For ACE datasets, we used the same splits as used in our previous work (Lu and Roth, 2015), published on our website6. For GENIA, we used GENIAcorpus3.02p7 that comes with POS tags for each word (Tateisi and Tsujii, 2004). Follow- ing previous works (Finkel and Manning, 2009; Lu and Roth, 2015), we first split the last 10% of the data as the test set. Next we used the first 80% and the subsequent 10% for training and develop- ment, respectively. We made the same modifica- tions as described by Finkel and Manning (2009) by collapsing all DNA, RNA, and protein subtypes into DNA, RNA, and protein, keeping cell line and cell type, and removing other mention types, re- sulting in 5 mention types. The statistics of each dataset are shown in Table 1. We can see overlap- ping mentions are common in such datasets. For more details on the dataset preprocessing, that fall under please refer to the supplemental material. 5.2 Features For models the edge-based paradigm (mention hypergraph and our model), we define features over the edges in the models. Features are defined as string concatenations of in- put features -- information extracted over the in- puts (such as current word and POS tags of sur- rounding words) and output features -- structured information extracted over the output structure. We carefully defined the input and output features in a way that allows us to make use of the iden- tical set of features for both our mention sepa- rator model and the baseline mention hypergraph model, in order to make a proper comparison. We also followed Lu and Roth (2015) to add the addi- tional mention penalty feature for our model and all baseline approaches so that we are able to tune F1-scores on the development set. Roughly speak- 6http://statnlp.org/research/ie#mention-hypergraph 7http://geniaproject.org/genia-corpus/pos-annotation ACE-2004 ACE-2005 LCRF (single) LCRF (multiple) Lu and Roth (2015) This work (STATE) This work (EDGE) P 70.6 78.6 81.2 78.0 79.5 R 41.7 44.5 45.9 51.2 51.1 F1 52.5 56.9 58.6 61.8 62.2 w/s 40.2 119.4 472.5 50.5 251.5 P 66.0 76.2 78.6 75.3 75.5 R 45.0 46.8 46.9 51.7 51.7 F1 53.5 58.0 58.7 61.3 61.3 w/s 41.2 118.7 516.6 52.1 253.3 Table 2: Main results (on ACE). ACE-2004 (F1 optimized) P F1 R 55.4 66.2 47.7 61.6 69.9 55.1 55.7 72.5 63.0 58.0 64.0 71.2 58.0 64.5 72.7 ACE-2005 (F1 optimized) P F1 R 54.7 62.1 48.9 60.4 66.5 55.3 57.3 66.3 61.5 58.4 62.7 67.6 58.1 63.1 69.1 ing, the weight of this feature controls how confi- dent the model should be in predicting more men- tions. In other words, this is a way to balance the precision and recall of the model. When defining the input features for both our model and the mention hypergraph model, we im- plemented the features used by previous works in each dataset based on the descriptions in their pa- pers: we followed Lu and Roth (2015) for the fea- tures used in ACE datasets, and Finkel and Man- ning (2009) for features used in GENIA dataset. In general, they include surrounding words, sur- rounding POS tags, bag-of-words, Brown clusters (for GENIA only), and orthographic features. See the supplemental material for more details. 5.3 Experimental Setup We trained each model in the training set, then tuned the l2-regularization parameter based on the development set. For GENIA experiments, we also tuned the number of Brown clusters. Fol- lowing Lu and Roth (2015), we also used each development set to tune the mention penalty to optimize the F1-score and report the scores on the corresponding test sets separately. Similar to Finkel and Manning (2009), as another base- line model we also trained a standard linear-chain CRF using the BILOU scheme. Although this model does not support overlapping mentions, it gives us a baseline to see the extent to which our model's ability to recognize overlapping mentions can help the overall performance. There is also a simple extension8 of this linear-chain CRF model that can support overlapping mentions of differ- ent types by considering each type separately us- ing multiple chains, one for each type. We call this multiple-chain variant LCRF (multiple) and the earlier standard approach LCRF (single). In 8We also tried a more elaborate encoding scheme based on BIO scheme Tang et al. (2013), originally designed for discontiguous mentions, but is supposed to be able to also recognize overlapping mentions of the same type. However, the result is very similar to LCRF (multiple), perhaps due to the invalid structures issue noted by Muis and Lu (2016). all models, we also implement the mention penalty feature, adapted accordingly so that increasing the feature weight will increase the number of men- tions predicted by the model. See supplemental material for more details. We implemented all models using Java, and also made additional comparisons on running time by running them under the same machine. In addi- tion, we also analyzed the convergence rate for dif- ferent models. 6 Results and Discussion 6.1 Results on ACE Table 2 shows the results on the ACE datasets, and these are our main results. Following pre- vious works (Finkel and Manning, 2009; Lu and Roth, 2015), we report standard precision (P ), recall (R) and F1-score percentage scores. The highest results (F1-score) and those results that are not significantly different from the highest results are highlighted in bold (based on bootstrap resam- pling test (Koehn, 2004), where p > 0.01). For ACE datasets, we make comparisons with the two versions of the linear-chain CRF baseline: LCRF (single) which does not support overlapping men- tions at all and LCRF (multiple) which does not support overlapping mentions of the same type, as well as our implementation of the mention hyper- graph baseline (Lu and Roth, 2015). From such empirical results we can see that our proposed model using mention separators consis- tently yields significantly better results (p < 0.01) than the mention hypergraph model across these two datasets, under two setups (whether to op- timize F1-score or not). Specifically, when the state-based approach is used (STATE), our ap- proach is able to obtain a much higher recall, re- sulting in improved F1-score. Empirically, we found this approach was also faster than the LCRF baseline approach in terms of the number of words processed each second (w/s) during decoding, which is expected, since STATE uses fewer num- LCRF (single) LCRF (multiple) Finkel and Manning (2009) Lu and Roth (2015) This work (STATE) This work (EDGE) P 77.1 75.9 75.4 74.2 74.0 75.4 R 63.3 66.1 65.9 66.7 67.7 66.8 F1 69.5 70.6 70.3 70.3 70.7 70.8 w/s 81.6 175.8 - 931.9 110.8 389.2 Table 3: Results on GENIA. ber of tags.9 The edge-based approach (EDGE) using our proposed multigraph representation is able to achieve a significant speedup in compar- ison with the state-based approach. Although this model is still about 50% slower than the mention hypergraph model10, but it yielded a significantly higher F1-score (up to 3.6 points higher on ACE- 2004 before optimizing F1-score). These results largely confirm the effectiveness of our proposed mention separator model and the usefulness of the multigraph representation for learning the model. And as expected, the LCRF baselines yields rel- atively lower results compared to the other mod- els, since it cannot predict overlapping mentions.11 However, such results give us some idea on how much performance increase we can gain by prop- erly recognizing overlapping mentions by looking at the results of LCRF (single), which in this case can be up to 9.7 points in F1-score in ACE-2004. We can also see the gain from recognizing over- lapping mentions of the same type by looking at the results of LCRF (multiple), which can be up to 5.3 points in F1-score in ACE-2004. 6.2 Results on GENIA Table 3 shows the results of running the models with F1-score tuning on GENIA dataset. All mod- els include Brown clustering features learned from PubMed abstracts. Besides the mention hyper- graph baseline, we also make comparisons with the system of Finkel and Manning (2009) that can also support overlapping mentions. We see that the mention hypergraph model matches the performance of the constituency parser-based model of Finkel and Manning (2009), while our models based on mention sepa- rators yield significantly higher scores (p < 0.05) than all other baselines (except LCRF (multiple), which we will discuss shortly). There are two ob- 9There are eight tags in STATE and nine in LCRF. 10Though both models have the same time complexity, they differ by a constant factor. 11LCRF (single) cannot predict any overlapping mentions, while LCRF (multiple) cannot predict overlapping mentions of the same type. P R R % Lu and Roth (2015) F1 This work (EDGE) F1 P ACE-2004 O 42 72.5 52.4 60.8 72.1 55.3 62.6 Ø 58 72.5 65.0 68.6 74.1 65.5 69.5 ACE-2005 O 32 68.1 52.6 59.4 70.4 55.0 61.8 Ø 68 64.1 65.1 64.6 67.2 63.4 65.2 O 24 76.3 60.8 67.7 76.5 60.3 67.4 Ø 76 73.1 70.7 71.9 74.8 71.3 73.0 Table 4: Results on different types of sentences. GENIA servations worth mentioning: (1) the absolute dif- ference of F1-scores of our models and the base- line models in GENIA is much smaller compared to that in ACE datasets, and (2) the LCRF (mul- tiple) model in GENIA dataset can achieve higher scores compared to other more complex baseline models, although LCRF (multiple) does not sup- port overlapping mentions of the same type. We suspect that these two observations are due to the small proportion of overlapping mentions in GE- NIA (18%, as compared to >40% in ACE datasets, see Table 1). To investigate this, we conduct a few more sets of experiments. 6.3 Further Experiments On different types of sentences: As these datasets consist of both overlapping and non- overlapping mentions, to further understand the model's effectiveness in recognizing overlapping mentions (and non-overlapping mentions), we per- formed some additional experiments on the men- tion hypergraph model and our model.12 Specifi- cally, we split the test data into two portions, one that consists of only sentences that contain over- lapping mentions (O) and those which do not (Ø). The results are shown in Table 4. We can see that in ACE datasets, our model achieves higher F1-scores compared to the men- tion hypergraph for both portions, but it achieves slightly lower results in GENIA dataset for the portion that contains overlapping mentions. We believe that our models learn parameters so as to obtain an optimal overall performance, and since the proportion of the overlapping mentions in GENIA is much smaller compared to that in ACE datasets, it learns to focus more on the non- overlapping mentions. This is supported by the fact that the difference of F1-score between the mention hypergraph model and our model in GE- NIA is larger compared to the difference in ACE 12We also performed this on other models. Due to space constraint, we do not include the results here. See the supple- mental material for more details. Figure 7: Objective vs. training iterations. LCRF (single) LCRF (multiple) Ratinov and Roth (2009) Lu and Roth (2015) This work (STATE) This work (EDGE) P 84.2 91.5 - 91.1 91.1 91.3 R 83.5 78.2 - 77.0 78.2 78.2 F1 83.8 84.3 83.7 83.5 84.2 84.3 w/s 148.6 283.4 - 1169.7 116.3 554.0 Table 5: Results on CoNLL-2003 (without opti- mizing F1-score). datasets (1.1 points in GENIA, compared to 0.9 and 0.6 points in ACE). These results also lead to the interesting empir- ical finding that our model appears to be able to do well also on recognizing non-overlapping men- tions. This motivates us to conduct the next set of experiments. On data without overlapping mentions: We also performed one additional set of experiments, on the standard CoNLL-2003 dataset (Tjong Kim Sang and De Meulder, 2003), which has no overlapping mentions. The results (without optimizing F1-score) are shown in Table 5. We see that our models based on mention separators outperform baseline mod- els such as the Illinois NER system where external resources are not used (Ratinov and Roth, 2009), and a linear-chain CRF model, although the linear- chain CRF baseline models some interactions be- tween distinct mention types and our models do not. Such results also suggest that modeling the interactions between distinct mention types may not be crucial to get a good performance in men- tion recognition. This is further corroborated by the result of LCRF (multiple), which is higher than the result of LCRF (single) by about 0.5 points. When comparing our model against the mention hypergraph model, we note that our model con- sistently yields a higher recall. We speculate this is due to the fact that as our model does not ex- hibit the issue of spurious structures we discussed in Section 3.1, it is more confident in making its predictions. On convergence: We also empirically analyzed the convergence properties of the two models. Empirically, as illustrated in Figure 7 which shows how the objective improves when the training pro- gresses on ACE-2004, GENIA, and CoNLL-2003, we found that our EDGE-based model requires sig- nificantly less iterations to converge than the men- tion hypergraph on the former two datasets which contain overlapping mentions. We believe it is possible that this slower convergence is due to the spurious structures issue in mention hypergraphs, which causes the objective function to be more complex to optimize. However, some further anal- yses on the convergence issue and the impact of different ways of exploiting features (over differ- ent hyperedges) for the hypergraph-based models are needed. 7 Conclusion and Future Work We proposed the novel mention separators for mention recognition where mentions may overlap with one another. We also proposed two ways these mention separators can be utilized to en- code overlapping mentions, where one of them utilizes a novel multigraph-based representation. We showed that by utilizing mention separators, we can get better recognition results compared to previous models, and by utilizing the multigraph representation, we can maintain a good inference speed, albeit still slower than the mention hyper- graph model. We also performed theoretical anal- ysis on the model and showed that our model does not present the spurious structures issue associ- ated with a previous state-of-the-art model, while still keeping the same inference time complexity. Future work includes further investigations on how to apply the multigraph approach to other structured prediction tasks, as well as applications of the proposed model in other related NLP tasks that involve the prediction of overlapping struc- tures, such as equation parsing (Roy et al., 2016). The code used in this paper is available at http://statnlp.org/research/ie/. ACE-2004 Mention Hypergraph This work (Edge) 100 200 300 400 500 600 700 800 900 1,000 # iterations 120 ·103 100 80 60 40 20 0 0 Obj.Value GENIA Mention Hypergraph This work (Edge) 100 200 300 400 500 600 700 800 900 1,000 # iterations 120 ·103 100 80 60 40 20 0 0 Obj.Value CoNLL-2003 Mention Hypergraph This work (Edge) 50 100 150 200 250 300 350 400 450 # iterations 40 ·103 30 20 10 0 0 Obj.Value Acknowledgments We thank all the reviewers for their useful feed- back to the earlier draft of this paper. This work is supported by MOE Tier 1 grant SUTDT12015008. References Beatrice Alex, Barry Haddow, and Claire Grover. 2007. Recognising Nested Named Entities in Biomedical Text. In Proc. of the Workshop on BioNLP 2007, June, pages 65 -- 72. Kai-Wei Chang, Rajhans Samdani, and Dan Roth. 2013. A Constrained Latent Variable Model for Coreference Resolution. In Proc. of EMNLP. George Doddington, Alexis Mitchell, Mark Przybocki, Lance Ramshaw, Stephanie Strassel, and Ralph Weischedel. 2004. The Automatic Content Extrac- tion (ACE) Program-Tasks, Data, and Evaluation. LREC, 2(1):837 -- 840. Jenny Rose Finkel and Christopher D. Manning. 2009. In Proc. of Nested Named Entity Recognition. EMNLP, page 141. Radu Florian, Hany Hassan, Abraham Ittycheriah, Hongyan Jing, Nanda Kambhatla, Xiaoqiang Luo, H Nicolov, and Salim Roukos. 2004. A Statistical Model for Multilingual Entity Detection and Track- ing. In Proc. of HLT-NAACL. Pankaj Gupta and Bernt Andrassy. 2016. Table Filling Multi-Task Recurrent Neural Network for Joint En- tity and Relation Extraction. In Proc. of COLING. Jin-Dong Kim, Tomoko Ohta, Yuka Tateisi, and Jun'ichi Tsujii. 2003. GENIA Corpus -- A Semanti- cally Annotated Corpus for Bio-textmining. Bioin- formatics, 19(Suppl 1):i180 -- i182. Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In Proc. of EMNLP, pages 388 -- 395. Taku Kudo and Yuji Matsumoto. 2001. Chunking with Support Vector Machines. In Proc. of NAACL, vol- ume 816, pages 1 -- 8, Morristown, NJ, USA. Associ- ation for Computational Linguistics. John Lafferty, Andrew McCallum, and Fernando Pereira. 2001. Conditional Random Fields: Prob- abilistic Models for Segmenting and Labeling Se- quence Data. In Proc. of ICML, pages 282 -- 289. Qi Li, Heng Ji, and Liang Huang. 2013. Joint Event Extraction via Structured Prediction with Global Features. In Proc. of ACL, pages 73 -- 82. Xiao Ling and Daniel S Weld. 2012. Fine-Grained En- tity Recognition. In Proc. of AAAI. Dong C. Liu and Jorge Nocedal. 1989. On the Limited Memory BFGS Method for Large Scale Optimiza- tion. Mathematical Programming, 45(1-3):503 -- 528. Jing Lu, Deepak Venugopal, Vibhav Gogate, and Vin- cent Ng. 2016. Joint Inference for Event Corefer- ence Resolution. In Proc. of COLING, pages 3264 -- 3275. Wei Lu and Dan Roth. 2012. Automatic event extrac- In Pro- tion with structured preference modeling. ceedings of the 50th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 1: Long Papers), pages 835 -- 844, Jeju Island, Korea. Associ- ation for Computational Linguistics. Wei Lu and Dan Roth. 2015. Joint Mention Extrac- tion and Classification with Mention Hypergraphs. In Proc. of EMNLP, pages 857 -- 867. Association for Computational Linguistics. Andrew McCallum and Wei Li. 2003. Early Results for Named Entity Recognition with Conditional Ran- dom Fields, Feature Induction and Web-enhanced Lexicons. In Proc. of HLT-NAACL, volume 4, pages 188 -- 191, Morristown, NJ, USA. Association for Computational Linguistics. Ryan McDonald, Koby Crammer, and Fernando Pereira. 2005. Flexible Text Segmentation with Structured Multilabel Classification. In Proc. of HLT-EMNLP, October, pages 987 -- 994, Morristown, NJ, USA. Association for Computational Linguis- tics. Mike Mintz, Steven Bills, Rion Snow, and Dan Ju- rafsky. 2009. Distant Supervision for Relation Ex- traction without Labeled Data. In Proc. of ACL- IJCNLP, pages 1003 -- 1011. Diego Mollá, Menno Van Zaanen, and Steve Cassidy. 2007. Named Entity Recognition in Question An- swering of Speech Data. In Proc. of the Australasian Language Technology Workshop, pages 57 -- 65. Aldrian Obaja Muis and Wei Lu. 2016. Learning to Recognize Discontiguous Entities. In Proc. of EMNLP, pages 75 -- 84, Stroudsburg, PA, USA. As- sociation for Computational Linguistics. David Nadeau and Satoshi Sekine. 2007. A Sur- vey of Named Entity Recognition and Classification. Lingvisticae Investigationes, 30(1):3 -- 26. Thien Huu Nguyen, Kyunghyun Cho, and Ralph Gr- ishman. 2016. Joint Event Extraction via Recurrent Neural Networks. In Proc. of NAACL-HLT, pages 300 -- 309. Lev Ratinov and Dan Roth. 2009. Design Challenges and Misconceptions in Named Entity Recognition. In Proc. of CoNLL, page 147. Association for Com- putational Linguistics. Subhro Roy, Shyam Upadhyay, and Dan Roth. 2016. Equation Parsing : Mapping Sentences to Grounded Equations. In Proc. of EMNLP, pages 1088 -- 1097, Stroudsburg, PA, USA. Association for Computa- tional Linguistics. Sunita Sarawagi and William W. Cohen. 2004. Semi- Markov Conditional Random Fields for Information Extraction. In Proc. of NIPS, pages 1185 -- 1192. Hong Shen and Anoop Sarkar. 2005. Voting Between Multiple Data Representations for Text Chunking. In Advances in Artificial Intelligence, volume 3501, chapter 40, pages 389 -- 400. Springer-Verlag, Berlin, Heidelberg. Hanna Suominen, Sanna Salanterä, Sumithra Velupil- lai, Wendy W. Chapman, Guergana Savova, Noemie Elhadad, Sameer Pradhan, Brett R. South, Danielle L. Mowery, Gareth J. F. Jones, Johannes Leveling, Liadh Kelly, Lorraine Goeuriot, David Martinez, and Guido Zuccon. 2013. Overview of the ShARe/CLEF eHealth Evaluation Lab 2013. In P. Forner, editor, Information Access Evaluation: Multilinguality, Multimodality, and Visualization, volume 8138, chapter 24, pages 212 -- 231. Springer- Verlag, Berlin, Heidelberg. Buzhou Tang, Yonghui Wu, Min Jiang, Joshua C. Denny, and Hua Xu. 2013. Recognizing and Encod- ing Disorder Concepts in Clinical Text using Ma- chine Learning and Vector Space. In Proc. of the ShARe/CLEF Evaluation Lab. Yuka Tateisi and Jun'ichi Tsujii. 2004. Part-of-Speech Annotation of Biology Research Abstracts. In Proc. of LREC, pages 1267 -- 1270. Erik F Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 Shared Task: Language-independent Named Entity Recog- nition. In Proc. of HLT-NAACL, pages 142 -- 147. Labeling Gaps Between Words: Recognizing Overlapping Mentions with Supplementary Material for Mention Separators Aldrian Obaja Muis and Wei Lu Singapore University of Technology and Design {aldrian_muis,luwei}@sutd.edu.sg an A0 E0 T0 I0 an A0 E0 T0 I0 Apache helicopter A1 E1 T1 A I1 X C F I2 X Apache helicopter A1 E1 T1 A I1 X E F I2 X B B Apache helicopter C E F I2 X A1 E1 T1 I1 A D X Apache helicopter I2 X A1 E1 T1 I1 A D X an A0 E0 T0 I0 an A0 E0 T0 I0 B B (top left) A simplified example of a Figure 1: mention hypergraph with restricted edges. (oth- ers) The three possible (hyper-)paths from the root node to the leaf node. by the subgraph from this node to the leaf node X. In particular, the node I1 encodes three par- tial mentions (partial because the start of the men- tions are undefined yet, as they are defined by the edge from T-nodes to I-nodes): {"Apache he- licopter"}, {"Apache"}, and {"Apache","Apache helicopter"}, as shown in Figure 2. Similarly, we can see the subgraphs rooted at nodes A1 and E0 in Figure 3 and 4, respectively. Now, the node A0 includes the 9 possible en- tity combinations which are the results of taking all possible combinations in A1 and E0. The list of mention combinations and the respective paths used to represent each of these combinations is as follows: a. A-C-F and B-C-F (Apache helicopter, an Apache helicopter) Abstract This is the supplementary material for "Labeling Gaps Between Words: Recog- nizing Overlapping Mentions with Men- tion Separators" (Muis and Lu, 2017). This material explains in more depth the issue of spurious structures and also the experiments settings. 1 Details on Spurious Structures About mention hypergraph, we remarked in Sec- tion 3.1 that the normalization term calculated by the forward-backward algorithm includes spurious structures, which are structures that are not part of the true normalization term. This section shows in more details how this is the case using some ex- amples. Consider the simplified mention hypergraph as shown in Figure 1 (top left) consisting of three words and where the possible edges have been re- stricted to what are shown in the figure. Also, let A, B, C, D, E, F respectively denote the edges T1 → (I1), I0 → (I1), I1 → (I2), I1 → (X), I1 → (I2, X), and I2 → (X) as shown in Fig- ure 1 (left). Further assume that features are only defined on these labeled edges. Recall that in graphical models, any prediction by the model forms a (hyper-)path from the root node (here A0) to the leaf node (X), which means each node other than the leaf node has exactly one outgoing (hyper-)edge. Now, notice that there are only three possible paths here, one for each of the three (hyper-)edges coming out from the node I1 associated with the word "Apache". See the top right, bottom left, and bottom right of Figure 1 for the visualization. Now recall that in mention hypergraph, each node is assigned a certain set of mention com- binations which the node represents, as defined arXiv:1810.09073v1 [cs.CL] 22 Oct 2018 I1 X C (a) F I2 X I1 D X I2 X (b) I1 X E F I2 X (c) C E I1 D X F I2 X Figure 2: (left) The graphical representation of all 3 mention combinations represented by the node I1. (right) The full graph rooted at I1. C E F I2 X A1 E1 T1 I1 A D X F I2 X E (c) A1 E1 T1 A I1 X I2 X (b) A1 E1 T1 I1 A D X A1 E1 T1 A I1 X F I2 X C (a) Figure 3: (left) The graphical representation of all 3 mention combinations represented by the node A1. (right) The full graph rooted at A1. E0 T0 I0 B I1 C X (a) F I2 X E0 T0 I0 E0 T0 I0 B I1 D X (b) I2 X B I1 E X (c) F I2 X E0 T0 I0 B C E I1 D X F I2 X Figure 4: (left) The graphical representation of all 3 mention combinations represented by the node E0. (right) The full graph rooted at E0. b. A-C-F and B-D (Apache helicopter, an Apache) c. A-C-F and B-E-F (Apache helicopter, an Apache helicopter, an Apache) d. A-D and B-C-F (Apache, an Apache heli- copter) e. A-D and B-D (Apache, an Apache) f. A-D and B-E-F (Apache, an Apache heli- copter, an Apache) g. A-E-F and B-C-F (Apache helicopter, Apache, an Apache helicopter) h. A-E-F and B-D (Apache helicopter, Apache, an Apache) i. A-E-F and B-E-F (Apache helicopter, Apache, an Apache helicopter, an Apache) See Figure 5 for a graphical representation of those 9 mention combinations. We display some nodes twice to highlight the different paths repre- senting each distinct mention, a result of consider- ing the mentions in A1 and E0 independently. No- tice that this differing paths exist because the node I1 has two incoming edges in the path from A0 to I1. Further note that these are only the graphical representations of the mention combinations rep- resented by the root node, as defined by the scor- ing of the structures in the objective function. The crucial observation is that out of those nine mention combinations, only three of them form valid paths of the original graph in Figure 1, namely: (a), (e), and (i). The other six men- tion combinations will never be predicted by the model, as they do not form paths found in the full graph. For example, in (b), the node I1 has two outgoing edges: C and D, and so this graph does not form a path. Those six mention combinations which are part of the structures represented by the root node A0 which do not form valid paths are the spurious structures, as during training they are calculated as part of the normalization term, but the model can not output any of those as a prediction, since they do not form a path. In essence, the normalization term fails to take into account the restriction of forming a path when A0 E0 T0 I0 A0 E0 T0 I0 A0 E0 T0 I0 C C I2 F I2 F X B A1 E1 T1 A I1 I1 X (a) A1 E1 T1 A B I1 I1 D C X (d) A1 E1 T1 A B I1 I1 E C I2 F X (g) F I2 X I2 F X A0 E0 T0 I0 A0 E0 T0 I0 A0 E0 T0 I0 A1 E1 T1 A I1 I1 D B C X (b) A1 E1 T1 A B I1 D I1 D X (e) A1 E1 T1 A I1 I1 D E X (h) B F I2 X I2 X F I2 X A0 E0 T0 I0 A0 E0 T0 I0 A0 E0 T0 I0 B A1 E1 T1 A I1 I1 E X (c) A1 E1 T1 A B I1 I1 D E X (f) A1 E1 T1 A I1 I1 E X (i) B C I2 F I2 F X F I2 X E I2 F I2 F X Figure 5: The graphical representation of all 9 mention combinations represented by node A0. See main text for details. calculating the scores of all possible paths because it is considering the two sub-paths from A1 and E0 independently, which cannot capture the re- striction that the node I1 should have only one outgoing edge. This is what causing the spurious structures issue in mention hypergraph. encode any overlapping mentions in a sentence, following the description at Section 4 in the main paper. As a final remark, note that, depending on the heuristics used, when the model outputs structure (i) as its prediction, we can still interpret that struc- ture to mean any of the six mention combina- tions. More technically, this means that the spuri- ous structures do not affect the interpretation pro- cess, but they do affect how the objective function is calculated, which in turns affects how the learn- ing process goes. And as can be seen from the experiments, removing these spurious structures from the objective function indeed improves the entity recognition ability of the model. 2 Mention Separators This section will give more examples and illustra- tions on how mention separators can be used to Suppose we want to encode the phrase "the IL2 regulatory region" containing two DNA men- tions: "IL2" and "regulatory region" (example taken from GENIA dataset). In Figure 6, we start in step (1) by taking note of the possible start- ing, continuing, or ending marker in the gaps be- tween the words. Then in step (2) we process the mention "IL2", marking the starting and ending marker before and after the mention accordingly. In step (3) we process the mention "IL2 regulatory region", marking the starting, continuing, and end- ing marker accordingly. Note that here it shares the starting marker as the previous mention. After all mentions have been processed, at step (4) we convert the combination of markers at each gap to the corresponding mention separator. Finally, we model the resulting sequence of mention sep- arators into the EDGE-based model, selecting the edge corresponding to the mention separators. ] ] ] E E X X ] - [ ] - [ ] - [ EC regulatory regulatory regulatory regulatory X O2 ] - [ ] - [ ] - [ C X region region region region O3 I3 ES CC S EC ECS S E I2 ES CC S EC ECS IL2 IL2 IL2 IL2 O1 I1 S E ] - [ ] - [ ] - [ S X ES CC S EC ECS (1) (2) (3) (4) R [ [ [ X X S the the the the O0 I0 S E Figure 6: Example on how to encode mentions using mention separators with the EDGE-based model. The decoding process will be the reverse of the encoding process, while using some heuristics to interpret the mention separator sequence. Con- tinuing the example, given the path in the EDGE- based model, we extract the sequence of mention separators, and then convert them into the mark- ers at each gap, resulting in the one we see at step (3). Now, we need to interpret this sequence to find out what are the mentions encoded by this se- quence. First we note that since the end marker after the word "region" is active, that means there is a mention ending at that word. And since the only active starting marker is the one before the word "IL2", it must be the case that "IL2 regu- latory region" is one of the mentions encoded by this sequence. This mention already explains the presence of most active markers, except the end marker after the word "IL2". This means there is another mention ending with the word "IL2". And again, since there is only one active starting marker, we conclude that "IL2" is another mention encoded by the sequence. Finally, we note that these two mentions already explain the mention separator sequence (i.e., these two mentions, when encoded, will result in the same mention separator sequence that we have), and so we end the inter- pretation process. Note that the example in Figure 6 shows only the graph for recognizing one type. In the full model, there will be multiple chains, one for each type. An example of the full model can be seen in Figure 7. 2.1 Relation to Previous Work We also want to remark that the number of paths in our multigraph-based model can be calculated in the same way as how we previously calculated the number of canonical encoding for discontigu- ous mention recognition model, which is based on the mention hypergraph, using a transition matrix (Muis and Lu, 2016). In fact, the number of edges between two states in our multigraph-based model reflects the numbers in the transition matrix, and so this multigraph-based model can be seen as a model that utilizes the canonical structures found in the mention hypergraph model. This means the way we use multigraph to represent the overlap- ping mentions as modeled by the mention hyper- graph model theoretically can also be applied to the discontiguous mention model. However, the number of edges in the multi- graph representation will explode. To illustrate, in mention hypergraph, since there is only 1 node per word (excluding the A, E, and T nodes), the multigraph-based model requires only 21 = 2 states with 23 = 8 edges per word, while in the discontiguous mention model supporting three components, since there are 5 nodes per word (B0, O1, B1, O2, and B2), the multigraph-based model will require 25 = 32 nodes, with average num- ber of edges per word being 213 = 8192, which makes it much slower than the hypergraph-based counterpart with only 25 edges per word. So we can say that our multigraph-based approach trades off the speed in mention hypergraph with a higher F1-score. 3 Features For ACE datasets we used these features: 1. Words and POS tags (with window of 3 words to the left and right of current word) 2. Words and POS tags n-gram (up to length 4 containing current word) 3. Bag-of-word (with window of 5 words to the left and to the right of current word) 4. Orthographic (following Lu and Roth (2015)) 5. Parent node type the [[NF-AT]PROT binding site ]DNA X S X O8 S X O9 S O10 S X O11 X X I11 E O11 CC E ES S EC ECS I10 O10 CC E ES S EC ECS I9 O9 CC E ES S EC ECS I8 O8 CC E ES S EC ECS of O7 I7 O7 multimer X S X O6 S CC E ES S EC ECS I6 O6 CC E ES S EC ECS a O5 I5 O5 X S CC E ES S EC ECS [[ IL2 ]DNA regulatory region]DNA or X X X O1 O2 X O3 O4 I4 O4 CC E ES S EC ECS I3 O3 CC CC E ES ES S S EC EC ECS ECS I2 O2 CC E ES S EC ECS I1 O1 CC E ES S EC ECS S S S S the O0 I0 O0 X S T0 T1 R I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 I10 I11 Figure 7: The multigraph model with two chains representing two types: DNA and PROT. CoNLL2003-dev CoNLL2003-test LCRF (single) LCRF (multiple) Ratinov and Roth (2009) Lu and Roth (2015) This work (STATE) This work (EDGE) P 90.0 94.4 - 94.4 94.2 94.5 R 88.9 84.6 - F 89.5 89.2 89.3 88.5 89.2 89.3 P 84.2 91.5 - R 83.6 78.2 - F 83.9 84.3 83.7 83.5 84.2 84.3 CoNLL2003-dev (F optimized) F P 89.5 90.1 89.6 92.7 R 88.9 86.8 - - - CoNLL2003-test (F optimized) F P 83.8 84.3 84.7 88.6 R 83.4 81.2 - - - 84.6 86.3 89.2 82.9 82.4 80.4 83.8 84.3 84.6 w/s 148.6 283.4 - 1169.7 116.3 554.0 91.1 91.1 91.3 83.4 89.2 89.6 84.7 89.8 84.6 Table 1: Complete results on CoNLL-2003. 77.0 78.2 78.2 88.7 88.1 86.5 89.7 91.2 93.3 For GENIA we used these features: 1. Words and POS tags (with window of 2 words to the left and right of current word) 2. Words and POS tags n-gram (up to length 4 containing current word) 3. Bag-of-word (with window of 5 words to the left and right of current word) 4. Brown clusters with window of 1 word to the left and right of current word (using 100 or 1000 clusters built from training data only) 5. Word shape (Finkel and Manning (2009)) 6. Prefixes and suffixes of current word (up to length 6) 7. Edge type For CoNLL 2003 we used these features: 1. Words and POS tags (with window of 2 words to the left and right of current word) 2. Words and POS tags n-gram (up to length 4 containing current word) 3. Bag-of-word (with window of 5 words to the left and right of current word) 4. Word shape (with window of 2 words to the left and right of current word) 5. Prefixes and suffixes of current word (up to length 5) 6. Orthographic (following Lu and Roth (2015)) 7. Edge type The mention penalty feature was added to all models by assigning it to the edges which have the semantics of starting a new entity, similar to how it was defined originally in Lu and Roth (2015). More specifically, for linear-chain CRF models we add the mention penalty feature to all incoming edges of the B and U nodes. For our STATE-based model we add it to all incoming edges of the nodes that includes S. For our EDGE-based model we add it to the incoming edges of the I nodes. 4 GENIA Preprocessing For GENIA, we used GENIAcorpus3.02p that comes with POS tags for each word (Tateisi and Tsujii, 2004). Similar to the problem faced by Finkel and Manning (2009) on JNLPBA dataset, we also find tokenization issues in this corpus. As described by Tateisi and Tsujii (2004), when a hyphenated word such as IL-2-induced is par- tially annotated as an entity (in this case IL-2), the POS annotation corpus splits it into two tokens, which when done in test set will leak some infor- mation about the presence of entity. Unlike Finkel and Manning (2009) which tried to match the tok- enization during testing, we simply further split all tokens at some punctuations (those matching the regular expression [-/,.+]), while keeping the information that they all originally come from the same word. This has the advantage of simplifying the tokenization procedure, although it makes the task slightly more difficult due to the higher num- % ACE-2004 O 42 Ø 58 ACE-2005 O 32 Ø 68 O 24 Ø 76 GENIA P 65.6 67.4 64.6 60.4 78.3 76.6 R 40.9 66.6 43.4 62.7 52.6 70.6 F1 58.5 69.4 57.4 64.7 67.3 72.7 LCRF (single) LCRF (multiple) F1 50.4 67.0 51.9 61.6 62.9 73.4 This work (STATE) F1 P 72.2 62.5 69.5 74.2 60.8 68.6 63.8 64.9 67.5 77.0 75.2 72.8 Table 2: Results on different types of sentences. Lu and Roth (2015) F1 P 72.5 60.8 68.6 72.5 59.4 68.1 64.6 64.1 67.7 76.3 73.1 71.9 R 52.4 65.0 52.6 65.1 60.8 70.7 P 69.6 70.5 68.5 64.1 78.0 74.7 R 50.4 68.2 49.3 65.3 59.2 70.7 R 55.1 65.4 54.7 62.7 60.0 70.6 This work (EDGE) F1 P 72.1 62.6 69.5 74.1 61.8 70.4 65.2 67.2 67.4 76.5 74.8 73.0 R 55.3 65.5 55.0 63.4 60.3 71.3 ber of tokens. Also, to handle the discontiguous entities present in GENIA dataset (mainly due to coor- dinated entities involving ellipsis), following the approach used by the JNLPBA shared task or- ganizer (Kim et al., 2004), we consider a group of coordinated entities as one structure. For ex- ample, in ". . . the [T- and B-lymphocytes] count in . . . ", the entities "T-lymphocytes" and "B- lymphocytes" are annotated as one structure "T- and B-lymphocytes". 5 Results on CoNLL-2003 Table 1 shows the full result of the experiments on CoNLL-2003 dataset, which includes the result in CoNLL-2003 development set, and also the results after optimizing the F1 score. We see that since the precision and recall in LCRF model is already bal- anced, optimizing the F1 score does not improve much, and even slightly decrease the result in the test set. We do see, however, some slight improve- ments in other models. 6 Results on Overlapping and Non-overlapping Sentences Table 2 shows the complete scores of each model on the two subsets of the test set: the overlap- ping ones (O) and the non-overlapping ones (Ø). We can see that the edge-based model is quite ro- bust to the amount of overlapping mentions in the dataset. For example, in GENIA dataset where the proportion of overlapping mentions is lower com- pared to the ACE datasets, it still achieves good results both in the overlapping part and the non- overlapping part. 7 Hyperparameter For each model, we tuned the l2-regularization coefficient λ from the values {0.0, 0.001, 0.01, 0.1, 1.0}. And for GENIA we additionally tuned the number of Brown clusters used from the val- ues {100, 1000}. Table 3 lists the optimal λ for each dataset and model. For GENIA, the optimal Brown cluster size was found to be 1000, except for 'This work (STATE)', where the best cluster size is found to be 100. ACE'04 ACE'05 GENIA CoNLL 0.001 LCRF (single) 0.001 LCRF (multiple) 0.01 Lu and Roth (2015) 0.001 This work (STATE) This work (EDGE) 0.001 Table 3: The value of l2 regularization parameter that gives the best result in development set. 0.1 0.001 0.001 0.0 0.001 0.01 0.0 0.0 0.001 0.001 0.1 1.0 1.0 1.0 1.0 References Jenny Rose Finkel and Christopher D. Manning. 2009. In Proc. of Nested Named Entity Recognition. EMNLP, page 141. Jin-Dong Kim, Tomoko Ohta, Yoshimasa Tsuruoka, Yuka Tateisi, and Nigel Collier. 2004. Introduction to the Bio-entity Recognition Task at JNLPBA. In Proc. of JNLPBA, page 70. Wei Lu and Dan Roth. 2015. Joint Mention Extrac- tion and Classification with Mention Hypergraphs. In Proc. of EMNLP, pages 857 -- 867. Association for Computational Linguistics. Aldrian Obaja Muis and Wei Lu. 2016. Learning to Recognize Discontiguous Entities. In Proc. of EMNLP, pages 75 -- 84, Stroudsburg, PA, USA. As- sociation for Computational Linguistics. Aldrian Obaja Muis and Wei Lu. 2017. Labeling Gaps Between Words: Recognizing Overlapping Men- tions with Mention Separators. In Proc. of EMNLP, Copenhagen, Denmark. Association for Computa- tional Linguistics. Lev Ratinov and Dan Roth. 2009. Design Challenges and Misconceptions in Named Entity Recognition. In Proc. of CoNLL, page 147. Association for Com- putational Linguistics. Yuka Tateisi and Jun'ichi Tsujii. 2004. Part-of-Speech Annotation of Biology Research Abstracts. In Proc. of LREC, pages 1267 -- 1270.
1901.08759
1
1901
2019-01-25T07:09:14
Misleading Metadata Detection on YouTube
[ "cs.CL", "cs.CV", "eess.IV" ]
YouTube is the leading social media platform for sharing videos. As a result, it is plagued with misleading content that includes staged videos presented as real footages from an incident, videos with misrepresented context and videos where audio/video content is morphed. We tackle the problem of detecting such misleading videos as a supervised classification task. We develop UCNet - a deep network to detect fake videos and perform our experiments on two datasets - VAVD created by us and publicly available FVC [8]. We achieve a macro averaged F-score of 0.82 while training and testing on a 70:30 split of FVC, while the baseline model scores 0.36. We find that the proposed model generalizes well when trained on one dataset and tested on the other.
cs.CL
cs
Misleading Metadata Detection on YouTube Priyank Palod1, Ayush Patwari2, Sudhanshu Bahety3, Saurabh Bagchi2, and Pawan Goyal1 1 {priyankpalod,pawang.iitk}@gmail.com, IIT Kharagpur, WB, India 2 {patwaria,sbagchi}@purdue.edu, Purdue University, IN, USA 3 [email protected], Salesforce.com, CA, USA Abstract. YouTube is the leading social media platform for sharing videos. As a result, it is plagued with misleading content that includes staged videos presented as real footages from an incident, videos with misrepresented context and videos where audio/video content is mor- phed. We tackle the problem of detecting such misleading videos as a supervised classification task. We develop UCNet - a deep network to detect fake videos and perform our experiments on two datasets - VAVD created by us and publicly available FVC [8]. We achieve a macro aver- aged F-score of 0.82 while training and testing on a 70:30 split of FVC, while the baseline model scores 0.36. We find that the proposed model generalizes well when trained on one dataset and tested on the other. 1 Introduction The growing popularity of YouTube and associated economic opportunities for content providers has triggered the creation and promotion of fake videos and spam campaigns on this platform. There are various dimensions to this act in- cluding creating videos for political propaganda as well as choosing clickbaity or shocking title/thumbnails in order to get more views. YouTube itself has classi- fied spam videos into many different categories including misleading metadata (metadata includes the title, description, tags, annotations, and thumbnail). We use the following definition of "fake" videos [7]: 1. Staged videos in which actors perform scripted actions under direction, published as user generated content (UGC). 2. Videos in which the context of the depicted events is misrep- resented (e.g., the claimed video location is wrong). 3. Past videos presented as UGC from breaking events. 4. Videos of which the visual or audio content has been altered. 5. Computer-generated Imagery (CGI) posing as real. Spam detection in social media has been a widely researched topic in the aca- demic community [11,10]. In [3], the author describes a model to detect spam in tagging systems. For video sharing platforms, most of the work has concentrated on finding spam comments [1,9]. Recently, there have been works on creating a dataset of fake videos and com- putationally detecting fake videos [7,6]. As a result, there is a small but publicly available dataset of fake videos on YouTube called the Fake Video Corpus (or FVC) [8]. They had also developed a methodology to classify videos as fake or real, and reported an F-score of 79% using comment based features. After in- specting their code, we found out that the reported F-score was for the positive 2 P. Palod, A. Patwari et al. (fake) class only. So we reproduced their experiment to find that the macro av- erage F-score by their method is only 36% since the classifier calls almost all videos as fake. Through our experiments, we find that simple features extracted from meta- data are not helpful in identifying fake videos. Hence we propose to use a deep neural network on comments for the task and achieve promising results. While using a 70:30 split of the FVC dataset, we find that our method achieves an F-score of 0.82 in comparison to a score of 0.36 by the baseline, and 0.73 by the feature based approach. Further, we also present a new dataset of fake videos containing 123 fake and 423 real videos called VAVD. To see the robustness of our approach, we also train UCNet on a balanced subset of VAVD, and test on FVC dataset, achieving an F-score of 0.76, better than the score obtained by the feature-based classifier trained on the same dataset. Feature-based classifiers, on the other hand, do not give robust performance while trained on our dataset, and tested on FVC. 2 Dataset Preparation We crawled metadata and comments for more than 100,000 videos uploaded between September 2013 and October 2016 using YouTube REST data API v3. The details include video metadata (title, description, likes, dislikes, views etc.), channel details (subscriber count, views count, video count, featured channels etc.) and comments (text, likes, upload date, replies etc.). With around 100K crawled videos and possibly very low percentage of fake content, manually annotating each and every video and searching for fake videos was infeasible. Also, random sampling from this set is not guaranteed to capture sufficient number of fake videos. Therefore, we used certain heuristics to boost the proportion of fake videos in a small sample to be annotated. We first removed all the videos with views less than 10,000 (the average number of views in the crawled set) and with comments less than 120 (the average number of comments on a video in the crawled set). This was done to have only popular videos in the annotated dataset. A manual analysis of comments on some hand-picked spam videos gave us some comments such as "complete bullshit", "fake fake fake" etc. Then a search for more videos containing such phrases was performed on the dataset. Repeating the same process (bootstrapping the "seed phrases" as well as the set of videos) thrice gave a set of 4,284 potentially spam videos. A similar method was adopted for clustering tweets belonging to a particular rumor chain on twitter in [12] with good effect. After this, we used the ratio of dislike count:like count of the video for further filtering. Sorting the videos based on the ratio in non-ascending order and taking videos having ratio greater than 0.3 gave us a final set with 650 videos. An online annotation task was created where a volunteer was given the link to a video and was asked to mark it as "spam" or "legitimate". An option to mark a video as "not sure" was also provided. 33 separate surveys having 20 videos per survey (one having only 10) were created and were submitted for Misleading Metadata Detection on YouTube 3 annotation to 20 volunteering participants. This task was repeated for a second round of annotation with the same set of annotators without repetition. Statis- tics from the two rounds of annotation can be seen in Table 1. We see that inter-annotator agreement was not perfect, an issue which has been reported repeatedly in prior works for annotation tasks in social media [2,5]. The dis- crepancies in the annotations were then resolved by another graduate student volunteer and if any ambiguity still persisted in characterizing the video as spam, the video was marked as "not sure". We call this dataset as VAVD (Volunteer Annotated Video Dataset) and the annotations4 as well as our codes5 are publicly available. Table 1: Statistics from the two rounds of annotations (a) Number of videos in different classes (b) Annotator agreements Spam Legitimate Not Sure Round1 Round2 Final 123 423 104 158 400 92 130 422 98 Spam Legitimate Not Sure Spam Legitimate Not Sure 70 54 6 62 308 27 26 38 59 FVC dataset: The Fake video corpus (FVC, version 2)6 contains 117 fake and 110 real video YouTube URLs, alongside annotations and descriptions. The dataset also contains comments explaining why a video has been marked as fake/real. Though the dataset contains annotations for 227 videos, many of them have been removed from YouTube. As a result, we could crawl only 98 fake and 72 real videos. We divide these videos into two disjoint sets, FVC70 (30), containing 70 (30)% of these videos for various experiments. 3 Experiments with simple features We first tried using simple classifiers like SVMs, decision trees and random forests on VAVD and test it on FVC, which is the benchmark dataset. We hypothesized several simple features that might differentiate a fake video from a legitimate one, as described below: -- has clickbait phrase: This feature is true if the title has a phrase commonly found in clickbaits. For eg. 'blow your mind', 'here is why', 'shocking', 'ex- posed', 'caught on cam'. We used 70 such phrases gathered manually. -- ratio violent words: A dictionary of several 'violent' words like 'kill', 'assault', 'hack', 'chop' was used. The value of this feature is equal to the fraction of violent words in the title. We hypothesize that violent words generate fear which leads to more views for the video, hence more used in spams. 4 https://github.com/ucnet01/Annotations UCNet 5 https://github.com/ucnet01/UCNet Implementation 6 https://zenodo.org/record/1147958#.WwBS1nWWbCJ 4 P. Palod, A. Patwari et al. -- ratio caps: This feature is equal to the ratio of number of words in the title which are in upper case to the total number of words in the title. -- Tweet Classifier Score - Title: The Image verification corpus (IVC)7 is a dataset containing tweets with fake/real images. We trained a multi-layer perceptron on IVC to predict the probability of a tweet (i.e., the accompany- ing image) being fake using only simple linguistic features on the tweet text. Now, we use the same trained network and feed it the title of a video as input. The probability of fakeness that it outputs is then taken as a feature,. -- dislike like ratio: Ratio of number of dislikes to number of likes on the video. -- comments fakeness: This is equal to the ratio of comments on the video which mention that the video is fake. To categorize if a comment says that the video is fake or not, we detect presence of words and regexes like 'fa+ke+', 'hoax', 'photoshopped', 'clickbait', 'bullshit', 'fakest', 'bs'. -- comments inappropriateness: This feature is equal to the ratio of number of comments with swear words to the total number of comments on the video. -- comments conversation ratio: This is the ratio of comments with at least one reply to the total number of comments on the video. Since some of these classifiers are sensitive to correlations in the features, we first decided to remove the lesser important feature among each pair of correlated features. For this, we calculated correlations among the features on all the 100K videos and identified the pair of features with a correlation of more than 0.2. Then we generated feature importance scores using the standard random forests feature selection method and eliminated the lesser important feature from each pair. We trained our classifiers using only these remaining features. Table 2 shows the performance of some of these classifiers when trained on VAVD and tested on FVC30, as well as when trained on FVC70 and tested on FVC30 with Macro Averaged Precision (P), Recall (R) and F1 Score (F) as the metrics. Table 2: Performance of simple classifiers tested on FVC30 (a) training dataset: VAVD (b) training dataset: FVC70 Classifier P R F Classifier P R F SVM- RBF 0.74 0.60 0.49 Random Forests 0.73 0.58 0.46 Logistic Regression 0.54 0.53 0.45 0.53 0.52 0.46 Decision Tree SVM- RBF 0.56 0.55 0.54 Random Forests 0.74 0.73 0.73 Logistic Regression 0.53 0.53 0.53 0.73 0.67 0.67 Decision Tree We see that although Random Forests classifier performs the best when trained and tested on FVC, its performance is very bad when trained on VAVD. To understand the reason for such poor performance of these classifiers, we plotted the PCA of the features on FVC dataset, which is shown in Figure 1 (left). Through the PCA, we can see that though the features may help in identifying some fake videos (the ones on the far right in the plot), for most of the videos, they fail to discriminate between the two classes. 4 UCNet : Deep learning Approach Our analysis during dataset preparation reveals that comments may be strong indicator of fakeness. However, not all comments may be relevant. Hence, we 7 https://github.com/MKLab-ITI/image-verification-corpus/tree/master/mediaeval2016 Misleading Metadata Detection on YouTube 5 computed "fakeness vector" for each comment, a binary vector with each ele- ment corresponding to the presence or absence of a fakeness indicator phrase (e.g., "looks almost real"). We used 30 such fakeness indicating phrases. Now, for each comment, we passed the GoogleNews pre-trained word2vec [4] embed- dings of words of the comment sequentially to the LSTM. The 300-dimensional output of the LSTM is hence referred as "comment embedding". We also took the fakeness vector and passed it through a dense layer with sigmoid activation function, to get a scalar between 0 to 1 for the comment called as the "weight" of the comment. The idea here was that the network would learn the relative importance of the phrases to finally give the weight of the comment. We then multiplied the 300-dimensional comment embeddings with the scalar weight of the comment to get "weighted comment embedding". Now we took the average of all these weighted comment embeddings to get one 300-dimensional vector representing all the comments on the video called the "unified comments em- bedding". The unified comments embedding was then concatenated with simple features described before and passed through 2 dense layers, first with ReLU activation and 4-dimensional output and the second with softmax to get a 2 di- mensional output representing the probability of the video being real and fake, respectively. This network is called UCNet (Unified Comments Net)8 and is trained using adam's optimizer with learning rate 10−4 and cross entropy as the loss function. Training the network on VAVD and testing on whole FVC gives an F-score of 0.74 on both classes as shown in Table 3. Training and testing UCNet on FVC70 and FVC30 respectively gives a macro F-score of 0.82. We also reproduced the experiments that [7,6] did and found their Macro average F-score to be 0.36 on both 10-fold cross validation and on the 70:30 split. Table 3: Performance of UCNet tested on FVC30 (a) training dataset: VAVD (b) training dataset: FVC70 P R F #Videos P R F #Videos Class Real Fake 0.64 0.88 0.74 0.88 0.64 0.74 Macro avg 0.76 0.76 0.74 72 98 170 Class Real fake 0.74 0.87 0.8 0.89 0.77 0.83 Macro avg 0.82 0.82 0.82 23 31 54 To visualize the discriminating power of comments, we trained UCNet on VAVD. Then we gave each video of FVC as input to the network and extracted the unified comment embedding. Now we performed PCA of these unified com- ment embeddings to 2 dimensions and plotted it in Figure 1 (right). We observe that comment embeddings can discriminate among the two classes very well as compared to simple features (compare the left and right sub-figures). Since VAVD had certain properties that overlap with our features (e.g., many fakeness indicating phrases were picked from videos in this dataset), we decided not to test our methods on VAVD as it might not be fair. Hence, we have used it only as a training corpus, and tested on an unseen FVC dataset. Although, future works may use VAVD as a benchmark dataset as well. 8 https://bit.ly/2rZ7cAT 6 P. Palod, A. Patwari et al. Finally, we present Table 4 comparing performance of different classifiers when tested on FVC30. Random forests has been reported in the table since it was the best performing simple classifier on the test set. We can see that even if trained on (a balanced subset of) VAVD, UCNet performs better than any simple classifier or the baseline. Table 4: Overall performance comparison of classifiers on FVC30 test set Training Set Precision Recall F-Score 0.82 0.76 0.74 0.29 0.82 0.76 0.73 0.5 0.82 0.76 0.73 0.37 Classifier UCNet UCNet FVC70 class balanced subset of VAVD Random Forests Baseline FVC70 FVC70 Fig. 1: PCA plots. Red dots are Fake Videos while blue dots are Real Videos from FVC. (a) Simple Features (b) Unified Comment Embeddings 5 Conclusions Our work presents VAVD, a new dataset for research on fake videos, and also presents UCNet , a deep learning based approach to identify fake videos with high accuracy using user comments. Future work will involve putting more emphasis on content and metadata than the comments, to be able to detect latest or 'breaking news' spam videos. 6 Acknowledgement This material is based in part upon work supported by a Google Faculty Award to Saurabh. Any opinions, findings, and conclusions or recommendations ex- pressed in this material are those of the authors and do not necessarily reflect the views of the sponsor. Misleading Metadata Detection on YouTube 7 References 1. Ammari, A., Dimitrova, V., Despotakis, D.: Semantically enriched machine learn- ing approach to filter youtube comments for socially augmented user models. UMAP pp. 71 -- 85 (2011) 2. Becker, H., Naaman, M., Gravano, L.: Learning similarity metrics for event identi- fication in social media. In: Proceedings of the third ACM international conference on Web search and data mining. pp. 291 -- 300. ACM (2010) 3. Koutrika, G., Effendi, F.A., Gyongyi, Z., Heymann, P., Garcia-Molina, H.: Com- bating spam in tagging systems. In: Proceedings of the 3rd international workshop on Adversarial information retrieval on the web. pp. 57 -- 64. ACM (2007) 4. Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed repre- sentations of words and phrases and their compositionality. In: Advances in neural information processing systems. pp. 3111 -- 3119 (2013) 5. Ott, M., Choi, Y., Cardie, C., Hancock, J.T.: Finding deceptive opinion spam by any stretch of the imagination. In: Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies-Volume 1. pp. 309 -- 319 (2011) 6. Papadopoulos, S.A.: Towards automatic detection of misinformation in social me- dia 7. Papadopoulou, O., Zampoglou, M., Papadopoulos, S., Kompatsiaris, Y.: Web video verification using contextual cues. In: Proceedings of the 2nd International Work- shop on Multimedia Forensics and Security. pp. 6 -- 10. ACM (2017) 8. Papadopoulou, O., Zampoglou, M., siaris, Y., Teyssou, D.: https://doi.org/10.5281/zenodo.1147958, 1147958 Invid fake Papadopoulos, Kompat- video 2018). https://doi.org/10.5281/zenodo. corpus S., v2.0 (Jan 9. Radulescu, C., Dinsoreanu, M., Potolea, R.: Identification of spam comments using natural language processing techniques. In: Intelligent Computer Communication and Processing (ICCP), 2014 IEEE International Conference on. pp. 29 -- 35. IEEE (2014) 10. Viswanath, B., Bashir, M.A., Crovella, M., Guha, S., Gummadi, K.P., Krishna- murthy, B., Mislove, A.: Towards detecting anomalous user behavior in online social networks. In: 23rd USENIX Security Symposium (USENIX Security 14). pp. 223 -- 238 (2014) 11. Wang, A.H.: Don't follow me: Spam detection in twitter. In: Security and Cryp- tography (SECRYPT), Proceedings of the 2010 International Conference on. pp. 1 -- 10. IEEE (2010) 12. Zhao, Z., Resnick, P., Mei, Q.: Enquiring minds: Early detection of rumors in social media from enquiry posts. In: Proceedings of the 24th Int. Conference on World Wide Web. Int. WWW Conferences Steering Committee (2015)
1910.12419
2
1910
2019-11-04T19:11:22
Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels
[ "cs.CL" ]
Preventable adverse events as a result of medical errors present a growing concern in the healthcare system. As drug-drug interactions (DDIs) may lead to preventable adverse events, being able to extract DDIs from drug labels into a machine-processable form is an important step toward effective dissemination of drug safety information. In this study, we tackle the problem of jointly extracting drugs and their interactions, including interaction outcome, from drug labels. Our deep learning approach entails composing various intermediate representations including sequence and graph based context, where the latter is derived using graph convolutions (GC) with a novel attention-based gating mechanism (holistically called GCA). These representations are then composed in meaningful ways to handle all subtasks jointly. To overcome scarcity in training data, we additionally propose transfer learning by pre-training on related DDI data. Our model is trained and evaluated on the 2018 TAC DDI corpus. Our GCA model in conjunction with transfer learning performs at 39.20% F1 and 26.09% F1 on entity recognition (ER) and relation extraction (RE) respectively on the first official test set and at 45.30% F1 and 27.87% F1 on ER and RE respectively on the second official test set corresponding to an improvement over our prior best results by up to 6 absolute F1 points. After controlling for available training data, our model exhibits state-of-the-art performance by improving over the next comparable best outcome by roughly three F1 points in ER and 1.5 F1 points in RE evaluation across two official test sets.
cs.CL
cs
Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels TUNG TRAN, University of Kentucky, United States RAMAKANTH KAVULURU, University of Kentucky, United States HALIL KILICOGLU, National Library of Medicine, United States Preventable adverse events as a result of medical errors present a growing concern in the healthcare system. As drug-drug interactions (DDIs) may lead to preventable adverse events, being able to extract DDIs from drug labels into a machine- processable form is an important step toward effective dissemination of drug safety information. Herein, we tackle the problem of jointly extracting drugs and their interactions, including interaction outcome, from drug labels. Our deep learning approach entails composing various intermediate representations, including graph-based context derived using graph convolutions (GC) with a novel attention-based gating mechanism (holistically called GCA), which are combined in meaningful ways to predict on all subtasks jointly. Our model is trained and evaluated on the 2018 TAC DDI corpus. Our GCA model in conjunction with transfer learning performs at 39.20% F1 and 26.09% F1 on entity recognition (ER) and relation extraction (RE) respectively on the first official test set and at 45.30% F1 and 27.87% F1 on ER and RE respectively on the second official test set corresponding to an improvement over our prior best results by up to 6 absolute F1 points. After controlling for available training data, the proposed model exhibits state-of-the-art performance for this task. CCS Concepts: • Information systems → Information extraction; • Computing methodologies → Multi-task learning; Neural networks. Additional Key Words and Phrases: Neural Networks, Multi-task Learning, Relation Extraction, Drug-Drug Interactions INTRODUCTION 1 Preventable adverse events (AE) are negative consequences of medical care resulting in injury or illness in a way that is generally considered avoidable. According to a report [14] by the Department of Human and Health Services, based on an analysis of hospital visits by over a million Medicare beneficiaries, about one in seven hospital visits were associated with an AE with 44% being considered clearly or likely preventable. Overall, AEs were responsible for an estimated US $324 million in Medicare spending for the studied month of October 2008. Preventable AEs thus introduce a growing concern in the modern healthcare system as they represent a significant fraction of hospital admissions and play a significant role in increased health care costs. Alarmingly, preventable AEs have been cited as the eighth leading cause of death in the U.S., with an estimated fatality rate of between 44,000 and 98,000 each year [13]. As drug-drug interactions (DDIs) may lead to to variety of preventable AEs, being able to extract DDIs from prescription drug labels is an important effort toward effective dissemination of drug safety information. This includes extracting information such as adverse drug reactions and drug-drug interactions as indicated by drug labels. The U.S. Food and Drug Administration (FDA), for example, has recently begun to transform Structured Product Labeling (SPL) documents into a computer-readable format, encoded in national standard terminologies, that will be made available to the the medical community and the public [6]. The initiative to develop a database of structured drug safety information that can be indexed, searched, and sorted is an important milestone toward a fully-automated health information exchange system. To aid in this effort, we propose a supervised deep learning model able to tackle the problem of drug-drug interaction extraction in an end-to-end fashion. While most prior efforts assume all drug entities are known Authors' addresses: Tung Tran, [email protected], University of Kentucky, Department of Computer Science, Lexington, Kentucky, United States; Ramakanth Kavuluru, [email protected], University of Kentucky, Department of Internal Medicine, Division of Biomedical Informatics, Lexington, Kentucky, United States; Halil Kilicoglu, [email protected], National Library of Medicine, Lister Hill National Center for Biomedical Communications, Bethesda, Maryland, United States. 2 • Tran et al. Fig. 1. An example illustrating the end-to-end DDI extraction task. We first (1) identify mentions including precipitants; for each precipitant, we (2) determine the type of interaction and, based on interaction type, (3) determine the interaction outcome. In the case of PD interactions, the outcome corresponds to one of the previously identified effect spans. ahead of time (more in Section 2), and the drug-drug interaction extraction task reduces to a simpler binary relation classification task of known drug pairs, we propose a system able to identify drug mentions in addition to their interactions. Concretely, the system takes as input the textual content of the label (indicating dosage and drug safety precautions) of a target drug and, as output, identifies mentions of other drugs that interact with the target drug. Thus only one of the two interacting drugs is known beforehand (i.e., the "label drug"), while the other (i.e., the "precipitating drug", or simply precipitant) is an unknown that our model is expected to extract. Along with identifying precipitants, we also determine the type of interaction associated with each precipitant; that is, whether the interaction is designated as being pharmacodynamic (PD) or pharmacokinetic (PK). In pharmacology, PD interactions are associated with a consequence on the organism while PK interactions are associated with changes in how one or both of the interacting drugs is absorbed, transported, distributed, metabolized, and excreted when used jointly. Beyond identifying the interaction type, it is also important to identify the outcome or consequence of an interaction. As defined, PK consequence can be captured using a small fixed vocabulary, while identifying PD effects is a much more contrived process. The latter involves additionally identifying spans of text correspond to a mention of a PD effect and linking each identified PD precipitants to one or more PD effects. We provide a more formal description of the task in Section 3.1. Figure 1 features a simple example of a PD interaction that is extracted from the drug label for Adenocard, where the precipitant is digitalis and the effect is "ventricular fibrillation." To address this end-to-end variant of DDI extraction, we propose a multi-task joint-learning architecture wherein various intermediate hidden representations, including sequence-based and graph-based contextual representations based on bidirectional Long Short-Term Memory (BiLSTM) networks and graph convolution (GC) networks respectively, are composed and are then combined in clever ways to produce predictions for each subtask. GCs over dependency parse trees are useful for capturing long-distance syntactic dependencies. We innovate on conventional GCs with a sigmoid gating mechanism derived via additive attention, referred to as Graph Convolution with Attention-Gating (GCA), which determines whether or not (and to what extent) information propagates between source and target nodes corresponding to edges in the dependency tree. The attention component controls information flow by producing a sigmoid gate (corresponding to a value in [0, 1]) for each edge based on an attention-like mechanism that measures relevance between node pairs. Intuitively, some dependency edges are more relevant than others; for example, negations or adjectives linked to important nouns via dependency edges may have a large influence on the overall meaning of a sentence while articles, such as "the", "a", and "an", have little or no influence comparatively. A standard GC would compose all source nodes PrecipitantTriggerE(cid:31)ectLabel DrugThe use of Adenocard in patients receiving digitalis may be rarely associated with ventricular (cid:30)brillation .AdenocarddigitalisMENTIONSINTERACTIONPharmacodynamicventricular (cid:30)brillationE(cid:31)ectINTERACTION EFFECTINTERACTION TYPELabel DrugPrecipitantPharmacokineticUnspeci(cid:30)edX123 Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 3 Table 1. Characteristics of various datasets Test Set 2 66 Number of Drug Labels 4256 Total number of sentences 64 Number of sentences per Drug Label (Average) 23 Number of words per sentence (Average) 23% Proportion of sentences with annotations 3.6 Number of mentions per annotated sentence (Average) 55% Proportion of mentions that are Precipitant 33% Proportion of mentions that are Trigger 12% Proportion of mentions that are Effect 28% Proportion of interactions that are Pharmacodynamic 47% Proportion of interactions that are Pharmacokinetic 25% Proportion of interactions that are Unspecified * Statistics for NLM180 and DDI2013 were computed on mapped examples (based on our own annotation mapping scheme) and not based on *DDI2013 715 6489 9 21 70% 2.3 100% - - 14% 9% 77% *NLM180 180 5757 32 23 27% 4.0 57% 20% 23% 47% 25% 28% TR22 22 603 27 24 51% 3.8 53% 28% 19% 49% 21% 30% Test Set 1 57 8195 144 22 23% 3.7 56% 30% 14% 33% 28% 39% the original data. with equal weighting, while the GCA would be more selective by possibly assigning a higher sigmoid value to negations/adjectives and a lower sigmoid value to articles. We train and evaluate our model on the Text Analysis Conference (TAC) 2018 dataset for drug-drug interaction extraction from drug labels [6]. The training data contains 22 drug labels, referred to as TR22, with gold standard annotations. As training data is scarce, we additionally propose a transfer learning step whereby the model is first trained on external data for extracting DDIs including the NLM-DDI CD corpus1 and SemEval-2013 Task 9 dataset [8]; we refer to these as NLM180 and DDI2013 respectively. Two official test sets of 57 and 66 drug labels, referred to as Test Set 1 and 2 respectively, with gold standard annotations are used strictly for evaluation. Table 1 contains more information about these datasets and their characteristics. In this study, we show that the GCA improves over the standard GC and that our GCA based model with transfer learning by pretraining on external data improves over our the best model [27] from a prior study2, that is based solely on BiLSTMs, by 4 absolute F1 points in overall performance. Furthermore, we show that our GCA based model complements our prior BiLSTM model; that is, by combining the two via ensembling, we improve over the prior best by 6 absolute F1 points in overall performance. Among comparable methods, our GCA based method exhibits state-of-the-art performance on all metrics after controlling for available training data. Our code3 is available for review and will be made publicly available on GitHub. 2 RELATED WORKS Prior studies on DDI extraction have focused primarily on binary relation extraction where drug entities are known during test time and the learning objective is reduced to a simpler relation classification (RC) task. In RC, pairs of known drug entities occurring in the same sentence are assigned a label, from a fixed set of labels, indicating relation type (including the none or null relation). Typically, no preliminary drug entity recognition or additional consequence prediction step is required. In this section, we cover prior relation extraction methods for DDI as well as participants of the initial TAC DDI challenge. 1https://lhce-brat.nlm.nih.gov/NLMDDICorpus.htm 2Tran et al. [27] was published as part of the non-refereed Text Analysis Conference (TAC); this study is an extension of our original report. 3http://tttran.net/code/gcn-ddi2019.zip 4 • Tran et al. 2.1 Relation Extraction for DDI State-of-the-art methods for DDI extraction typically involve some variant of convolutional neural networks (CNNs) or recurrent neural networks (RNNs), or a hybrid of the two. Many studies utilize the dependency parse structure of an input sentence to capture long-distance dependencies, which has previously been shown to improve performance in general relation extraction tasks [29] and those in the biomedical domain [17, 19]. Liu et al. [18] first proposed the use of standard CNNs for DDI extraction. Their approach involved convolving over an input sentence with drug entities bound to generic tokens in conjunction with so called position vectors. Position vectors are used to indicate the offset between a word and each drug of the pair and provide additional spatial features. Improvements were attained, in a follow-up study, by instead convolving over the shortest dependency path between the candidate drug pair [17]. Zhao et al. [30] introduced an enhanced version of the CNN based method by deploying word embeddings that were pretrained on syntactic parses, part-of-speech embeddings, and traditional handcrafted features. Suárez-Paniagua et al. [24] instead focused on fine-tuning various hyperparameter settings including word and position vector dimensions and convolution filter sizes for improved performance. Kavuluru et al. [10] introduced the first neural architecture for DDI extraction based on hierarchical RNNs, wherein hidden intermediate representations are composed in a sequential fashion with cyclic connections, with character and word-level input. Sahu and Anand [22] experimented with various ways of composing the output of a bidirectional LSTM network including max-pooling and attention pooling. Lim et al. [16] proposed a recursive neural network architecture using recurrent units called TreeLSTMs to produce meaningful intermediate representations that are composed based on the structure of the dependency parse tree of a sentence. Asada et al. [2] demonstrated that combining representations of a CNN over the input text and graph convolutions over the molecular structure of the target drug pair (as informed by an external drug database) can result in improved DDI extraction performance. More recently, Sun et al. [25] proposed a hybrid RNN/CNN method by convolving over the contextual representations produced by a preceding recurrent neural network. 2.2 TAC 2018 DDI Track TAC is a series of workshops organized by NIST aimed at encouraging research in natural language processing (NLP) by providing large test collections along with a standard evaluation procedure. The "DDI Extraction from Drug Labels" track [6] is established with the goal of transforming the contents of drug labels into a machine- processable format with linkage to standard terminologies. Tang et al. [26] placed first in the challenge using an encoder/decoder architecture to jointly identify precipitants and their interaction types and a rule-based system to determine interaction outcome. In addition to the provided training data, they downloaded and manually annotated a collection of 1148 sentences to be used as external training data. Tran et al. [27] placed second in the challenge using a BiLSTM for joint entity recognition and interaction type prediction, followed by a CNN with two separate dense output layers (one of PK and one for PD) for outcome prediction. Dandala et al. [5] placed third in the challenge using a BiLSTM (with CRFs) with part-of-speech and dependency features as input for entity recognition. Next, an Attention-LSTM model was used to detect relations between recognized entities. The embeddings were pretrained on a corpus of FDA-released drug labels and used to initialized the model. NLM180 was used for training with TR22 serving as the development set. Other participants proposed systems involving similar approaches including BiLSTMs and CNNs as well as traditional linear and rule-based methods. 3 MATERIALS AND METHODS We begin by formally describing the end-to-end task in Section 3.1. Next, we describe our approach to framing and modeling the problem (Section 3.2), the proposed network architecture (Section 3.4), the data used for transfer Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 5 Table 2. Example of the sequence labeling scheme for the sentence in Figure 1, where LABELDRUG is substitute for Adenocard. O The O may O use O be O of O rarely O LABELDRUG O in O patients B-TRI associated L-TRI with B-EFF ventricular O receiving L-EFF fibrillation U-DYN digitalis O . learning (Section 3.5), and our model-ensembling approach (Section 3.6). Finally, in Section 3.7, we describe the method for model evaluation. 3.1 Task Description Herein, we describe the end-to-end task of automatically detecting drugs and their interactions, including the outcome of identified interactions, as conveyed in drug labels. We first define drug label as a collection of sections (e.g., DOSAGE & ADMINISTRATION, CONTRAINDICATIONS, and WARNINGS) where each section contains one or more sentences. The overall task, in essence, involve fundamental language processing techniques including named entity recognition (NER) and relation extraction (RE). The first subtask of NER is focused on identifying mentions in the text corresponding to precipitants, interaction triggers, and interaction effects. Precipitating drugs (or simply precipitants) are defined as substances, drugs, or a drug class involved in an interaction. The second subtask of RE is focused on identifying sentence-level interactions; specifically, the goal is to identify the interacting precipitant, the type of the interaction, and outcome of the interaction. The interaction outcome depends on the interaction type as follows. Pharmacodynamic (PD) interactions are associated with a specified effect corresponding to a span within the text that describes the outcome of the interaction. Figure 1 features a simple example of a PD interaction that is extracted from the drug label for Adenocard, where the precipitant is digitalis and the effect is "ventricular fibrillation." Naturally, it is possible for a precipitant to be involved in multiple PD interactions. Pharmacokinetic (PK) interactions, on the other hand, are associated with a label from a fixed vocabulary of National Cancer Institute (NCI) Thesaurus codes indicating various levels of increase/decrease in functional measurements. For example, consider the sentence: "There is evidence that treatment with phenytoin leads to decrease intestinal absorption of furosemide, and consequently to lower peak serum furosemide concentrations." Here, phenytoin is involved in a PK interaction with the label drug, furosemide, and the type of PK interaction is indicated by the NCI Thesaurus code C54615 which describes a decrease in the maximum serum concentration (Cmax) of the label drug. Lastly, unspecified (UN) interactions are interactions with an outcome that is not explicitly stated in the text and is typically indicated through cautionary remarks. Joint Modeling Approach 3.2 Since only precipitants are annotated in the ground truth, we model the task of precipitant recognition and interaction type prediction jointly. We accomplish this by reducing the problem to a sequence tagging problem via a novel NER tagging scheme. That is, for each precipitant drug, we additionally encode the associated interaction type. Hence, there are three possible precipitant tags: DYN, KIN, and UN for precipitants with pharmacodynamic, pharmacokinetic, and unspecified interactions respectively. Two more tags, TRI and EFF, are added to further identify mentions of triggers and effects concurrently. To properly identify boundaries, we employ the BILOU encoding scheme [21]. In the BILOU scheme, B, I, and L tags are used to indicate the beginning, inside, and last token of a multi-token entity respectively. The U tag is used for unit-length entities while the O tag indicates that the token is outside of an entity span. As a preprocessing step, we identify the label drug in the sentence, if it is mentioned, and bind it to a generic entity token (e.g., "LABELDRUG"). We also account for indirect mentions 6 • Tran et al. of the label drug, such as the generic version of a brand-name drug, or cases where the label drug is referred to by its drug class. To that end, we built a lexicon of drug names mapped to alias using NLM's Medical Subject Heading (MeSH) tree as a reference. Table 2 shows how the tagging scheme is applied to a simple example. Once we have identified the precipitant (as well as triggers/effects) and the interaction type for each precipitant, we subsequently predict the outcome or consequence of the interaction (if any). To that end, we consider all entity spans annotated with KIN tags and assign them a label from a static vocabulary of 20 NCI concept codes corresponding to PK consequence (i.e., multi-class classification). Likewise, we consider all entity spans annotated with DYN tags and link them to mention spans annotated with EFF tags; we accomplish this via binary classification of all pairwise combinations. For entity spans annotated with UN tags, no additional outcome prediction is needed. 3.3 Notations and Neural Building Blocks In this section, we describe notations used in the remainder of this study. In addition, we provide a generic definition of the canonical CNN and BiLSTM networks that are later used as building blocks in model construction. For ease of notation, we assume fixed sentence length n and word length n; in practice, we set n and n to be the maximum sentence/word length and zero-pad shorter sentences/words. Moreover, we use square brackets with matrices to indicate a row indexing operation; for example, X[i] denotes the vector corresponding to the ith row of matrix X. CNN (·) : Rn×din (cid:55)→ Rdout is used to represent the CNN that convolves on a window of size w in a sentence with n words, mapping an n × din matrix to a vector representation of length dout, where din is the word embedding size. This is an abstraction of the canonical CNN for NLP first proposed by Kim [12] and is defined as follows. First, we denote the convolution operation ⋆ as the sum of the element-wise k Aj,k · Bj,k. Suppose the input is a sequence of vector representations x1, . . . , xn ∈ Rdin; the output representation g ∈ Rdout is defined such that products of two matrices. That is, for two matrices A and B of same dimensions, A ⋆ B = Henceforth, the abstract function f w,dout  j gk = max( fconvolve(k, x1, . . . , xw) , . . . , fconvolve(k, xn−w +1, . . . , xn)) for k = 1, . . . , dout, given a convolution function fconvolve that convolves over a contiguous window of size w ≤ n, defined as fconvolve(k, v1, . . . , vw) = ReLU(cid:169)(cid:173)(cid:173)(cid:171)W k ⋆(cid:169)(cid:173)(cid:173)(cid:171) v1 ... vw (cid:170)(cid:174)(cid:174)(cid:172) + bk(cid:170)(cid:174)(cid:174)(cid:172) where v1, . . . , vw ∈ Rdin are input vectors, W k ∈ Rw×din and bk ∈ R for k = 1, . . . , dout, are network parameters (corresponding to a set of dout convolutional filters), ReLU(x) = max(0, x) is the linear rectifier activation function. Here, dout is a hyperparameter that determines the number of convolutional filters and thus the size of the final CNN (·) : Rn×din (cid:55)→ Rdout that feature vector. In the study, we denote the convolution as an abstract function f w,dout convolves on a window of size w and maps an n × din matrix to a vector representation of length dout. BLSTM(·) : Rn×din (cid:55)→ Rn×dout that maps a Likewise, we represent the BiLSTM network as an abstract function f dout sequence of n input vectors (e.g., word embeddings) of din size (as an n×din matrix) to a corresponding sequence of ←−−−− n output context vectors of dout size (as an n×dout matrix). Let LSTM represent an LSTM composition in the forward and backward direction. Suppose the input is a sequence of vector representations x1, . . . , xn ∈ Rdin; −−−−→ LSTM and Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 7 Fig. 2. Overview of the neural network architecture for a simplified example from the drug label Adenocard. Here, the ground truth indicates that digitalis is a pharmacodynamic precipitant associated with the effect "ventricular fibrillation." The PK predictive component is omitted given there are no precipitants involved in a PK interaction. the output of a standard bidirectional LSTM network (BiLSTM) is a matrix H ∈ Rn×dout =(cid:0)h1, . . . , hn(cid:1)⊤ such that −→ h i = ←− h i = hi = −−−−→ LSTM(xi), ←−−−− LSTM(xi), −→ h i ∥ ←− h i , for i = 1, . . . , n, where ∥ is the vector concatenation operator and hi ∈ Rdout represents the context centered at the ith word. Here, dout is a hyperparameter that determines the size of the the context embeddings. In the study, we denote BLSTM(·) : Rn×din (cid:55)→ Rn×dout that maps a sequence of n input vectors the BiLSTM network as an abstract function f dout (e.g., word embeddings) of din size (as an n × din matrix) to a corresponding sequence of n output context vectors of dout size (as an n × dout matrix). 3.4 Neural Network Architecture and Training Details We begin by describing how the three types of intermediate representations are composed. The construction of word, context, and graph-based representations are described in Sections 3.4.1, 3.4.2, and 3.4.3 respectively. Next, we describe the predictive components of the network that share and utilize the intermediate representations. In Section 3.4.4, we describe the sequence-labeling component of the network used to extract drugs and their interactions. In Section 3.4.5, we describe the component for predicting interaction outcome. An overview of the architecture is shown in Figure 2. Lastly, we describe the model configuration and training process in Section 3.4.6. useofLABELDRUGwithdigitalismaybeassociatedwithventricular(cid:31)brillationCNNBI(cid:30)LSTMGRAPHCONVOLUTIONCHARACTER(cid:30)BASED REPRESENTATIONWORD(cid:30)BASED REPRESENTATIONCONTEXT REPRESENTATIONGRAPH CONV. REPRESENTATIONSEQUENCE LABELINGBI(cid:30)LSTMCNNU(cid:30)DYNOB(cid:30)EFFL(cid:30)EFFOOOOOOOYESPHARMACODYNAMICOUTCOME 8 • Tran et al. 3.4.1 Word-level Representation. Suppose the input is a sentence of length n represented by a sequence of word indices w1, . . . , wn into the vocabulary VWord. Each word is mapped to a word embedding vector via embedding matrices EWord ∈ RVWord×δ such that δ is a hyperparameter that determines the size of word embeddings. In addition to word embeddings, we employ character-CNN based representations as commonly observed in recent neural NER models [4]. Character-based models capture morphological features and help generalize to out-of-vocabulary words. For the proposed model, such representations are composed by convolving over character embeddings of size π using a window of size 3, producing η feature maps; the feature maps are then max-pooled to produce η-length feature representations. Correspondingly, we denote EChar ∈ RVChar×π as the embedding matrix given the character vocabulary VChar; the character-level embedding matrix Ci ∈ R n×π for the word at position i is where ci, j for 1 ≤ i ≤ n, 1 ≤ j ≤ n, represents the jth character index of the ith word. The word-level representation Rword ∈ Rn×(δ +η) is a concatenation of character-based word embeddings and pretrained word embeddings along the feature dimension; formally, (cid:170)(cid:174)(cid:174)(cid:172) ... EChar[ci, n] Ci =(cid:169)(cid:173)(cid:173)(cid:171) EChar[ci,1] RWord =(cid:169)(cid:173)(cid:173)(cid:171) EWord[w1] ∥ f EWord[wn] ∥ f ... (cid:170)(cid:174)(cid:174)(cid:174)(cid:172) . 3,η CNN(C1) 3,η CNN(Cn) ρ 3.4.2 Context-based Representation. We compose context-based representation by simply processing the word- BLSTM(RWord) where ρ is level representation with a BiLSTM layer as is common practice; concretely, RContext = f a hyperparameter that determines the size of the context embeddings. 3.4.3 Graph-based Representation. In addition to the sequential nature of LSTMs, we propose an alternative and complementary graph-based approach for representing context using graph convolution (GC) networks. Typically composed on dependency parse trees, graph-based representations are useful for relation extraction as they capture long-distance relationships among words of a sentence as informed by the sentence's syntactic dependency structure. While graph convolutions are typically applied repeatedly, our initial cross-validation results indicate that single-layered GCs are sufficient and deep GCs typically resulted in performance degradation; moreover, Zhang et al. [29] report good performance with similarly shallow GC layers. Hence the following formulation describes a single-layered GC network, with an additional attention-based sigmoid gating mechanism, which we holistically refer to as a Graph Convolution with Attention-Gating (GCA) network. Initially motivated in Section 1, the GCA improves on conventional GCs with a sigmoid-gating mechanism derived via an alignment score function associated with additive attention [3]. The sigmoid "gate" determines whether or not (and to what extent) information is propagated based on a learned alignment function that conceives a "relevance" score between a source and target node (more later). As a pre-processing step, we use a dependency parsing tool to generate the projective dependency tree for the input sentence. We represent the dependency tree as an n × n adjacency matrix A where Ai, j = Aj,i = 1 if there is a dependency relation between words at positions i and j. This matrix controls the flow of information between pairs of words corresponding to connected nodes in the dependency tree (ignoring dependency type); however, it is also important for the existing information of each node to carry over on each application of the GC. Hence, as with prior work [29], we use the modified version A = A + I where I is the identity matrix to allow Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 9 for self-loops in the GC network. The graph-based representation RGraph ∈ Rn×β is composed such that (cid:32) n j=1 RGraph[i] = tanh Ai, jW GraphRContext[j] + bGraph (cid:33) where W Graph ∈ Rβ×ρ , bGraph ∈ Rβ are network parameters, tanh(·) is the hyperbolic tangent activation function, and β is a hyperparameter that determines the hidden GC layer size. Thus, information propagated from source nodes j = 1, . . . , n to target node i, based on the summation of intermediate representations, are unweighted and share equal importance. mechanism to control the flow of information via the gating matrix G ∈ Rn×n. We define G such that As stated previously, we propose to extend the standard GC by adding an attention-based sigmoid gating Gi, j = σ(v · ai, j) for i = 1, . . . , n, j = 1, . . . , n, where v ∈ Rα is a network parameter and ai, j ∈ Rα is the hidden attention layer composed as a function of the context representation at source node i and target node j; concretely, (cid:16) W SourceRContext[i] + W TargetRContext[j] + bAttn(cid:17) , ai, j = tanh where W Source,W Target ∈ Rα×ρ and bAttn ∈ Rα are network parameters and α is a hyperparameter that determines hidden attention layer size. Intuitively, the network learns the relevance of node i to node j via the attention ai, j and outputs a between 0 and 1 at gate Gi, j. Gate Gi, j controls the flow of information from node i to j, where 0 indicates no information is passed and 1 indicates that all information is passed. To integrate the gating mechanism, we simply redefine A = (A + I) × G. In the next two sections, we show how the intermediate representations are used for end-task prediction. Sequence Labeling. The sequence labeling (SL) task for detecting precipitant drugs and their interaction 3.4.4 type is handled by a bidirectional LSTM trained on a combination of the two types of losses: conditional random fields (CRF) and softmax cross entropy (SCE). Using CRFs results in choosing a globally optimal assignment of tags to the sequence, whereas a standard softmax at the output of each step may result in less globally consistent assignments (e.g., an L tag following an O tag) but better local or partial assignments. We begin by introducing a bidirectional LSTM layer that processes the various intermediate representations. The new representation, RSL ∈ Rn×γ , is defined such that RSL = f γ BLSTM (cid:169)(cid:173)(cid:173)(cid:171) RWord[1] ∥ RContext[1] ∥ RGraph[1] RWord[n] ∥ RContext[n] ∥ RGraph[n] ... (cid:170)(cid:174)(cid:174)(cid:172) where γ is a hyperparameter that determines the hidden layer size. While RGraph is based on RContext and RContext is based on RWord, we observed that combining these intermediate representations (manifesting at varying depth in the architecture) resulted in improved sequence-labeling performance according to preliminary experiments and prior results from Tran et al. [27]. As with residual networks [7], they additionally provide a kind of shortcut or "skip-connection" over intermediate layers. Given a set of ntag possible tags, we compose an n × ntag score matrix Y (where Yi,t represents the score of the tth tag at position i) such that Y[i] = W OutRSL[i] + bOut where W Out ∈ Rntag×γ , bOut ∈ Rntag are network parameters. Given example x and the truth tag assignment as a matrix ¯Y where rows are one-hot vectors over all 10 • Tran et al. possible tags, the SCE loss is ℓSCE(x, A, ¯Y; θ) = − n ntags i =1 t =1 (cid:32) ¯Yi,t log (cid:33) ntags exp(Yi,t) k =1 exp(Yi,k) where ¯Yi,t ∈ {0, 1} indicates whether the tag t is assigned at position i and θ is the set of all network parameters. Next, we define the CRF loss as commonly used with LSTM based models for entity recognition. We learn a transition score matrix M ∈ Rntag×ntag, inferred from the training data, such that Mi, j is the transition score from tag i to tag j. Given an example x as a sequence of word indices w1, . . . , wn and candidate tag sequence ¯y as a sequence of tag indices s1, . . . , sn, the tag assignment score (t-score) is defined as t-score(x, A, ¯y; θ) = t-score(w1, . . . , wn, A, s1, . . . , sn; θ) = + Msi−1,si (cid:0)Yi,si n i =1 (cid:1) where θ = θ ∪ {M}. Intuitively, this score summarizes the likelihood of observing a transition from tag si−1 to tag si in addition to the likelihood of emitting tag si given the semantic context for i = 1, . . . , n. Thus Y is treated as a matrix of emission scores for the CRF. For an example with input x and truth tag assignment ¯y, the loss is computed as the negative log-likelihood of the tag assignment as informed by the normalized tag assignment score, or ℓCRF(x, A, ¯y; θ) = − log  exp(t-score(x, A, ¯y; θ)) y∈S exp(t-score(x, A, y; θ)) where S is the set of all possible tag assignments. The final per-example loss for sequence labeling is simply a summation of the two losses: ℓSL = ℓSCE + ℓCRF. During testing, we use the Viterbi algorithm [28], a dynamic programming approach, to decode and identify the globally optimal tag assignment. 3.4.5 Consequence prediction. Once precipitants (and corresponding interaction types) have been identified, we perform so called consequence prediction (CP) for all precipitant drugs identified as participating in PD or PK interactions. The classification task of CP takes as input the target sentence and two candidate entities that are referred to as the subject and object entities. Here the subject is always a precipitating drug; on the other hand, the object designation depends on the type of interaction (more later). First, we define the representation matrix for CP as RCP ∈ Rn×(ρ+β) where RCP =(cid:169)(cid:173)(cid:173)(cid:171) RContext[1] ∥ RGraph[1] RContext[n] ∥ RGraph[n] ... (cid:170)(cid:174)(cid:174)(cid:172) . We process the matrix via convolutions of windows sizes 3, 4, and 5 and concatenate the results to produce the final feature vector gCP. In addition to CNN features, we map entities to their graph based context features and append it to gCP, which has been previously shown to work well in a similar architecture [15]. Concretely, the final feature vector is gCP = f 3, µ CNN(RCP) ∥ f 4, µ CNN(RCP) ∥ f 5, µ CNN(RCP) ∥ RCP[tSub] ∥ RCP[tObj] with gCP ∈ R3µ +2(ρ+β) where µ, as a hyperparameter, is the number of CNN filters per convolution and tSub and tObj are the position index of the last word (typically the "head" word) of the subject and object respectively. The actual entities determined to be the subject/object pair are based on the interaction type; for PD interactions, the subject is the precipitant drug and the object is some candidate effect mention. For PK interactions, however, the subject is the precipitant drug but the object is chosen to be the closest (based on character-offset) mention of the drug label with respect to the target precipitant drug. We found this appropriate based on manual review of the data, as the NCI code being assigned depends highly on whether the increase/decrease in functional Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 11 Table 3. Model configuration obtained through random search over 11-fold cross-validation of TR22 (training data). Setting Learning Rate Dropout Rate Character Embedding Size (π) Character Representation Size (η) Word Embedding Size (δ) Value 0.001 0.5 25 50 200 Setting Context Embedding Size (ρ) GC Hidden Size (β) GC Attention Size (α) Sequence LSTM Hidden Size (γ) Outcome CNN Filter Count (µ) Value 100 100 25 200 50 measurements is with respect to the label drug or the precipitant drug. In case the label drug is not mentioned, a generic "null" vector is used to represent the object. When performing sequence labeling, we pass in the entire dependency tree encoded as the matrix A. However, when performing consequence prediction and both entities are non-null, we pass in a pruned version of the entire tree that is tailored to the entity pair. We apply the same pruning strategy proposed by Zhang et al. [29], wherein for a pair of subject and object entities (corresponding to tSub and tObj), we keep only nodes either along or within one hop of the shortest dependency path. This prevents distant and irrelevant portions of the dependency tree from influencing the model while retaining important modifying and negating terms. Thus the notation ASub↔Obj is used to denote the pruned version of A as a function of the entity pair indicated by tSub and tObj. To determine whether there is a PD interaction between a pair of entities, we employ a standard binary classification output layer. Concretely, for example sentence x and output y ∈ {0, 1}, the probability of a PD interaction between the entity pair is q = sigmoid(wPD · gCP + bPD) where wPD ∈ R3µ +2(ρ+β) and bPD ∈ R are network parameters. The associated binary cross entropy loss is ℓPD(x, ASub↔Obj, y; θ) = y log q + (1 − y) log(1 − q) where y ∈ {0, 1} indicates the ground truth. For PK interactions, we instead use a softmax function to produce a probability distribution, represented as vector q ∈ R20, over the 20 labels corresponding to NCI Thesaurus codes. Concretely, the predicted probability of label j is qj = exp(yPK k ) where yPK = W PKgCP + bPK and W PK ∈ R20×[3µ +2(ρ+β)] and bPK ∈ R20 are network parameters. Given a one-hot vector ¯y ∈ R20 indicating the ground truth, the associated softmax cross entropy loss is k =1 yPK j )/exp(20 20 ¯yj log qj j=1 ℓPK(x, ASub↔Obj, ¯y; θ) = . The loss for a batch of examples is simply the sum of its constituent example-based losses. 3.4.6 Neural Network Configuration and Training Details. For each training iteration, we randomly sample 10 sentences from the training data. These are re-composed into three sets of task-specific examples S, D, and K corresponding to the tasks of sequence labeling, PD prediction, and PK prediction respectively. Unlike our prior work, in which the sub-tasks were trained in an interleaved fashion, we train on all three objectives jointly. Here, we dynamically switch between one of four training objective losses based on whether there are available training examples (in the batch and for the current iteration) for each task. The final training loss is then 12 • Tran et al. ℓ = x ∈D ℓPD(x) +  x ∈K ℓPK(x) x ∈S ℓSL(x) +    x ∈S ℓSL(x) +   x ∈S ℓSL(x) +   x ∈S ℓSL(x)  x ∈K ℓPK(x) x ∈D ℓPD(x) if D > 0 and K > 0, if D = 0 and K > 0, if D > 0 and K = 0, otherwise. We train the network for a maximum of 10,000 iterations, check-pointing and evaluating every 100 iterations on a validation set of sentences from four held-out drug labels. Only the checkpoint that performed best on the validation set is kept for test time evaluation. The choice of hyperparameters is shown in Table 3; discrete numbered parameters corresponding to embedding or hidden size were chosen from {10, 25, 50, 100, 200, 400} based on random search and optimized by assessing 11-fold cross-validation performance on TR22. The learning and dropout rates are set to typical default values. We used Word2Vec embeddings pretrained on the corpus of PubMed abstracts [20]. All other variables are initialized using values drawn from a normal distribution with a mean of 0 and standard deviation of 0.1 and further tuned during training. Words were tokenized on both spaces and punctuation marks; punctuation tokens were kept as is common practice for NER type systems. For dependency parsing, we use SyntaxNet4 which implements the transition-based neural model by Andor et al. [1]. We trained the aforementioned parser, using default settings, on the GENIA corpus [11] and use it to obtain projective dependency parses for each example. 3.5 Transfer Learning with Network Pre-Training An obstacle in solving this flavor of DDI extraction as a machine learning problem is the high potential for overfitting given the sparse nature of the output space, which is further intensified by the scarce availability of high quality training data. As quality training data is expensive and requires domain expertise, we propose to use a transfer learning approach where the model is pre-trained on external data as follows. First, we pre-train on the DDI2013 dataset, which contains strictly binary relation DDI annotations and no interaction consequence annotation. Hence, DDI2013 is only used to train the sequence labeling objective ℓSL(x). Next, we pre-train on NLM180, a collection of 180 drug labels annotated in a comparable format to TR22 but follows a different set of guidelines and lacks comprehensive interaction consequence annotation. Finally, we fine-tune for the target task by training on the official TR22 dataset. Translating NLM180 and DD2013 to the TAC 2018 format is an imperfect process given structural (breadth and depth of annotations) and semantic (guidelines in addition to annotator experience and vision) differences. For example, differences in how entity boundaries are annotated, such as whether or not modifier terms should be kept as part of a named entity, may have a large impact on model performance. Hence, we expect the translated versions of NLM180 and DDI2013 to be very noisy as training examples for the target task. We describe the translation process for DDI2013 in Sections 3.5.1 and 3.5.2. We provide summary statistics about these datasets in Table 1. 3.5.1 NLM180 Mapping Scheme. In NLM180, there is no distinction between triggers and effects; moreover, PK effects are limited to coarse-grained (binary) labels corresponding to increase or decrease in function measurements. Hence, a direct mapping from NLM180 to the TR22 annotation scheme is impossible. As a compromise, NLM180 "triggers" were mapped to TR22 triggers in the case of unspecified and PK interactions. For PD interactions, we instead mapped NLM180 "triggers" to TR22 effects, which we believe to be appropriate based on our manual 4https://github.com/tensorflow/models/tree/master/research/syntaxnet Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 13 analysis of the data. Since we do not have both trigger and effect for every PD interaction, we opted to ignore trigger mentions altogether in the case of PD interactions to avoid introducing mixed signals. While trigger recognition has no bearing on relation extraction performance, this policy has the effect of reducing the recall upperbound on NER by about 25% based on early cross-validation results. To overcome the lack of fine-grained annotations for PK outcome in NLM180, we deploy the well-known bootstrapping approach [9] to incrementally annotate NLM180 PK outcomes using TR22 annotations as a starting point. To mitigate the problem of semantic drift, we re-annotated by hand iterative predictions that were not consistent with the original NLM180 coarse annotations (i.e., active learning [23]). 3.5.2 DDI2013 Mapping Scheme. The DDI2013 dataset contains annotations that are incomplete with respect to the target task; specifically, annotations are limited to typed binary relations between any two drug mentioned drugs in the sentence (and not necessary between a mentioned drug and the label drug) without outcome or consequence prediction. In DDI2013, there are four types of interactions: mechanism, effect, advice and int. The mechanism type indicates that a PK mechanism is being discussed; effect indicates that the consequence of a PD interaction is being discussed; advice indicates suggestions regarding the handling of the drugs; and int is an interaction without any specific additional information. We translate the annotation by first applying a filtering step on all interactions such that it conforms to the target task; namely, we filter such that only interactions involving the label drug is kept. The non-label drug entity is then annotated as a precipitant with an interaction tag based on the following mapping scheme. Entities involved in a mechanism relation with the drug label are treated as KIN precipitants; likewise, entities in effect and advice relations are treated as DYN precipitants and int relations are treated as UNK precipitants. As there is no consequence annotation, the mapped examples are used to train the sequence labeling objective but not the other objective. 3.6 Voting-based Ensembling Our prior effort [27] showed that model ensembling resulted in optimal performance for this task. Hence, model ensembling remains a key component of the proposed model. Our ensembling method is based on ensembling over ten models each trained with randomly initialized weights and a random development split. Intuitively, models collectively "vote" on predicted annotations that are kept and annotations that are discarded. A unique annotation (entity or relation) has one vote for each time it appears in one of the ten model prediction sets. In terms of implementation, unique annotations are incrementally added (to the final prediction set) in order of descending vote count; subsequent annotations that conflict (i.e., overlap based on character offsets) with existing annotations are discarded. Hence, we loosely refer to this approach as "voting-based" ensembling. 3.7 Model Evaluation We used the official evaluation metrics for NER and relation extraction based on the standard precision, recall, and F1 micro-averaged over exactly matched entity/relation annotations. We use the strictest matching criteria corresponding to the official "primary" metric (of the TAC DDI task), as opposed to the "relaxed" metric that ignores mention and interaction type. Concretely, the matching criteria for entity recognition considers entity bounds as well as the type of the entity. The matching criteria for relation extraction comprehensively considers precipitant drugs and, for each, the corresponding interaction type and interaction outcome. As relation extraction evaluation takes into account the bounds of constituent entity predictions, relation extraction performance is heavily reliant on entity recognition performance. On the other hand, we note that while NER evaluation considers trigger mentions, triggers are ignored when evaluating relation extraction performance. Two test sets of 57 and 66 drug labels, referred to as Test Set 1 and 2 respectively, with gold standard annotations are used for evaluation. Next, we discuss the differences between these test sets. As shown in Table 1, Test Set 1 closely resembles TR22 with respect to the sections that are annotated. However, Test Set 1 is more sparse in the sense that there are more 14 • Tran et al. Table 4. Main results based on 95% confidence interval around mean precision, recall, and F1 based on evaluating N=100 ensembles for each model. Method Training Data P (%) R (%) F (%) P (%) R (%) F (%) P (%) R (%) F (%) P (%) R (%) F (%) P (%) Test 1 / Entity Test 1 / Relation Test 2 / Entity Test 2 / Relation Overall R (%) F (%) BL GCA BL(1) GCA BL TR22 TR22 TR22 + NLM180 TR22 + NLM180 TR22 + NLM180 + DDI2013 23.82 32.87 27.05 38.30 29.27 TR22 + NLM180 + DDI2013 41.58 GCA GC(2) TR22 + NLM180 + DDI2013 GCA + BL(3) TR22 + NLM180 + DDI2013 38.85 35.22 42.04 32.35 39.87 31.20 41.93 38.24 36.30 30.39 32.59 32.22 34.38 14.74 22.70 19.94 27.97 18.38 13.95 22.20 15.14 34.47 22.93 25.42 39.83 31.84 37.52 29.82 20.49 18.59 16.35 17.27 21.00 19.63 24.11 24.93 22.88 26.15 38.82 32.49 44.13 38.73 47.54 43.74 39.69 31.31 41.92 31.18 43.79 36.12 34.88 31.51 34.65 36.60 36.53 41.10 41.04 38.80 12.48 19.26 21.82 31.79 15.43 11.63 23.93 15.76 27.11 27.32 32.07 31.14 17.81 16.40 13.79 14.49 22.82 21.06 27.21 22.90 21.48 19.30 ± 0.12 28.41 ± 0.09 25.32 ± 0.09 35.55 ± 0.18 29.51 ± 0.10 38.26 ± 0.16 35.89 ± 0.20 35.00 ± 0.15 23.01 ± 0.06 28.88 ± 0.12 24.75 ± 0.11 22.31 ± 0.16 28.16 ± 0.06 31.98 ± 0.11 27.90 ± 0.17 23.32 ± 0.20 31.72 ± 0.06 34.61 ± 0.10 32.18 ± 0.12 28.17 ± 0.12 26.54 ± 0.20 30.17 ± 0.19 34.75 ± 0.13 34.61 ± 0.10 44.23 39.20 27.58 24.77 26.09 45.50 45.10 45.30 31.69 24.89 27.87 (1) Our original challenge submission using a BiLSTM-based approach and trained on only TR22 and NLM180. (2) For reference, we include an evaluation of the standard GC without attention-gating. (3) Our current best is a combination of GCA and BL by ensembling. Table 5. Comparison of our method with comparable (based on training data) methods of teams in the top 5. Test 1 / Entity Test 1 / Relation Test 2 / Entity Test 2 / Relation Method Dandala et al. [5] Tran et al. [27] BL + GCA (Ours) Training Data TR22 + NLM180 TR22 + NLM180 TR22 + NLM180 P (%) 41.94 29.50 32.89 R (%) 23.19 37.45 41.06 F (%) 29.87 33.00 36.51 P (%) 25.24 22.08 24.66 R (%) 16.10 21.13 21.35 F (%) 19.66 21.59 22.87 P (%) 44.61 36.68 40.57 R (%) 29.31 40.02 42.44 F (%) 35.38 38.28 41.47 P (%) 22.99 22.53 28.15 R (%) 16.83 21.13 22.42 F (%) 19.43 23.55 24.95 sentences per drug label (144 vs. 27), with a smaller proportion of those sentences having gold annotations (23% vs. 51%). Test Set 2 is unique in that it contains annotations from only two sections, namely DRUG INTERACTIONS and CLINICAL PHARMACOLOGY, the latter of which is not represented in TR22 (nor Test Set 1). Lastly, TR22, Test Set 1, and Test Set 2 all vary with respect to the distribution of interaction types, with TR22, Test Set 1, and Test Set 2 containing a higher proportion of PD, UN, and PK interactions respectively. Overall model performance is assessed using a single metric defined as the average of entity recognition and relation extraction performance across both test sets. 4 RESULTS AND DISCUSSION In order to assess model performance with confidence intervals and draw conclusions based on statistical significance, we perform a technique called bootstrap ensembling proposed by Kavuluru et al. [10]. That is, for each neural network (NN), we train a pool of 30 models each with a different set of randomly initialized weights and training-development set split. Performance of the NN is evaluated based on computing the 95% confidence interval around the mean F1 of N = 100 ensembles, where each ensemble is assembled from a set of ten models randomly sampled from the pool. This approach allows us to better assess average performance which is a nontrivial task given the high variance nature of models learned with limited training data. Our method for model ensembling (by "voting") is described in Section 3.6. Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 15 We present the main results of this study in Table 4 where we compare our prior efforts using strictly BiLSTMs (BL) and our current best results with graph convolutions (GCA). BL with TR22 and NLM180 as training data corresponds to our prior best at 28.16% overall F1, while GCA with TR22, NLM180, and DDI2013 as training data represents our current best at 32.18% overall F1 based on graph convolutions. Here, we observe a 4 point gain in overall F1 (statistically significant at 95% confidence level based on non-overlapping confidence intervals), with most gains owing to a substantial improvement in entity recognition performance. We note that GCA is more precision focused while BL is more recall focused; moreover, GCA tends to exhibit better performance on Test Set 1, while BL tends to exhibit better performance on Test Set 2. This hints that the two architectures are highly complementary and may work well in combination. Indeed, when combined via ensembling, we observe a major performance gain across almost all measures. Here, for each ensemble, we sample five models from each pool of models (GCA and BL) for a total of ten models to ensure that results remain comparable. The resulting hybrid model exhibits the best performance overall, improving over the prior best by two points and over the current best by six points in overall F1 at 34.61%. These differences are statistically significant at the 95% confidence level. Next, we highlight that a main benefit of the GCA model is that it operates well with very small amounts of training data, as evident by the almost 2 absolute point improvement over the BiLSTM model when trained solely on TR22. These gains tend to be less notable when we involve examples from NLM180 and DDI2013. Lastly, we note that GCA (graph convolution with attention-gating) performs better than the standard GC (graph convolution without attention-gating) by two absolute points in overall F1 with improvements that are consistent across all metrics. We present a comparison of our results with other works in Table 5. We omit results by Tang et al. [26] as they are not directly comparable to ours given the stark difference in available training data. When training on strictly TR22 and NLM180 (thus being comparable to most prior work), our model exhibits state-of-the-art performance across all metrics on either test sets. We present Figures 3 and 4 to illustrate error cases to be discussed later in Section 5. In additional to actual and predicted annotations, these figures include a sigmoid gating activity visualization for edges in the dependency tree. The visualization serves two purposes. First, it confirms the intuition for this particular design and, second, provides a means to interpret model decisions. That is, we can observe the importance of each edge in the dependency tree as deemed by the network for a particular example. In Figure 3, for example, we can observe that for the target word "digoxin" (which is a precipitant, the second occurrence in the sentence), the phrase "use", "concomitantly", and "with" show very high activity. Likewise, signal flow from "hemodynamic" to "effects" is strong, and vice versa. Less important words such as articles appear to receive less incoming activity overall, even through self-loops. 5 ERROR ANALYSIS In this section, we perform error analysis to identify challenging cases typically resulting in erroneous predictions by the model. One major source of difficulty for the model is boundary detection in cases of multi-word entities. Errors of this type are especially prominent in case of effect mentions which may manifest as potentially long noun phrases. Phrases with conjunctions or punctuation marks (or a combination of) may also present an obstacle for the model; for example, an effect expressed as "serious and/or life threatening reaction" may instead be predicted as simply "life threatening reaction." Figure 3 shows a general case of this error where the model recognizes "potentiation of adverse hemodynamic effects" as the effect while the ground truth identifies the effect as simply "adverse hemodynamic effects." This leads to both a false positive and a false negative for both the NER and the RE evaluation. We note that, given the potentially limitless ways an effect may be expressed, any disagreement among annotators (for cases beyond those addressed in annotator guidelines) during the initial annotation process will lead to inconsistent ground truth data and thus negatively affect downstream model performance. As an example, consider the following two sentences that appear in TR22: "Co-administration of 16 • Tran et al. Fig. 3. An example sentence from the drug label for Savella along with the resulting prediction and ground truth labels. Red arrows indicate interaction outcome. Fig. 4. An example sentence from the drug label for Aubagio along with the resulting prediction and ground truth labels. Red arrows indicate interaction outcome, where C54357 is a PK label corresponding to the NCI Thesaurus code for "Increased Concomitant Drug Level." SAMSCA with potent CYP3A inducers .." and "For patients chronically taking potent inducers of CYP3A, .." Here, one sentence is annotated such that potent is included as part of the precipitant expression, while another is annotated such that this modifier is excluded. Mixed signals and noisy labels in general tend to be an issue especially when there is limited training data as deep learning models are prone to overfitting. When evaluating on purely effect mentions, we obtain a micro-F1 score of 66% (54% Precision, 87% Recall). However, the micro F1 is 87% when ignoring the starting boundary offset and 86% when ignoring the ending boundary offset during evaluation corresponding to roughly 20 absolute micro-F1 gain in performance. When applying the same looser evaluation criteria to triggers and precipitants, the gains are only ≈ 6% and ≈ 5% respectively. Thus there is immense potential for improving entity recognition of effect mentions if we can better handle boundary detection, possibly via rule-based methods or post-processing adjustments, with the added benefit of improving consequence prediction performance for PD interactions. Precipitants interacting with the label drug being mentioned multiple times may also cause issues for the model. As an example, consider the sentence presented in Figure 3. Our model identifies both mentions of the precipitant "Digoxin" as being involved in an interaction with the drug Savella; however, the ground truth more specifically recognizes the second mention as the sole precipitant. This results in an additional false positive with respect to both NER and RE evaluation. Lastly, there are cases where the model will mistake a mention subtly referring to the label drug as a precipitant. This is a common occurrence in cases where the label drug is not referred to by name, but by a class of drugs. Typically, identifying a mention as a reference to the drug label beforehand will disqualify it from being predicted as a precipitant. While we do use a lexicon of drug names mapped to drug synonyms and drug classes to identify these indirect mentions, it is not exhaustive for all drugs. For example, within the label of the drug Lexapro, consider the sentence "Altered anticoagulant effects, including increased bleeding, have been reported when SSRIs and SNRIs are coadministered with warfarin." Here, the model SIGMOID GATEACTIVITYPREDICTEDACTUALSIGMOID GATEACTIVITYPREDICTEDACTUALC54357 Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 17 recognized SSRI and SNRI as precipitants. This is incorrect, however, as Lexapro is an SSRI and these mentions are more than likely referring to Lexapro. Without this information, the model likely assumes that it is an implicit case where the label drug is not mentioned and therefore assume all drug mentions are precipitants. Hence, curating a more exhaustive lexicon for indirectly mentions of the label drug will improve overall performance. Table 6. Confusion matrix for interaction type Predicted PD PK UN 68 147 599 37 353 10 l PD 788 PK 57 UN 170 a u t c A Lastly, we describe a source of difficulty stemming from incorrectly classifying interaction types. Figure 4 presents an example sentence where our model mistakes PK for PD interactions and a trigger mention for an effect mention. As PD and PK interactions tend to frequently co-occur with effect and trigger mentions respectively, predicted annotations tend to be polarized toward one pair (PD with effect) or the other (PK with trigger). Hence, differentiating between types of interactions for each recognized precipitant is another interesting class of error. Among all correctly recognized precipitants (based purely on boundary detection), we analyzed cases where one type of interaction, among PD, PK, and Unspecified (UN), is mistaken for another via the confusion matrix in Table 6. Clearly, many errors are due to cases where (1) we mistake unspecified precipitants for PD precipitants and (2) we mistake PK precipitants for unspecified precipitants. We conjecture that making precise implicit connections (not only whether there is evidence in the form of trigger words or phrases, but whether the evidence concerns the particular precipitant) is highly nontrivial. Likely, this aspect may be improved by inclusion of more high quality training data. Confusion between trigger and effect mentions is less concerning; among more than 1000 cases, there are six cases where we mistake effect for trigger and 20 cases where we mistake trigger for effect. 6 CONCLUSION In this study, we proposed an end-to-end method for extracting drugs and their interactions from drug labels, including interaction outcome in the case of PK and PD interactions. The method involved composing various intermediate representations including sequential and graph based context, where the latter is produced using a novel attention-gated version of the graph convolution over dependency parse trees. The so called graph convolution with attention-gating (GCA), along with transfer learning via serial pre-training using other annotated DDI datasets including DDI2013, resulted in an improvement over our original TAC challenge entry by up to 6 absolute F1 points overall. Among comparable studies (based on training data composition), our method exhibits state-of-the-art performance across all metrics and test sets. Future work will focus on curating more quality training data and leveraging semi-supervised methods overcome the scarcity in training data. ACKNOWLEDGEMENTS AND FUNDING This research was partially conducted during TT's participation in the Lister Hill National Center for Biomedical Communications (LHNCBC) Research Program in Medical Informatics for Graduate students at the U.S. National Library of Medicine, National Institutes of Health. HK is supported by the intramural research program at the U.S. National Library of Medicine. RK and TT were supported by the U.S. National Library of Medicine through grant R21LM012274. 18 • Tran et al. REFERENCES [1] Daniel Andor, Chris Alberti, David Weiss, Aliaksei Severyn, Alessandro Presta, Kuzman Ganchev, Slav Petrov, and Michael Collins. 2016. Globally normalized transition-based neural networks. arXiv preprint arXiv:1603.06042 (2016). [2] Masaki Asada, Makoto Miwa, and Yutaka Sasaki. 2018. Enhancing Drug-Drug Interaction Extraction from Texts by Molecular Structure Information. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). 680 -- 685. [3] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In Proceedings of 3th International Conference on Learning Representations (ICLR). [4] Jason PC Chiu and Eric Nichols. 2016. Named Entity Recognition with Bidirectional LSTM-CNNs. Transactions of the Association for Computational Linguistics 4 (2016), 357 -- 370. [5] Bharath Dandala, Diwakar Mahajan, and Ananya Poddar. 2018. IBM Research System at TAC 2018: Deep Learning architectures for Drug-Drug Interaction extraction from Structured Product Labels. In Proceedings of the 2018 Text Analysis Conference (TAC 2018). [6] Dina Demner-Fushman, Kin Wah Fung, Phong Do, Richard D. Boyce, and Travis Goodwin. 2018. Overview of the TAC 2018 Drug-Drug Interaction Extraction from Drug Labels Track. In Proceedings of the 2018 Text Analysis Conference (TAC 2018). [7] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 770 -- 778. [8] María Herrero-Zazo, Isabel Segura-Bedmar, Paloma Martínez, and Thierry Declerck. 2013. The DDI corpus: An annotated corpus with pharmacological substances and drug -- drug interactions. Journal of biomedical informatics 46, 5 (2013), 914 -- 920. [9] Rosie Jones, Andrew McCallum, Kamal Nigam, and Ellen Riloff. 1999. Bootstrapping for text learning tasks. In IJCAI-99 Workshop on Text Mining: Foundations, Techniques and Applications, Vol. 1. [10] Ramakanth Kavuluru, Anthony Rios, and Tung Tran. 2017. Extracting Drug-Drug Interactions with Word and Character-Level Recurrent Neural Networks. In Fifth IEEE International Conference on Healthcare Informatics (ICHI). IEEE, 5 -- 12. [11] J-D Kim, Tomoko Ohta, Yuka Tateisi, and JunâĂŹichi Tsujii. 2003. GENIA corpusâĂŤa semantically annotated corpus for bio-textmining. Bioinformatics 19, suppl_1 (2003), i180 -- i182. [12] Yoon Kim. 2014. Convolutional Neural Networks for Sentence Classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, Doha, Qatar, 1746 -- 1751. http://www.aclweb.org/ anthology/D14-1181 [13] Linda T Kohn, Janet M Corrigan, and Molla S Donaldson. 2000. To err is human: building a safer health system. Vol. 6. National Academies Press. [14] Daniel R Levinson. 2010. Adverse events in hospitals: national incidence among Medicare beneficiaries. Department of Health and Human Services Office of the Inspector General (2010). [15] Fei Li, Meishan Zhang, Guohong Fu, and Donghong Ji. 2017. A neural joint model for entity and relation extraction from biomedical [16] Sangrak Lim, Kyubum Lee, and Jaewoo Kang. 2018. Drug drug interaction extraction from the literature using a recursive neural text. BMC bioinformatics 18, 1 (2017), 198. network. PloS one 13, 1 (2018), e0190926. [17] Shengyu Liu, Kai Chen, Qingcai Chen, and Buzhou Tang. 2016. Dependency-based convolutional neural network for drug-drug interaction extraction. In 2016 IEEE International Conference on Bioinformatics and Biomedicine (BIBM). IEEE, 1074 -- 1080. [18] Shengyu Liu, Buzhou Tang, Qingcai Chen, and Xiaolong Wang. 2016. Drug-drug interaction extraction via convolutional neural networks. Computational and mathematical methods in medicine 2016 (2016). [19] Yuan Luo, Özlem Uzuner, and Peter Szolovits. 2016. Bridging semantics and syntax with graph algorithmsâĂŤstate-of-the-art of extracting biomedical relations. Briefings in bioinformatics 18, 1 (2016), 160 -- 178. [20] Sampo Pyysalo, Filip Ginter, Hans Moen, Tapio Salakoski, and Sophia Ananiadou. 2013. Distributional semantics resources for biomedical text processing. In Proceedings of 5th International Symposium on Languages in Biology and Medicine. 39 -- 44. [21] Lev Ratinov and Dan Roth. 2009. Design challenges and misconceptions in named entity recognition. In Proceedings of the Thirteenth Conference on Computational Natural Language Learning. Association for Computational Linguistics, 147 -- 155. [22] Sunil Kumar Sahu and Ashish Anand. 2018. Drug-drug interaction extraction from biomedical texts using long short-term memory network. Journal of biomedical informatics 86 (2018), 15 -- 24. [23] Burr Settles. 2012. Active learning. Synthesis Lectures on Artificial Intelligence and Machine Learning 6, 1 (2012), 1 -- 114. [24] Víctor Suárez-Paniagua, Isabel Segura-Bedmar, and Paloma Martínez. 2017. Exploring convolutional neural networks for drug -- drug interaction extraction. Database 2017 (2017). [25] Xia Sun, Ke Dong, Long Ma, Richard Sutcliffe, Feijuan He, Sushing Chen, and Jun Feng. 2019. Drug-Drug Interaction Extraction via Recurrent Hybrid Convolutional Neural Networks with an Improved Focal Loss. Entropy 21, 1 (2019), 37. [26] Siliang Tang, Qi Zhang, Tianpeng Zheng, Mengdi Zhou, Zhan Chen, Lixing Shen, Xiang Ren, Yueting Zhuang, Shiliang Pu, and Fei Wu Wu. 2018. Two Step Joint Model for Drug Drug Interaction Extraction. In Proceedings of the 2018 Text Analysis Conference (TAC 2018). Attention-Gated Graph Convolutions for Extracting Drug Interaction Information from Drug Labels • 19 [27] Tung Tran, Ramakanth Kavuluru, and Halil Kilicoglu. 2018. A Multi-Task Learning Framework for Extracting Drugs and Their Interactions from Drug Labels. In Proceedings of the 2018 Text Analysis Conference (TAC 2018). [28] Andrew Viterbi. 1967. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE transactions on Information Theory 13, 2 (1967), 260 -- 269. [29] Yuhao Zhang, Peng Qi, and Christopher D Manning. 2018. Graph Convolution over Pruned Dependency Trees Improves Relation Extraction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. [30] Zhehuan Zhao, Zhihao Yang, Ling Luo, Hongfei Lin, and Jian Wang. 2016. Drug drug interaction extraction from biomedical literature using syntax convolutional neural network. Bioinformatics 32, 22 (2016), 3444 -- 3453.
1809.05576
2
1809
2018-09-24T13:24:38
Events Beyond ACE: Curated Training for Events
[ "cs.CL" ]
We explore a human-driven approach to annotation, curated training (CT), in which annotation is framed as teaching the system by using interactive search to identify informative snippets of text to annotate, unlike traditional approaches which either annotate preselected text or use active learning. A trained annotator performed 80 hours of CT for the thirty event types of the NIST TAC KBP Event Argument Extraction evaluation. Combining this annotation with ACE results in a 6% reduction in error and the learning curve of CT plateaus more slowly than for full-document annotation. 3 NLP researchers performed CT for one event type and showed much sharper learning curves with all three exceeding ACE performance in less than ninety minutes, suggesting that CT can provide further benefits when the annotator deeply understands the system.
cs.CL
cs
Events Beyond ACE: Curated Training for Events Ryan Gabbard, Jay DeYoung, Marjorie Freedman USC Information Sciences Insitute, Raytheon BBN Technologies [email protected], [email protected], [email protected] Abstract We explore a human-driven approach to annotation, curated training (CT), in which annotation is framed as teaching the system by using interactive search to identify informative snippets of text to annotate, unlike traditional approaches which either annotate preselected text or use active learning. A trained annotator performed 80 hours of CT for the thirty event types of the NIST TAC KBP Event Argument Extraction evaluation. Combining this annotation with ACE results in a 6% reduction in error and the learning curve of CT plateaus more slowly than for full-document annotation. 3 NLP researchers performed CT for one event type and showed much sharper learning curves with all three exceeding ACE performance in less than ninety minutes, suggesting that CT can provide further benefits when the annotator deeply understands the system. 8 1 0 2 p e S 4 2 ] L C . s c [ 2 v 6 7 5 5 0 . 9 0 8 1 : v i X r a 1. Introduction Identifying events from a given ontology in text and locat- ing their arguments is an especially challenging task be- cause events vary widely in their textual realizations and their arguments are often spread across multiple clauses or sentences. Most event research has been in the con- text of the 2005 NIST Automatic Content Extraction (ACE) sentence-level event mention task (Walker et al., 2006), which also provides the standard corpus. Recently, TAC KBP has introduced document-level event argument extrac- tion shared tasks for 2014 and 2015 (KBP EA). Progress on events since ACE has been limited. Most sub- sequent work has tried improve performance through the use of more complex inference (Li et al., 2013), by trans- ductively drawing on outside sources of information, or both (Ji and Grishman, 2008; Hong et al., 2011). Such ap- proaches have produced modest reductions in error over a pipeline of simple classifiers trained on ACE. In our efforts to improve on the KBP EA 2014 systems, we were stymied by a lack of data, especially for rarer event types. Ten of the 33 event types have fewer than 25 train- ing examples in ACE, and even for more frequent events, many trigger words and classes of arguments occurred only once. Furthermore, the 2015 task would include new argu- ment types. These problems motivated the following ques- tion: (a) are we at a plateau in the performance vs. an- notation time curve? (b) is there an viable alternative to full-document annotation, especially for rarer event types? (c) for novel event types or languages, how quickly can a useful event model be trained? In traditional annotation, a static corpus selected to be rich in the target event types is annotated. Active learning aug- ments existing training data by having a human oracle an- notate system queries (or features (Settles, 2011)). We ex- plored a novel form of annotation, curated training (CT), in which teachers (annotators) actively seek out informative training examples. 2. Curated Training In CT the teacher created a prioritized INDICATOR LIST of words and phrases which could indicate a target event's Work was performed when Gabbard and Freedman were at presence. Given a tool with a search box, a document list, and a document text pane, teachers searched1 for indicators in priority order and annotated ten documents each. On loading a document, they used their browser's search to lo- cate a single sentence containing the indicator. If the sentence mentioned multiple instances of the target event or was unclear, it was skipped. If it contained no mention of the event, they marked it NEGATIVE.2 Other- wise, they (a) marked the sentence as EVENT-PRESENT; (b) applied the ANCHOR annotation to the tokens3 whose pres- ence makes the presence of the event likely; (c) marked each argument span within the selected sentence; and (d) marked any other spans they thought might be 'educational' as INTERESTING. (d) was also done for NEGATIVE sen- tences. Teachers were permitted to annotate extra documents if an indicator seemed ambiguous. They looked very briefly (2-3 seconds) in the context of selected sentences to see if there were additional informative instances to annotate. If any non-indicator anchor was marked, it was added to the indi- cator list with high priority. The process was repeated for four hours or until the teacher felt additional CT would not be useful.4 2.1. Data Gathered We recruited three teachers without NLP backgrounds but with annotation experience. We consider here only the teacher (A) who completed all event types in time for as- sessment. Teacher A averaged seven minutes brainstorming indicators and produced 6,205 event presence, 5137 nega- tive, and 13,459 argument annotations. Every teacher ac- tion was time-stamped. For analysis, we updated the times- tamps to remove breaks longer than two minutes.5 Since the CT was stored as character offsets, we aligned it 1over Gigaword 5 (Parker et al., 2011) using Indri (Strohman et al., 2005) 2Negated, future, and hypothetical events were all considered mentions of an event, not NEGATIVES 3if there were no anchors, the document was skipped 4See curves in Figure 2. In many cases annotation appears to terminate early because annotators had no way of tracking when they hit exactly four hours. 5Annotators were never to spend more than 2-3 seconds on any BBN decision to parses to get ACE-style event mentions. For training our argument attachment models, we omit any event mentions where any annotation failed to project. Projecting Teacher A's data produced 5792 event mentions for trigger training, 5221 for argument training, and 4,954 negatives.6 3. Evaluation Our target evaluation task is KBP-EA (NIST, 2014) which requires mapping a document to a set of (t, r, e, m) tu- ples indicating that an entity e plays the role r in an event of type t with realis m. Scoring is F1 over these tuples.7 We evalute over the the 2014 newswire eval- uation corpus (Joe Ellis and Strassel, 2015) using the scorer8 on the evaluation key augmented with assess- ments by Teacher A of responses from our system not found therein.9 To focus on event detection and argu- ment attachment, we enabled the neutralizeRealis and attemptToNeutralizeCoref scorer options. 3.1. Baseline The highest-performing system in KBP EA 2014, BBN1, ran a pipeline of four log-linear classifiers (trigger detection, argument attachment, genericity assignment, and a trigger- less argument model) in a high-recall mode which output all event mentions and arguments scoring above 10% prob- ability. This output was fed into a series of inference rules and a score was computed based on the sub-model scores and the inference rules applied (Chan et al., 2014). We used this evaluation system for the experiments in this paper with two changes. First, BBN1 used a multi-class model for trigger detection, while we use one binary model per event type because with CT each type has a different set of negative examples. Second, we omitted the 'trigger- less' argument classifier for simplicity. This version, BASE- LINE, lags BBN1's performance by 0.8 F1 but outperforms all other 2014 evaluation systems by a large margin. To compare against full document annotation, we needed to estimate how long the event-only portion of ACE an- notation took.10 The LDC11 ventured a rough estimate of 1500 words per hour (about twenty minutes per ACE doc- ument). The LDC human annotator in KBP-EA 2014 was allocated thirty minutes per document (Freedman and Gab- bard, 2014). We use the former estimate. To estimate per- formance with a fraction of ACE, we used the first n% doc- uments as needed. 4. Analysis In aggregate CT's performance closely tracked ACE for small amounts of mean annotation time per event (Figure 1). However, the performance of CT plateaus more slowly than ACE, beginning to diverge around ninety minutes per event, and continuing to increase sharply at the end of 6c.f. roughly 5,300 event mentions in ACE 7The details of the scoring are given in (NIST, 2014). 8https://github.com/isi-nlp/tac-kbp-eal 9 The evaluation answer key had assessments of all 2014 sys- tem response and those of an an LDC annotator operating under significant time-pressure (thirty minutes per document) 10Excluding coreference, etc. 11personal communication Figure 1: Performance vs. mean time per event Tch. A DESIGNER Words Doc.s Searches Prec. Rec. 13k 256 28 71 14 21k 466 75 42 38 EXP. 1 13k 165 23 56 43 EXP. 2 20k 334 37 71 34 Table 1: FLICT.DEMONSTRATE Teacher A vs NLP experts on CON- our annotation, leaving unclear what the potential perfor- mance of the technique is. When added to ACE, the CT improves performance somewhat, reducing error of P/R/F 1%/5%/6% at ninety minutes per event before plateauing. CT has a substantial advantage over ACE for event types which are rare in ACE, but lags significantly for event types abundant in ACE (Figure 2).12 The annotation tool designer and two other NLP experts also did CT for CONFLICT.DEMONSTRATE (Figure 3; Table 1). All experts significantly outperformed Teacher A and ACE in terms of F1. In two cases this is because the experts sacrificed precision for recall. The second expert matched Teacher A's precision with much higher recall. Annotators varied widely in the volume of their annotation and indi- cator searches, but this did not have a clear relationship to performance. 4.1. Possible Confounding Factors Because Teacher A both provided CT and did the output assessment, improvements may reflect the system learning their biases. We controlled for this somewhat by having Teacher B dual-assess several hundred responses, resulting in encouraging agreement rates of 95% for event presence, 98% for role selection, and 98% for argument assessment.13 For some events, the guidelines changed from ACE to KBP EA 2014 by eliminating 'trumping' rules and expanding al- lowable inference, which could also account for some im- provement. If either of these were significant factors, it 12The anomalously poor performance on TRANSACTION.TRANSFER-MONEY is due to a bug. 13AET, AER, and BF in KBP EA terms (Joe Ellis and Strassel, 2014) Figure 2: Performance vs. average annotation time per event on a per-event basis. x → y indicates there were x event mentions of training for this type in ACE and y argument tuples for it in the evaluation set. Li, Q., Ji, H., and Huang, L. (2013). Joint Event Extrac- tion via Structured Prediction with Global Features. In Proceedings of the ACL 2013. NIST. (2014). TAC KBP 2014 Event Argu- http://www.nist. ment Task Description. gov/tac/2014/KBP/Event/guidelines/ EventArgumentTaskDescription. 09042014.pdf. Robert Parker and David Graff and Junbo Kong and Ke Chen and Kazuaki Maeda. (2011). English Gigaword Fifth Edition. Linguistic Data Consortium, ISLRN 911- 942-430-413-0. Settles, B. (2011). Closing the Loop: Fast, Interactive Semi-Supervised Annotation with Queries on Features and Instances. In Proceedings of EMNLP 2011. Strohman, T., Metzler, D., Turtle, H., and Croft, W. B. (2005). Indri: A language model-based search engine for complex queries. Proceedings of the International Conference on Intelligent Analysis, 2(6):2 -- 6. Walker, C., Strassel, S., Medero, J., and Maeda, K. (2006). ACE 2005 Multilingual Training Corpus. Figure 3: FLICT.DEMONSTRATE Teacher A vs NLP experts on CON- would suggest that CT may be a useful tool for retargetting systems to new, related tasks. 5. Acknowledgements Thanks to Elizabeth Boschee and Dan Wholey for do- ing annotation. This research was developed with fund- ing from the Defense Advanced Research Projects Agency (DARPA). The views, opinions, and/or findings expressed are those of the author(s) and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. Distribution 'A': Ap- proved For Public Release, Distribution Unlimited. 6. Bibliographical References Y. S., (2014). Chan, R. Proceedings //www.nist.gov/tac/protected/2014/ TAC2014-workshop-notebook/results. html. Freedman, M., BBN's KBP EA System. and Gabbard, In http: 2014. of NIST TAC Freedman, M. and Gabbard, R. (2014). An Overview the TAC KBP Event Argument Extraction In Proceedings of NIST TAC 2014. of Evaluation. http://www.nist.gov/tac/protected/ 2014/TAC2014-workshop-notebook/ results.html. Hong, Y., Zhang, J., Ma, B., Yao, J., Zhou, G., and Zhu, Q. (2011). Using Cross-Entity Inference to Improve Event Extraction. In Proceedings of the ACL 2011. Ji, H. and Grishman, R. (2008). Refining Event Extraction Through Cross-Document Inference. In Proceedings of the ACL 2008. 1.4. Joe Ellis, J. G. and Strassel, S. (2014). TAC KBP 2014 Event Argument Extraction Assessment Guidelines V. http://www.nist.gov/tac/2014/ KBP/Event/guidelines/TAC_KBP_2014_ Event_Argument_Extraction_Assessment_ Guidelines_V1.4.pdf. Joe Ellis, J. G. and Strassel, S. (2015). LDC2015E22: TAC KBP English Event Argument Extraction Comprehen- sive Pilot and Evaluation Data 2014.
1409.4614
4
1409
2015-09-20T01:11:53
Lexical Normalisation of Twitter Data
[ "cs.CL" ]
Twitter with over 500 million users globally, generates over 100,000 tweets per minute . The 140 character limit per tweet, perhaps unintentionally, encourages users to use shorthand notations and to strip spellings to their bare minimum "syllables" or elisions e.g. "srsly". The analysis of twitter messages which typically contain misspellings, elisions, and grammatical errors, poses a challenge to established Natural Language Processing (NLP) tools which are generally designed with the assumption that the data conforms to the basic grammatical structure commonly used in English language. In order to make sense of Twitter messages it is necessary to first transform them into a canonical form, consistent with the dictionary or grammar. This process, performed at the level of individual tokens ("words"), is called lexical normalisation. This paper investigates various techniques for lexical normalisation of Twitter data and presents the findings as the techniques are applied to process raw data from Twitter.
cs.CL
cs
Lexical Normalisation of Twitter Data Bilal Ahmed Department of Computing and Information Systems The University of Melbourne Victoria, Australia Email: [email protected] Abstract—Twitter with over 500 million users globally, generates over 100,000 tweets per minute1 . The 140 character limit per tweet, perhaps unintentionally, encourages users to use shorthand notations and to strip spellings to their bare minimum “syllables” or elisions e.g. “srsly”. The analysis of Twitter messages which typically contain misspellings, elisions, and grammatical errors, poses a challenge to established Natural Language Processing (NLP) tools which are generally designed with the assumption that the data conforms to the basic grammatical structure commonly used in English language. In order to make sense of Twitter messages it is necessary to first transform them into a canonical form, consistent with the dictionary or grammar. This process, performed at the level of individual tokens (“words”), is called lexical normalisation. This paper investigates various techniques for lexical normalisation of Twitter data and presents the findings as the techniques are applied to process raw data from Twitter. Keywords—Lexical Normalisation; Phonetic Matching; Levenshtein distance; Refined Soundex; Peter Norvig’s Algorithm; N-Gram; Twitter Data I. INTRODUCTION A Twitter message or “tweet” consists of 140 or fewer characters, and generally contains hash tags and @ symbols. In order to lexically analyse a Twitter message each token needs to be identified on a case by case basis before normalisation techniques are applied to correct spelling mistakes and make sense of the various acronyms and elisions frequently used in Twitter messages. The proceeding sections describe in detail the various techniques that are applied to identity: “known” or “in-vocabulary” words; punctuation and special symbols (both general and Twitter specific); and candidates for normalisation. We then apply various normalisation techniques to correct out of vocabulary (“OOV”) tokens. II. IN VOCABULARY TOKENS The first step is to identify tokens or words that are in vocabulary. The dictionary is searched for an exact match of the word. A token is tagged as “in vocabulary (“IV”) if an exact match is found. For the purpose of this project we have used a lexicon of 115,326 words (words.txt) to identify “in vocabulary” words. Tokens that fall outside of this vocabulary are then considered as candidates for normalisation and are further processed or marked as non-candidates if deemed not fit for normalisation. III. NON-CANDIDATE TOKENS In addition to common punctuation symbols a Twitter message or “tweet” generally contains hash tags, the “#” symbol, to mark keywords or topics in a tweet and the “@” symbol followed by a user’s Twitter username to refer to a user when replying or commenting. The tokens are parsed using regular expression to identify special characters, punctuation and Twitter specific symbols. These special tokens are marked as non-candidates (“NO”) and are not processed for normalisation. IV. NORMALISATION OF OUT OF VOCABULARY TOKENS Lexical normalisation is the process of transforming tokens into a canonical form consistent with the dictionary and grammar. These tokens include words that are misspelt or intentionally shortened (elisions) due to character limit in case of Twitter. When a word falls outside the vocabulary as defined by the collection of words in word.txt file, and does not contain any special characters, punctuation or Twitter specific symbols, it is marked as out of vocabulary (“OOV”) and is processed as a candidate for normalisation. Overview of the Normalisation Process: Once a candidate has been identified for normalisation, firstly, edit distance (Levenshtein distance) technique is applied to find matches from (words.utf-8.txt) which are within 2 (inclusive) edit distance of the query. The results are stored in an array. We refer to this set as the “First Set of Matches based on Edit Distance” since they contain approximate matches based on their textual similarity to the query. The second step in the process is to apply Refined Soundex technique to this set of matches based on edit distance. This refines the set and results in approximate matches that are phonetically similar to the query. The results are stored in another array. This refined and phonetically similar set of words is referred to as “Phonetic Matches”. 1 Twitter in numbers, The Telegraph, March 2013 1 P a g e The third step is to find an approximate match using Peter Norvig’s Algorithm. This returns one match deemed closest to the query by the algorithm. The forth step compares the result of the Peter Norwig algorithm with those obtained in Step 2 by applying Refined Soundex technique. If both of the results are same, i.e. only 1 phonetic match is found by Refined Soundex technique and is the same as that returned by Peter Norvig’s Algorithm, then no further processing is performed, and the result is used as the normalised version for the query. If more than 1 phonetic match is returned by Refined Soundex technique then based on rules described in Section 4.3 a further 5-Gram Context Matching is performed. The fifth step is to perform a 5-Gram Context Matching technique using each phonetic match as the query in the following regular expression: {Previous word, Query, Next word} This takes into account the previous and next words, to the query, and performs an exhaustive search to find the most commonly pattern. This technique uses each phonetic match to see if it is a likely candidate based on its occurrence as defined by the pattern above. This technique is further explained in Section 4.4. The outcome of this search is used as the normalised version for the query. TABLE 1: CORPORA UTILIZED FOR NATURALISATION OF OUT OF VOCABULARY “OOV” WORDS. Corpus2 words.txt words.utf-8.txt big.txt w5_.txt Features 115,326 words* 645,288 words+ 1 M words^ 1 M words# (1,044,268) Approximate matching techniques are performed to extract relevant matches from over 3.5 M words contained in corpora listed in Table 1. The following sections explain in detail the techniques utilised to find the closest matches to “out of vocabulary” (OOV) tokens. A. Edit Distance (Section 4.1, Step 1) The OOV or “query” token is compared against the 645,288 words contained in the words.utf-8.txt file. The first set of crude matches is gathered by calculating the Levenshtein distance between the query and the words in the dictionary. Levenshtein distance is a string metric for measuring the difference between two sequences. It is defined as the minimum number of single character edits (insertion, deletion, substitution) required to change one word into the other. The phrase edit distance is often used to refer specifically to Levenshtein distance. Using this technique which employs matching based on the textual representation of the characters in the query; the dictionary (words.utf-8.txt) is searched for matches that are within 2 (inclusive) Levenshtein distance of the query. This generates the first set of approximate matches based on the textual similarity to the query. The results are stored in an array. This set generally contains words that may have been misspelt in the query. B. Phonetic Matching (Section 4.2, Step 2) Phonetic matching algorithms match two different words with similar pronunciation the same code. These algorithms compare and index words that are phonetically similar and can be used for spelling correction. to Refined Soundex algorithm is an improvement to the original Soundex algorithm, in which the letters are divided into more groups (Fig 1.) based on their sound. Also, the length of the result is not truncated, so the code does not have a fixed length. This provides better resolution for phonetic matching as compared to the original Soundex. d, t 1 5 6 g, j d, t l r b, p f, v 1 2 3 4 5 3 4 m, n c, k, s q, x, z b, f, p, v Orginal Soundex Refined Soundex c, g, j, k, q, s, x, z 2 Fig. 1. Phonetic Matching Refined Soundex is used to further analyse and phonetically match words gathered in the first set, based on their Levenshtein distance to the query as described in Section 4.1. The words in the array are filtered based on their phonetic similarity to the query as shown in Figure 2 below. 6 7 8 9 m, n l r 2 *words.txt is used to search for in-vocabulary words. +words.utf-8.txt is used to search for approximate matches for normalisation of “OOV” words ^big.txt consists of about a million words. The file is a concatenation of several public domain books from Project Gutenberg and lists of most frequent words from Wiktionary and the British National Corpus. This is used by Peter Norvig’s algorithm for naturalisation. #w5_.txt is used to perform context based 5-Gram matching 2 P a g e Fig. 2. Steps 1 and 2 This produces an array containing closer matches and is a set of words which are: Phonetically similar and, i. ii. Within 2 or less Levenshtein distance to the query C. Peter Norvig’s Algorithm (Section 4.3, Step 3) Peter Norvig’s Algorithm generates all possible terms with an edit distance of less than or equal to 2 (which includes deletes, transposes, replaces, and inserts) from the query term and searches them in the dictionary (big.txt, see Table1). For a word of length n, an alphabet size a, an edit distance d=1, there will be n deletions, n-1 transpositions, a*n alterations, and a*(n+1) insertions, for a total of 2n+2an+a-1 terms at search time. This is much better than the naive approach, but still expensive at search time (114,324 terms for n=9, a=36, d=2) and is language dependent. Because the alphabets are used to generate the terms, and are different in many languages, it could potentially lead to a very large number of search terms. E.g. In Chinese: a=70,000 Unicode Han characters. Never the less, it usually achieves 80-90% accuracy averaging at about 10 words per second. For the purpose of this experiment we apply Peter Norvig Algorithm to find the best match for a given query as shown in Figure 3, below. b) If both Refined Soundex and Peter Norwig algorithm derive the same result, i.e. only 1 phonetic match is found which, is the same as Peter Norwig’s result, then no further processing is conduced and the result is returned as the normalised version for a query. c) If Refined Soundex returns more than 1 phonetic match, then the query is further analysed using 5- Gram Context Matching technique as detailed in Section 4.4. Fig. 4. Step 4 D. 5-Gram Context Matching (Section 4.4, Step 5) If there are more than 1 phonetic matches found, in other words if Refined Soundex technique (Section 4.2) returns more than one phonetic match then a 5-Gram Context Matching technique is applied using each phonetic match as the query in the following regular expression: {Previous word, Query, Next word} The following rules are applied to assemble the regular expression for 5-Gram Matching: a) b) If the previous and next words to the query are both in vocabulary, then following pattern is used: {Previous word, Query, Next word} If only the previous word is in vocabulary then: {Previous word, Query} is used. Fig.3. Step 3 – Peter Norvig Algorithm c) Else if only the next word is in vocabulary then: {Query, Next word} is used The result is then compared (Figure 4) with the phonetically matched words derived in Section 4.2 based on the following rules: a) Peter Norwig’s result takes precedence and is returned as the normalised word for a query, if 0 phonetic matches are found after applying Refined Soundex algorithm (in Section 4.2). Fig.5. Step 5 – 5-Gram Context Matching 3 P a g e The query which returns the maximum number of occurrences in w5_.txt (which consists of over a million words as 5-Grams) is returned as the normalised version of the query as shown in Figure 5. Here the most common occurrence of the {Previous word, Query, Next word} is returned as the result, where each phonetic match is used as query to find a likely candidate based on its occurrence as defined by the pattern above V. CONCLUSION Normalising tokens with high accuracy can be quite a challenge given the number of possible variations for a given token. This is further compounded by the ever increasing and evolving elisions and acronyms frequently used in social media tools such as Twitter. It is important to take into consideration the various normalisation techniques that are available and to pick the ones that best suit the purpose. A blend of techniques such as edit distance and Soundex or Refined Soundex usually results in better accuracy as compared to their standalone application. Techniques based on context such as Peter Norvig’s algorithm increase the accuracy of normalisation. Similarly, N-Gram matching, although exhaustive, can be optimised to produce accurate results based on the context. ACKNOWLEDGMENT The author would like to thank Professor Rao Kotagiri and Jeremy Nicholson for their invaluable guidance throughout this research. The author would also like to thank Professor Justin Zobel. REFERENCES [1] Zobel, J. and Dart, P. Phonetic String Matching: Lessons from Information Retrieval [2] Han, B. and Baldwin, T. Lexical Normalisation of Short Text Messages: Makn Sens a #twitter [3] Whitelaw, C and Hutchinson, B. and Y Chung, G. and Ellis, G. Using the Web for Language Independent Spellchecking and Autocorrection Google Inc., Pyrmont NSW 2009, Australia [4] Holt, R. Twitter numbers, The Telegraph, March 2013,http://www.telegraph.co.uk/technology/twitter/9945505/Twitter- in-numbers.html in [5] Norvig, P. How to Write a Spelling Corrector,http://norvig.com/spell- correct.html 4 P a g e
1906.05760
1
1906
2019-06-13T15:40:50
Semantic Change and Semantic Stability: Variation is Key
[ "cs.CL", "q-bio.PE" ]
I survey some recent approaches to studying change in the lexicon, particularly change in meaning across phylogenies. I briefly sketch an evolutionary approach to language change and point out some issues in recent approaches to studying semantic change that rely on temporally stratified word embeddings. I draw illustrations from lexical cognate models in Pama-Nyungan to identify meaning classes most appropriate for lexical phylogenetic inference, particularly highlighting the importance of variation in studying change over time.
cs.CL
cs
Semantic Change and Semantic Stability: Variation is Key Yale University / 370 Temple St New Haven, CT 06520 Claire L. Bowern USA 9 1 0 2 n u J 3 1 ] L C . s c [ 1 v 0 6 7 5 0 . 6 0 9 1 : v i X r a [email protected] Abstract I survey some recent approaches to studying change in the lexicon, particularly change in meaning across phylogenies. I briefly sketch an evolutionary approach to language change and point out some issues in recent approaches to studying semantic change that rely on tem- porally stratified word embeddings. I draw illustrations from lexical cognate models in Pama-Nyungan to identify meaning classes most appropriate for lexical phylogenetic in- ference, particularly highlighting the impor- tance of variation in studying change over time. 1 Introduction All aspects of all languages are changing all the time. And for most of human history, for most of the world's languages, this change is not recorded. Therefore, in order to understand language change adequately, we need methods which allow us to extrapolate back beyond what is identifiable in the written record, which is both shallow and geo- graphically sparse. In this paper, I discuss how evolutionary approaches to language change allow the modeling of cognate evolution. I show how such models can be used to study semantic change at the macro-level, and finally how we can make use of existing data to refine meaning categories for use in inferring language splits. I focus on the- oretical models of change. I begin with a brief outline of contemporary language change, particularly as studied quanti- tatively (Bowern 2018 provides more context). I then discuss issues of reconstructing meaning and identifying meaning change, before present- ing two case studies: one on studying semantic change across a phylogeny, the other about identi- fying lexical stability. 1.1 What is language change Much contemporary work on historical linguistics aims to answer one or more of three key questions for the nature of language change: 1. What forms have changed? 2. How does change work? 3. Why does it work the way it does? The first aspect of diachrony involves establish- ing the "facts": that is, identifying differences be- tween languages at various stages of their history (or differences between related languages) and es- tablishing which of those differences are due to change in the system, and which are artefacts of data gathering or sampling. Research of this type includes how language informs our study of pre- history. Questions of this type include "Where was the homeland of speakers of Proto-Pama- Nyungan?" (Bouckaert et al., 2018) or "What is the origin of the Latin ablative case?" The second question -- how does change work -- seeks to establish the general properties of change. These are "mode and tempo" type ques- tions (Greenhill et al., 2010), regarding which items in language change more rapidly than oth- ers, what features change into which others, and which features are stable across centuries and mil- lennia. Work in this area include Hamilton et al. (2016b) on semantic change, Wedel et al. (2013) on sound change, Van Gelderen (2018) on change in argument structure, and indeed much work of recent years (Bowern and Evans, 2014). The third question -- the why of language change -- has received less attention. Until recently, it has been difficult to study changes at the scale neces- sary, and with the precision necessary, to do more than speculate. Moreover, the focus in histori- cal linguistics on language-internal explanations has made it difficult to grapple with the obvious fact that languages change in large part because of the way people acquire and use them (see fur- ther §1.2). One example of modeling a 'why' of change in meaning comes from Ahern and Clark (2017), which argues that one type of semantic change occurs because of psychological tenden- cies for interlocutors to assume exaggeration. What How Why Figure 1: Key questions All of these questions are related to one another, and the answers to one inform the others. We cannot make plausible inferences about processes without a theory, any more than we can work on a theory of change without data to test it with. The what provides us with observations; the why pro- vides us with a theory that explains those observa- tions, and the how provides us with a framework to structure those observations, and to predict and evaluate implications of the theory. Language change can be studied at different scales. Phylogenetic approaches typically look across millennia (Bowern, 2018; Greenhill et al., 2010) and concentrate on areas that are assumed to be stable. Other methods look at micro-levels of change; for example, Yao et al. (2018); Hamil- ton et al. (2016b) and Eisenstein et al. (2014) study change at the range of decades and weeks respec- tively. 1.2 Traditional explanations of language change The current 'received view of language change can be summarized as follows (necessarily with much loss of nuance; see further Hock and Joseph 1996). Language change begins with an innovation in a single language user. That innovation catches on and spreads through a community, over time re- placing older forms. Because not all members of a language community interact with each other all the time, innovations spread at different rates, and to different extents, across a language area. Thus dialects form, and those dialects eventually become sufficiently different that they come to be regarded as different languages. Innovations may also be introduced when speakers/signers of a lan- guage come into contact with a different language or dialect and adopt some of its features. Most generative approaches to change assume that the point at which languages change is when children are acquiring language (Lightfoot, 1991; Hale, 2007), a model that goes back ultimately to Paul (1880). Yet we know that language acquisi- tion is not the main driver of all language change. Language change in the historical record happens too fast for children to be solely involved.1 The evidence is overwhelming that childrens role is minimal (Aitchison, 2003) in the spread of inno- vations. The errors that children make are not the main types of change we see in the record. More- over, innovations are spread through social net- works, and children acquiring language have pe- ripheral positions in such networks. The key questions model of change summarized in Figure 1, though fairly common in evolutionary anthropology and in phylogenetic approaches, is not the way historical linguistics has been concep- tualized traditionally. Weinreich et al. (1968) or Labov (2001), Lightfoot (1991), and others in the generative tradition have often conceptualized the nature of the task of historical linguistics is being about the differences between two stages of a lan- guage. That is a simpler problem, since it reduces language change to problem of edit distances. But it does not answer the questions we posed above, except inasmuch as identifying the differences -- that is, figuring out that something happened -- is just Stage 0 in understanding what happened, how it happened, and why. 1.3 Evolutionary views of change An alternative approach is a framework which treats language as a complex evolutionary system (e.g. Bowern, 2018; Mesoudi, 2011; Wedel, 2006). This views language as a Darwinian system where changes are modeled through the key properties of variation, selection, and transmission. In an evolutionary system, change is modeled as follows. The unit of study is the population; for language, our 'population' could be a speech com- munity or members of an ethno-linguistic group (Marlowe, 2005). Such communities are inher- ently variable: we know that not everyone speaks the same way, and that variation has social mean- 1Compare the arguments in D'Arcy (2017) for the recent spread of 'like' as a discourse particle. points at which features vary. That is, we are not just comparing differences across points in time, but examining variation within a system and how that variation changes over time. Contrast seman- tic change studied by word embeddings, for exam- ple, where words are treated as discrete and uni- form entities at each time point. As such, they are unable to distinguish between relative shifts in fre- quency of use among subsenses, and the spread of genuine innovations. The former may be a precur- sor to the latter, but the processes are not identical. Moreover, studying change in this way (cor- rectly) entails that we not conceptualize change as 'facilitating efficient communication'. This is a teleological view. Instead, biases and synchronic features of language make some changes more or less likely (cf. Blevins, 2004). Finally, the transmission mechanism for lan- guage need not be strictly intergenerational. Tak- ing an evolutionary view of language change does not entail that it be studied with direct and concrete analogues to biological replication and speciation. A evolutionary view requires that there be a mod- eled transmission mechanism, not that the trans- mission mechanism exclusively involves transfer of material from parents to their children. 2 Lexical replacement models 2.1 Types of lexical replacement With that background, let us now consider 'change' specifically as applied to the lexicon. Like other parts of language, the lexicon is also constantly changing. The lexicon can be viewed as a set of mappings between forms, meanings, and the world. For example, the form we write as cat maps to a concept, which relates to language users' knowledge of this animal in the real world. The following points summarize the types of lexical replacement that are possible in spoken and signed languages. Numerous works on seman- tic change have typologized the relationships be- tween words and concepts at different stages in time (cf. Traugott and Dasher, 2002). Terms such as subjectification, meronymy, and amelioration all describe different relationships between words across time. Such points are, in this typology, all contained under the concept of "semantic change". 1. Semantic change: that is, change in mappings between a lexical item, concepts, and world 2. Borrowing from other languages Figure 2: Schematic representation of language change in an evolutionary framework ing. Systems which contain no variation cannot be modeled in an evolutionary framework. Much linguistic variation can be described in terms of social variables such as age, gender, socioeconomic class, geography, ethnicity, patri- group, moiety, and the like (though of course, not all of these variables explain linguistic variation). Speakers do not use these variables deterministi- cally, but with them index aspects of social iden- tity (Bucholtz and Hall, 2005). Other inputs to the pool of variation include psychological and phys- iological aspects of language production and per- ception. For example, the fundamental frequency (or 'pitch') of speech partly varies physiologi- cally (taller people have deeper voices), partly so- cially (higher and lower pitch can index femininity and masculinity, respectively), and partly gram- matically (for example, the difference between a declarative statement and a question can be sig- naled solely by an intonational rise at the end of the clause). Some of these variants are under selection (pos- itive or negative). Not all variants have equal chances of spreading within a community. Not all variants are under positive or negative selection; those that are are likely to change faster. Selec- tion can be models as a set of bias biases in lan- guage transmission which inhibit or faciliate trans- mission. Such biases include acquisition, cogni- tive/physiological biases, and social biases. Over time, these biases affect the input that chil- dren are exposed to, as well as the ways adults use language. We see the results reflected over genera- tions as "change" propagated through the linguis- tic record. Conceptualizing language change in this way has consequences for how change is studied. In- stead of looking across a system to extract gener- alizations, we are looking within a system for the 3. Creation of words de novo 4. (Loss) As Bender (2019) has noted, because of the heavy emphasis on English in NLP, the distinc- tion between words and concepts is sometimes ob- scured. Yet it is vital when considering how con- cepts change. For example, if I describe a move- ment as catlike, I am evoking aspects of the con- cept 'cat', not a literal cat. (Someone can walk in a catlike fashion without, for example, being furry or having a tail.) An emphasis on typologically similar and closely related languages is also problematic for studying tendencies. For example, Hamilton et al. (2016a) argue as an absolute that nouns are more likely to undergo irregular cultural shifts (e.g. ex- pansion due to technological innovations) while verbs are more likely to show regular processes of change, such as drift. Such a view does not take into account that verb numbers differ extensively across languages, and the functional load, levels of polysemy, and lexicalization patterns for events also differ -- points that Hamilton et al. (2016b) showed were important in assessing likelihood of change. Technological innovation, while excep- tionally salient to those who work in NLP, is un- likely to have been the same driving factor in se- mantic change across most of human history. And indeed, it plays a small role in the literature on lexical replacement, where euphemism, metaphor- ical extension, and bleaching play more important roles. A further type of lexical replacement involves borrowing (Haspelmath and Tadmor, 2009). Both borrowing and creation of words from new re- sources involve the innovation of mappings be- tween words and concepts within a linguistic sys- tem. In the former, lexical material is adapted from another language, while in the latter, it is created from language-internal resources or inno- vated from scratch. Languages differ in the ex- tent to which novel word formation is utilized, and the strategies, from compounding to acronyms to blends, also vary greatly. Furthermore, there is variation in the extent to which language users borrow words (see further Bowern et al. 2011), but there are regularities in which words are more likely to be borrowed. Word creation has played a role in NLP approaches to semantic change be- cause of the focus on named entity identification, but it is a small part of change overall. 2.2 Evolutionary semantic change Such changes can be modeled in an evolutionary framework. Some variation is neutral (not under selection). For example, speakers of American English have several distinct systems of contrast in the meanings of the words 'cobweb' and 'spi- derweb':2 • The two words are synonymous; • Spiderwebs are spiral or wheel-shaped, cob- webs are collapsed; • Spiderwebs have spiders in them, other items are cobwebs (including abandoned but intact wheel webs); • Spiderwebs have spiders, while cobwebs are synonymous with dirt or dust bunnies (detri- tus that is cleaned when cleaning a house). That is, cobwebs are not necessarily old spi- derwebs but could be from other material. Speakers are unaware of these differences in se- mantic distinctions, and the variants do not clearly pattern by age, gender, or geography. Such vari- ation is not under selection and is below the level of consciousness. It is, however, very hard to de- tect (not least because it is usually also invisible to researchers). Other selectional pressures skew change. Such biases include (but are not limited to) meaning transmission failure and speaker attitudes. For example, there is a bias against using words with novel denotations. Meaning is convention- alized, which is what prevents English speak- ers from calling a '(cid:63)' a 'sun'. However, lan- guage users do make creative and novel associa- tions between objects, which do over time end up as change. For example, several Pama-Nyungan subgroups have words for 'eye' which are ety- mologically connected to 'seeds' (compare Wati and Pama-Maric languages, which have indepen- dently shifted *kuru 'seed' to 'eye'; the Yolngu language Yan-nhanu has a single term manutji, which means 'eye', 'well', and 'seed'. To study such changes, it is vital to have a good empirical basis for the possibilities for polysemy and shift. List et al. (2013) provides an example using trans- lation equivalents across languages from different families. 2The source of this observation is 4 years of polling his- torical linguistics students at Yale. Finally, words can also fall out of use. They may be tabooed through necronym replacement or protective euphemism, or lost when the knowledge of the concepts they represent is also lost (such as ethnobiological knowledge in many urban English speakers). In summary, semantic change can be modeled in an evolutionary framework, where meanings vary, have positive or negative selectional biases, and are transmitted through language use. If a word is not used, it is not transmitted. Such a view provides a clue to Hamilton et al.'s findings about polysemy and and frequency. Words are more likely to change if they have low frequency, be- cause speakers have less information about mean- ing, making them more vulnerable to reinterpre- tation or replacement (further eroding their fre- quency). Words are also more likely to change if they exhibit high polysemy, perhaps because they are both more ambiguous and more likely to be further extended. 2.3 Word embeddings With this theoretical background, let us now turn to an evaluation of methods. Word embeddings (Turney and Pantel, 2010; Kulkarni et al., 2015) are an increasingly common tool for studying change in vocabulary over time. They rely on the intuition that "you can know a word by the com- pany it keeps" (Firth, 1957, 11), and by studying the changes in word use it is possible to quantify and further study language change. Critiques of the effectiveness of using word em- beddings to study change are well known. Du- bossarsky et al. (2017) and Tahmasebi et al. (2018) have pointed out issues that limit the utility of em- beddings for studying change, such as the neces- sity for large corpora, the brittleness of results, and the lack of ability to study word senses indepen- dently. This latter point is particularly important for theories of meaning change, since as argued above, understanding variation is a prerequisite to an adequate modeling of the evolution of linguistic systems over time. Embeddings across massive corpora assume that all speakers have the same knowledge of the vocabulary of their language. That is sim- ply not true, as illustrated by the simple example in §2.2 above. Not all speakers/signers know all the words of their languages. Using embeddings across many speakers and documents also con- flates real-world knowledge (e.g. Linnaean classi- fication) with linguistic knowledge. For example, I do not need to know that a koala is a member of the genus Phascolarctos to know what a koala is, any more than the etymology (from Daruk kula) is part of the meaning. Yet because word em- bedding models use encyclopedic corpora such as Wikipedia, they tend to be skewed towards such information. Finally, embedding changes conflate changes in frequency of a word with conceptual changes, fur- ther obscuring mechanisms of change. Yao et al. (2018) identify shifts in frequency and use this as a diagnostic for language change. They use the example of 'apple's vectorization changing over time from being more similar to other fruit to be- ing more similar to computer equipment and soft- ware. However, just because apple is now more associated in their corpus with software than with fruit, it doesn't entail that the meaning of the word has actually changed over that time period. It is a possible precursor to a change where a word goes through a period of variation and polysemy (an A, A∼B, B change), but that is not the only type of change. For a similar problem, see Kulkarni et al. (2015) on word usage time series, and for a more nuanced view, Kutuzov et al. 2018. If we are to study change, we can't just abstract away from variation in the data as "noise". Variation leads to change, and not all differences are changes. 3 Lexical replacement and phylogenetics 3.1 Stability and meaning So far, I have concentrated discussion on variation and change. However, for studying change at the macro-level, across phylogenetic time, we require items which have high semantic stability. Evolu- tionary approaches to language split use lexical re- placement to model language evolution. That is, they take presumed stable (but nonetheless vary- ing) meaning categories and use the variation in the realization of those meanings to build a model of language split, from which the phylogeny is re- covered. Such work is now well established in the literature on language change and the reader is referred to Dunn (2014) and Bowern (2018) for summaries. State of the art methods use Bayesian inference; see Bouckaert et al. (2018) for expla- nation and details of priors, cognate models, and data treatment. Such methods can be used to study semantic change over a phylogeny. They are particularly useful for studying the lexicalization of opposi- tions within a small semantic space. For exam- ple, Haynie and Bowern (2016) used such methods to see how color terms changed across the Aus- tralian family Pama-Nyungan. The visible color spectrum is modeled as partitioned by vocabulary (Regier et al., 2005). These partitions obey evolu- tionary principles. There is variation (people don't have full agreement in the assignment of lexicon to the visible spectrum, and color terms vary across languages); transmission (color terms are acquired and transmitted with other aspects of language) and selection (there are physiological constraints on perception (which are also variable), for exam- ple, and visual exemplars which tend to lexical- ize as color terms; cf. 'orange'). Keeping the con- ceptual space constant and varying the partitioning avoids the problem that other types of change are happening simultaneously. That is, we can't study the evolution of particular words in many domains because the words fall out of use or are replaced too many times across the tree. These models require cognate evolution mod- els. Currently, the main one is Brownian Motion (that is, random change across a tree). Such mod- els fit these types of change well, and allow us to evaluate the effectiveness of such models as well as probabilistically reconstructing ancestral states. 3.2 Lexical replacement in phylogenetics A final illustration of evolutionary methods for meaning change and lexical replacement concerns a practical issue for phylogenetics: the 'legacy problem' of Swadesh wordlists. Since (Swadesh, 1952, 1955), linguists have been using similar lists of so-called 'basic vocabulary' to construct cognate evolutionary matrices.3 These wordlists are now a sample of convenience, as lexical re- source collection has prioritized vocabulary from Swadesh lists. Other work (McMahon and McMa- hon, 2006) has reduced the number of comparison items even further. Rama and Wichmann (2018) estimate the number of items needed for small 3A 'cognate' is a a word which shares an evolutionary his- tory of descent with other words. English 'fish' and German 'Fisch' are cognate, because they continue the same form- meaning correspondence from an ancestor language. English 'much' and Spanish 'mucho' are not cognate, despite their similarity in form, because they continue different lexical roots. 'Much' continues Old English mickel (ultimately from an Indo-European root meaning 'big, great', while Spanish mucho continues Latin multus 'much, many', ultimately from a root meaning 'crumpled'. Figure 3: PCA and loadings for meaning classes phylogenies; however, they do not take stability into account. Their estimate concludes approx- imately 30 data points per language in the phy- logeny. However, the number of such data points varies with both the number of meaning classes and their stability. To illustrate for 300 Pama- Nyungan languages, the number of cognates per meaning class in the Swadesh 200 list ranges from 40 to 199, and the number of languages with a sin- gleton cognate in a meaning class ranges from 20 (for the second person plural pronoun) to 126 (for translations of the concept 'small'). The effect of the choice of vocabulary on phy- logeny is not well studied. Bouckaert et al. (2018) point out that the difference between Bowern and Atkinson (2012) and their phylogeny includes ad- ditional words; using an additional 20 vocabu- lary items changed the classification of some lan- guages to be more in line with established sub- grouping based on grammatical features. We know that loan rates affect suitability for phylo- genetic inference, and that loan rates in basic vo- cabulary vary. We are left with Swadesh lists be- ing the default instrument for inference, yet they are based on a list whose membership was deter- mined by, to put it bluntly, one person's sugges- tion of what might be useful to diagnose remote relationships 70 years ago, not on a principled de- cision of stability in meaning classes. Many factors contribute to go into making a meaning class a good or poor choice for phylo- genetics. If the meaning class is too stable, there llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllaboveagainallandankleantarmpitashesatbackbadbellybelowbigbirdbitecooktruecrycutsundiedigdingodirtydogdreamdrinkdrybluntdusteareartheateggeyefaecesfallfarfatherfearfeatherfirefishflowfogfootgoodgrassgrowhand3sgheadhearheavyhidehithold1sginsideintestinesitchkangarookillknowlakelaughleafleftleglightningliverlonglouselungmanmeatmoonmosquitomothermouthnamenapenearnecknewnightnoseoldoneopenotherpersonrainredrightroadrootroperottensandsayscratchseesharpshortshoulderashamedsitskinskysleepsmallsmokesnakespearspearthrowerspiderspitsplitsqueezestabstandstarstealtreestonesucksweatswellswimtailthat3plthinthinkthis2sgthreethroatthrowthundertonguetoothturntwovomitwalkwater1pl.excl1pl.inclwetwhitewifewindwingwomanyawnyellowsickMaxClassSizeLoansHapaxesMissingmeanDstat−4−202−202Dim1 (30.4%)Dim2 (29.3%)0.250.500.75cos2PCA − Biplot is not sufficient variation to recover and date phy- logenetic splits. If a word is widely loaned, that will make the evolutionary history harder to un- cover and reduce phylogenetic signal. If an item changes too fast, or there are too many singleton reflexes, there is less informative signal higher in the tree. Homoplasy (convergent evolution) is also problematic, as it it difficult to detect and can lead to false language groupings. In order to evalu- ate the suitability of individual meaning classes, I coded cognate sets in the material used in Bouck- aert et al. (2018) and Bowern et al. (2011) for number of loan events, informativeness of phy- logenetic signal (D statistic; see Fritz and Purvis 2010), number of singletons, amount of missing data, and mean and maximum meaning class size (that is, how many languages attest a particular cognate in that meaning class). Figure 3 plots the first two PCA and clusters meaning classes based on these variables, using the fviz cluster() function in the Factoextra package in R (Kassambara and Mundt, 2017). The largest factor contributing to dimension 1 is how much data is missing, while dimension 2's largest contribution is the number of singleton cognates per meaning class. Meaning classes which score relatively highly on dimension 1 and relatively low on dimension 2 are most likely to be optimal for phylogenetic analysis. However, items solely taken from the southeast quadrant are the most stable, and therefore likely to lead to un- derestimates of splits. 4 Conclusion In conclusion, evolutionary approaches to lan- guage change provide explicit ways of modeling semantic shifts and lexical replacement. They pro- vide researchers with a structure for examining the facts of language differences, the mode and tempo of language change, and a way of framing ques- tions to lead to an understanding of why languages change the way they do. In all this, however, vari- ation is key -- it provides the seeds of change, al- lows the identification of change in progress, and the absence of variation makes it possible to study stability and shift across millennia. References Christopher Ahern and Robin Clark. 2017. Conflict, cheap talk, and Jespersen's cycle. Semantics and Pragmatics, 10. Jean Aitchison. 2003. Psycholinguistic perspectives In The Handbook of Histor- on language change. ical Linguistics, chapter 25, pages 736 -- 743. Wiley Blackwell. Emily M. Bender. 2019. English isn't general for lan- guage, despite what NLP papers might lead you to believe. Sumposium on Data Science and Statistics, Bellevue, WA. Juliette Blevins. 2004. Evolutionary phonology: The emergence of sound patterns. CUP, Cambridge. Remco R Bouckaert, Claire Bowern, and Quentin D Atkinson. 2018. The origin and expansion of Pama -- Nyungan languages across Australia. Nature ecol- ogy & evolution, 2:741 -- 749. Claire Bowern. 2018. Computational phylogenetics. Annual Review of Linguistics, 4:281 -- 296. Claire Bowern and Quentin Atkinson. 2012. Compu- tational phylogenetics and the internal structure of Pama-Nyungan. Language, 88(4):817 -- 845. Claire Bowern, Patience Epps, Russell D. Gray, Jane Hill, Keith Hunley, Patrick McConvell, and Jason Zentz. 2011. Does lateral transmission obscure in- heritance in hunter-gatherer languages? PloS One, 6(9):e25195. Claire Bowern and Bethwyn Evans, editors. 2014. Routledge Handbook of Historical Linguistics. Routledge, Oxford. Mary Bucholtz and Kira Hall. 2005. Identity and in- teraction: A sociocultural linguistic approach. Dis- course studies, 7(4-5):585 -- 614. Alexandra D'Arcy. 2017. Discourse-pragmatic varia- tion in context: Eight hundred years of like. John Benjamins Publishing Company. Haim Dubossarsky, Daphna Weinshall, and Eitan Grossman. 2017. Outta control: Laws of semantic change and inherent biases in word representation models. In Proceedings of the 2017 conference on empirical methods in natural language processing, pages 1136 -- 1145. Michael Dunn. 2014. Language phylogenies. In Claire Bowern and Bethwyn Evans, editors, The Routledge Handbook of Historical Linguistics, pages 190 -- 211. Routledge, London. Jacob Eisenstein, Brendan O'Connor, Noah A Smith, and Eric P Xing. 2014. Diffusion of lexical change in social media. PloS one, 9(11):e113114. John R Firth. 1957. A synopsis of linguistic theory 1930-1955. Oxford University Press, Oxford. Susanne A Fritz and Andy Purvis. 2010. Selectivity in mammalian extinction risk and threat types: a new measure of phylogenetic signal strength in binary traits. Conservation Biology, 24(4):1042 -- 1051. Simon J Greenhill, Quentin D Atkinson, Andrew The shape Meade, and Russell D Gray. 2010. Proceed- and tempo of language evolution. ings of the Royal Society B: Biological Sciences, 277(1693):2443 -- 2450. Mark Hale. 2007. Historical Linguistics: Theory and Method. Blackwell Publishing. William L Hamilton, Jure Leskovec, and Dan Jurafsky. 2016a. Cultural shift or linguistic drift? comparing two computational measures of semantic change. In Proceedings of the Conference on Empirical Meth- ods in Natural Language Processing, volume 2016, page 2116. NIH Public Access. William L Hamilton, Jure Leskovec, and Dan Juraf- sky. 2016b. Diachronic word embeddings reveal statistical laws of semantic change. arXiv preprint arXiv:1605.09096. Martin Haspelmath and Uri Tadmor. 2009. Loanwords in the world's languages: a comparative handbook. Mouton de Gruyter, Berlin. Hannah Haynie and Claire Bowern. 2016. A phylo- genetic approach to the evolution of color term sys- tems. PNAS. H. H. Hock and B. D. Joseph. 1996. Language History, Language Change, and Language Relationship: An Introduction to Historical and Comparative Linguis- tics. Mouton de Gruyter, Berlin. Alboukadel Kassambara and Fabian Mundt. 2017. fac- toextra: Extract and Visualize the Results of Multi- variate Data Analyses. R package version 1.0.5. Vivek Kulkarni, Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. 2015. Statistically significant de- tection of linguistic change. In Proceedings of the 24th International Conference on World Wide Web, WWW '15, pages 625 -- 635, Republic and Canton of Geneva, Switzerland. International World Wide Web Conferences Steering Committee. Andrey Kutuzov, Lilja Øvrelid, Terrence Szymanski, and Erik Velldal. 2018. Diachronic word em- beddings and semantic shifts: a survey. CoRR, abs/1806.03537. William Labov. 2001. Principles of linguistic change: social factors. Blackwell, Oxford. David Lightfoot. 1991. How to set parameters: Argu- ments from language change. Cambridge University Press, Cambridge. Johann-Mattis List, Anselm Terhalle, and Matthias Ur- ban. 2013. Using network approaches to enhance the analysis of cross-linguistic polysemies. In Pro- ceedings of the 10th International Conference on Computational Semantics (IWCS 2013) -- Short Pa- pers, pages 347 -- 353. Frank W Marlowe. 2005. Hunter-gatherers and hu- man evolution. Evolutionary Anthropology: Issues, News, and Reviews: Issues, News, and Reviews, 14(2):54 -- 67. April McMahon and Robert McMahon. 2006. Lan- guage classification by numbers. Oxford University Press, Oxford. Alex Mesoudi. 2011. Cultural evolution. University of Chicago Press, Chicago. Hermann Paul. 1880. Prinzipien der Sprachgeschichte. Aufl. Halle. Taraka Rama and Søren Wichmann. 2018. Towards identifying the optimal datasize for lexically-based bayesian inference of linguistic phylogenies. In Pro- ceedings of the 27th International Conference on Computational Linguistics, pages 1578 -- 1590. Terry Regier, Paul Kay, and Richard S. Cook. 2005. Focal colors are universal after all. Proceedings of the National Academy of Sciences, 102:8386 -- 8391817 -- 845. M. Swadesh. 1952. Lexicostatistic dating of prehis- toric ethnic contacts. Proceedings of the American Philosophical Society, 96:452 -- 463. M. Swadesh. 1955. Towards greater accuracy in lex- icostatistic dating. International Journal of Ameri- can Linguistics, 21:121 -- 137. Nina Tahmasebi, Lars Borin, and Adam Jatowt. Survey of computational approaches to arXiv preprint 2018. diachronic conceptual change. arXiv:1811.06278. E.C. Traugott and R.B. Dasher. 2002. Regularity in Semantic Change. CUP, Cambridge. Peter D Turney and Patrick Pantel. 2010. From fre- quency to meaning: Vector space models of seman- tics. J Artif Intell Res, 37(1):141 -- 188. Elly Van Gelderen. 2018. The diachrony of verb mean- ing: Aspect and argument structure. Routledge. A. Wedel. 2006. Exemplar models, evolution and lan- guage change. The Linguistic Review, 23(3). A. Wedel, S. Jackson, and A. Kaplan. 2013. Func- tional load and the lexicon. Language and Speech, 56(3):395 -- 417. U. Weinreich, W. Labov, and M. Herzog. 1968. Empir- ical foundations for a theory of language change. In Lehmann & Malkiel, editor, Directions for historical linguistics: a symposium, pages 95 -- 195. University of Texas Press, Austin. Zijun Yao, Yifan Sun, Weicong Ding, Nikhil Rao, and Hui Xiong. 2018. Dynamic word embeddings for In Proceedings of evolving semantic discovery. the Eleventh ACM International Conference on Web Search and Data Mining, WSDM '18, pages 673 -- 681, New York, NY, USA. ACM.
1806.06734
1
1806
2018-06-18T14:35:14
Unsupervised Word Segmentation from Speech with Attention
[ "cs.CL", "cs.AI" ]
We present a first attempt to perform attentional word segmentation directly from the speech signal, with the final goal to automatically identify lexical units in a low-resource, unwritten language (UL). Our methodology assumes a pairing between recordings in the UL with translations in a well-resourced language. It uses Acoustic Unit Discovery (AUD) to convert speech into a sequence of pseudo-phones that is segmented using neural soft-alignments produced by a neural machine translation model. Evaluation uses an actual Bantu UL, Mboshi; comparisons to monolingual and bilingual baselines illustrate the potential of attentional word segmentation for language documentation.
cs.CL
cs
Unsupervised Word Segmentation from Speech with Attention Pierre Godard∗1, Marcely Zanon Boito(cid:63)1, Lucas Ondel(cid:5), Alexandre Berard(cid:63)‡, Franc¸ois Yvon∗, Aline Villavicencio†, Laurent Besacier(cid:63) ∗LIMSI, CNRS, Universit´e Paris-Saclay, Orsay, France (cid:63)LIG, UGA, G-INP, CNRS, INRIA, Grenoble, France (cid:5)BUT, Brno, Czech Republic †CSEE, University of Essex, UK ‡CRISTAL, Universit´e de Lille, France contact: [email protected], [email protected] (1) Both first authors have contributed equally to this paper 8 1 0 2 n u J 8 1 ] L C . s c [ 1 v 4 3 7 6 0 . 6 0 8 1 : v i X r a Abstract We present a first attempt to perform attentional word segmen- tation directly from the speech signal, with the final goal to automatically identify lexical units in a low-resource, unwrit- ten language (UL). Our methodology assumes a pairing be- tween recordings in the UL with translations in a well-resourced language. It uses Acoustic Unit Discovery (AUD) to convert speech into a sequence of pseudo-phones that is segmented us- ing neural soft-alignments produced by a neural machine trans- lation model. Evaluation uses an actual Bantu UL, Mboshi; comparisons to monolingual and bilingual baselines illustrate the potential of attentional word segmentation for language doc- umentation. Index Terms: language documentation, encoder-decoder models, attentional models, unsupervised word segmentation. computational 1. Introduction Speech technology often relies on minimal linguistic expertise and textual information to build acoustic and language models. However, for many languages of the world, text transcripts are limited or nonexistent; therefore, recent efforts have been de- voted to Zero Resource Settings [1, 2, 3] where the aim is to build speech systems without textual or linguistic resources for e.g.: (1) unwritten languages [4, 5]; (2) models that mimic child language development [6]; (3) documentation of endangered languages by analyzing speech recordings using automatically discovered linguistic units (phones, morphs, words, etc) [7]. This paper focuses on unsupervised word segmentation from speech: the system must output time-stamps delimiting stretches of speech, associated with class labels, corresponding to real words in the language. This task is already considered in the Zero Resource Speech Challenge1 in a fully unsupervised setting: systems must learn to segment from a collection of raw speech signals only. We investigate here a slightly more favor- able case where speech utterances are multilingually grounded: they are aligned, at the sentence level, to a written translation in another language. Such a condition is realistic in language documentation, where it is common to collect speech in the lan- guage of interest and have it translated or glossed in another language [8]. In this context, we want to examine whether we can take advantage of the weak form of supervision available 1http://zerospeech.com/2017 in these translations to help word segmentation from speech. Our hypothesis is that textual translations should help in seg- menting speech into words in the unwritten language, even in the absence of (manually obtained) phonetic labels. As a first contribution in this direction, we recently proposed to leverage attentional encoder-decoder approaches for unsupervised word segmentation [9]. However, this was done from an unsegmented sequence of (manually obtained) true phone symbols, not from speech. It was shown that the approach proposed can compete with a Bayesian Non Parametric (BNP) baseline [10] on a small corpus in Mboshi language (5k sentences only). In this paper, our contribution is to develop an attentional encoder-decoder word segmentation from speech (§2) that op- erates in two steps: (a) automatic Acoustic Unit Discovery (AUD), based on Bayesian models, to generate time-marked pseudo-phone symbols from the speech; (b) encoder-decoder word segmentation using these pseudo-phones.2 Experiments with AUD outputs of increasing complexity (see §3) are pre- sented for word boundary detection using the Mboshi corpus re- cently made available [13] (§4). Our best pipeline from speech has a word boundary F-measure of 50.0% while segmenting from true phone symbols leads to 61.0%. 2. Attentional Encoder-Decoder Approach for Word Discovery For word segmentation, given a parallel corpus pairing se- quences of pseudo-phone units in the unwritten language (UL) with sequences of words in the well-resourced language (WRL), we compute attention matrices as the result of training a standard Neural Machine Translation (NMT) system trans- lating from the WRL into the UL. Then, these soft-alignment matrices are post-processed to derive word boundaries. 2.1. Neural Architecture The NMT architecture, equations (1)-(4), are inspired by [14]. A bidirectional encoder reads the input sequence x1, ..., xA and produces a sequence of encoder states h = h1, ..., hA ∈ R2×n, where n is the chosen encoder cell size. At each time step t, the decoder uses its current state st−1 and an attention mechanism 2End-to-end speech processing can be performed with an encoder- decoder architecture for speech translation (e.g. [11, 12]); early attempts to train end-to-end from speech to translated text, in our language doc- umentation scenario, were not viable due to limited data. to compute a probability distribution yt over a target vocabulary of size V . It then generates the symbol zt having the highest probability, stopping upon generating a special end-of-sentence token. The decoder updates its internal representation st, using the ground-truth symbol wt, instead of the generated symbol zt, since in our alignment setting the reference translations are always available, even at test time. Our system is described by the following equations: ct = attn(h, st−1) yt = output(st−1 ⊕ E(wt−1) ⊕ ct) zt = arg max yt st = LSTM(st−1, E(wt) ⊕ ct), (1) (2) (3) (4) where ⊕ is the concatenation operator. s0 is initialized with the last state of the encoder (after a non-linear transformation), z0 = <BOS> (special token), and E ∈ RV ×n is the target embedding matrix. The output function uses a maxout layer, followed by a linear projection to RV , as in [14]. The attention mechanism is defined as: et,i = vT tanh (W1hi + W2st−1 + b2) αt,i = softmax(et,i) A(cid:88) (5) (6) (7) ct = attn(h, st−1) = αt,ihi i=1 where v, W1, W2, and b2 are learned jointly with the other model parameters. At each time step (t) a score et,i is computed for each encoder state hi, using the current decoder state st−1. (cid:80)A These scores are then normalized using a softmax function, thus giving a probability distribution over the input sequence i=1 αt,i = 1 and ∀t, i, 0 ≤ αt,i ≤ 1. The context vector ct used by the decoder is a weighted sum of the encoder states. This can be understood as a summary of the useful information in the input sequence for the generation of the next output sym- bol zt. Likewise, the weights αt,i can be viewed as defining a soft-alignment between the input xi and output zt. 2.2. Word Segmentations from Attention The main aspects of our approach are detailed below. ∀t,(cid:80) in NMT, Reverse Architecture: the soft alignments probabilities are normalized for each target symbol t (i.e. i αi,t = 1, with i indexing the source symbols). How- ever, there is no similar constraint for the source symbols, as discussed by [5]. Rather than enforcing additional constraints on the alignments, as in the latter reference, we propose to re- verse the architecture and to translate from WRL words into UL symbols, following [9]. This "reverse" architecture notably pre- vents the attention model from ignoring some UL symbols. As experiments with actual phone sequences have shown that the best results were obtained with this WRL-to-UL translation [9], we will use this reverse architecture throughout. Alignment Smoothing: to deal with the length discrepancy between UL (pseudo-phones) and WRL (words), we imple- mented the alignment smoothing procedure proposed by [5]. It consists of first adding temperature to the softmax function (we use T=10 for all experiments) used by the attention mechanism; and then post-processing the resulting soft-alignment probabil- ity matrices, averaging each score with the scores of the two neighboring words. Even if boosting many-to-one alignments should not hold in the case of the reverse architecture, we keep it for our experiments given the gains reported by [9], even in the reverse case. Hard Segmentation Generation: once the soft-alignment matrices α are obtained for all utterances in the corpus, a word segmentation is inferred as follows. We first transform soft- alignments into hard-alignments by aligning each UL symbol wt with the word xi such that: i = arg maxi(cid:48) αt,i(cid:48) . The source sequence is then segmented according to these hard-alignments: if two consecutive symbols are aligned with the same WRL word, they are considered to belong to the same UL word. 3. Acoustic Unit Discovery (AUD) Our AUD systems are based on the Bayesian non-parametric Hidden Markov Model (HMM) of [15]. This model is topo- logically equivalent to a phone-loop where each acoustic unit is represented by a left-to-right HMM. To cope with the unknown number of units needed to properly describe the speech, the model assumes a potentially infinite number of symbols. How- ever, the prior over the weight of the acoustic units (a Dirich- let Process [16]) will act as a sparsity regularizer, leading to a model which explains the data with a relatively small unit set. We implemented two variants of this original model. The first one, referred to as HMM, approximates the Dirichlet Pro- cess prior by a simpler symmetric Dirichlet prior, as pro- posed by [17]. This approximation, while retaining the spar- sity constraint, avoids the complication of dealing with the variational treatment of the stick breaking process in Bayesian non-parametric models. The second variant, denoted Struc- tured Variational AutoEncoder (SVAE) AUD, is based on the work of [18] and embeds the HMM model into a Variational Auto-Encoder (VAE) [19] where the posterior distribution of the HMM and the VAE parameters are trained jointly us- ing Stochastic Variational Bayes [20, 18]. To initialize the model, the prior distribution over the HMM parameters (mix- ture weights, means and covariance matrices) was set to the posterior distribution of the phone-loop trained in a supervised fashion (Baum-Welch training) on the TIMIT data set. This procedure can be seen as a cross-lingual knowledge transfer as the AUD training on the UL language is essentially adapting the English phone set distribution to the Mboshi corpus. Fi- nally, both models were trained using two features sets: the well-known MFCC + ∆ + ∆∆ features and the Multilingual BottleNeck (MBN) features [21]. Note that the MBN features were not trained on any Mboshi data, and only use languages as listed in [21]). 4. Word Segmentation Experiments 4.1. Corpus, Baselines and Metric We used the Mboshi5k corpus [13] in all our experiments.3 Mboshi (Bantu C25) is a typical Bantu language spoken in Congo-Brazzaville. It is one of the languages documented by the BULB (Breaking the Unwritten Language Barrier) project [7]. This speech dataset was collected following a real language documentation scenario, using Lig Aikuma,4 a mo- bile app specifically dedicated to fieldwork language documen- tation, which works both on Android powered smartphones and tablets [8]. The corpus is multilingual (5,130 Mboshi speech utterances aligned to French text) and contains linguists' tran- scriptions in Mboshi in the form of a non-standard graphemic 3The dataset is able mboshi-french-parallel-corpus at 4http://lig-aikuma.imag.fr documented avail- https://github.com/besacier/ [13] and in Mboshi French w´a´a ng´a iw´e l´eekund´a ng´a s´a oyo´a lend´uma saa m ´ot´ema si je meurs enterrez-moi dans la foret oyoa avec une guitare sur la poitrine Figure 1: A tokenized and lowercased sentence pair example in our Mboshi-French corpus. language Mboshi French #types 6,196 1,146 4,927 1,175 Table 1: Corpus statistics for the Mboshi corpus #tokens 27,563 2,993 38,843 4,283 #sent 4,616 514 4,616 514 split train dev train dev form close to the language phonology. Correct word segmen- tation of the Mboshi transcripts was also provided by the lin- guists and a forced-alignment between speech and transcripts was computed to obtain time-stamps-delimited word tokens for evaluation. The corpus is split in two parts (train and dev) for which we give basic statistics in Table 1. We also include an example of a sentence pair from our corpus in Figure 1. Our neural (attentional) word segmentation is compared with two baselines: a naive bilingual baseline (proportional) that segments the source according to the target as if the align- ment matrix between symbols (AUD symbols in Mboshi and graphemes in French) was diagonal;5 a monolingual baseline [10] which implements a Bayesian non-parametric approach, where (pseudo)-words are generated by a bigram model over a non-finite inventory, through the use of a Dirichlet process (ref- ered to as dpseg). We evaluate with the Boundary metric from the Zero Resource Challenge 2017 [22, 3]. It measures the qual- ity of a word segmentation and the discovered boundaries with respect to a gold segmentation (P, R and F-score are computed). 4.2. Details of the NMT system We use the LIG-CRIStAL NMT system.6 Our models are trained using the Adam algorithm, with a learning rate of 0.001 and a batch size (N) of 32. We minimize the cross-entropy loss between the output probability distribution pt = sof tmax(yt) and a reference translation wt. Our models use global atten- tion and bidirectional layer in the encoder; encoder and decoder have 1 layer each, with a cell size of 64. Dropout is applied with a rate equal to 0.5. For NMT training, we split the 5,130 sentences into training and development, with about 10% of the corpus for the latter. However, the soft-alignment matrices are obtained from both train and dev sets after forced-decoding and segmentation is evaluated on all 5,130 utterances. 4.3. Results Unsupervised word segmentation results obtained from speech with different AUD configurations as well as from true phones (upper-bound performance corresponding to a topline) are re- ported in Table 2, using the Boundary metric. We trained 5 dif- ferent NMT models changing the train/dev split7 and either (i) 5Blank spaces on the French side are then used to segment the Mboshi input. 6See https://github.com/eske/seq2seq. 7The difference between best and worst configurations varied from 0.5% to 1.3% for AUD, and 1.6% for true phones. averaging the scores over the 5 runs (columns att. (biling.) in Table 2) or (ii) averaging the obtained soft-alignment ma- trices (columns att. average in Table 2). The latter slightly boosts boundary detection performance. For all AUD configu- rations, our method outperforms two baselines (dpseg and pro- portional), as well as a pure speech-based baseline using seg- mental DTW [23], which only achieves a F-score of 19.3 on our data. While competitive with true phones, the results of the monolingual method (dpseg) are heavily degraded on dis- covered (noisier) units, as also reported by [2]. Conversely, our method is much more robust to noise and seems better suited for real-world scenarios. While straightforward, the bilingual base- line (proportional) is rather strong compared to its monolingual counterpart (dpseg). This suggests that multilingual grounding provides a useful signal for word segmentation from speech. Regarding AUD specifically, we observe that the best F- score for word boundary detection was obtained with MBN features and the SVAE model. The results of our attentional segmentation are the best results reported so far on this cor- pus. This confirms that we can effectively take advantage of the weak supervision available in the translations in order to help word segmentation from speech. 4.4. Discussion The NMT system requires a sequence of unsegmented symbols (the phones) and their aligned sentence translations in order to provide segmentation. Therefore, the AUD method chosen to encode the speech input has an impact on the quality of the fi- nal segmentation. Our best word segmentation results (see Ta- ble 2) are obtained using the SVAE model (this holds for both Bayesian and neural segmentation approaches). One natural ex- planation would be to posit that phone boundaries (and conse- quently word boundaries) are more accurately detected by the SVAE model than the HMM model. [24] show that this is true in terms of precision for phone boundaries, and in term of nor- malized mutual information, but that the recall on these bound- aries is lower than its HMM counterpart. This indicates that the SVAE model extract more consistent pseudo-phone units, although it misses some boundaries, than the HMM model, and we confirm here the result of [24] showing that this is beneficial for the word segmentation task. Another additional explanation might be that shorter se- quences of symbols are easier to segment. For instance, even if the attention helps the system to better deal with long sen- tences, it is still prone to performance degradation when faced with very long sequences of symbols [14]. Table 3 (left side) shows how the different AUD approaches are encoding the UL sentences. We observe that the HMM model uses more symbols to represent an utterance, while the SVAE model offers a more concise representation. Table 3 also reports information regarding the generated segmentation using a single attention model (right side), show- ing that our best model (MBN SVAE) results in segmentations that relate closely to the topline in terms of number of tokens per sentence. This best model also achieved a vocabulary size close to the topline, of 14,837 types compared to 13,878. This AUD feat. AUD model dpseg (monoling.) P MFCC HMM 27.9 MFCC SVAE 29.8 HMM 27.8 MBN SVAE MBN 30.0 53.8 true phones R 80.2 69.1 72.6 72.9 83.5 F 41.3 41.7 40.2 42.5 65.4 proportional baseline (biling.) F P 46.0 42.6 46.6 42.2 42.5 45.2 46.6 42.5 44.5 52.0 R 49.9 51.9 48.1 51.6 62.6 attentional (biling.)* att. average (biling.)+ P 51.6 52.7 50.8 57.2 60.5 R 44.9 45.0 44.5 43.0 59.9 F 48.0 48.5 47.4 49.1 60.3 P 55.5 55.7 54.1 60.6 62.8 R 43.7 44.1 42.9 42.5 59.3 F 48.9 49.2 47.8 50.0 61.0 Table 2: Precision, Recall and F-measure on word boundaries over the Mboshi5k corpus, using different AUD to extract pseudo-phones from speech. True phones toplines are also provided. *averaged scores over 5 different runs; +averaged 5 attention matrices Phones per Sentence Tokens per Sentence avg max min true phones 4 21.8 MFCC HMM 37.0 11 MFCC SVAE 7 26.3 MBN HMM 12 32.1 MBN SVAE 23.4 7 60 95 73 93 71 avg max min 1 6.0 3.6 1 1 7.6 1 5.0 5.4 1 21 22 26 14 21 Table 3: AUD methods differ in their ability to encode speech utterances (left side); which impacts the final segmentation of the attentional model (right side). is another clue as to why the MBN SVAE is performing best on our task. Analyzing the averaged attention model's results in Table 2, we can see an increase in performance of about 0.8% in all cases. This improvement also holds for tokens and types scores (not reported here). However, while the topline achieves 34.3% of vocabulary (types) retrieval, our best AUD setup achieves 13.5% only. This illustrates the difficulty of the word discovery task – a task already challenging with true phones – in noisy setups. The large difference between true phones and pseudo- phones for type's retrieval could be explained by the fact that a single change in the pseudo-phone sequence representing two speech segments of a same word will have the consequence to split the word cluster in two parts (in two types). A deeper analysis of the word clusters obtained is probably necessary to better understand how AUD from speech affects the word dis- covery task, and to come up with ways to better cluster speech segments in relevant types. The attention-based segmentation technique remains much more robust for word boundary detection than our monolingual (Bayesian) approach. Figure 2 shows an example of a (good quality) soft alignment (attention) matrix produced in our best setup (MBN SVAE). 5. Related Work Word segmentation in a monolingual setup was previously in- vestigated from text input [10] and from speech [23, 25, 26, 27]. Word discovery experiments from text input on Mboshi were reported in [28]. Bilingual setups (cross-lingual supervision) for word segmentation were discussed by [29, 30, 31, 9], but applied to speech transcripts (true phones). Looking at NMT from speech, the research by [11, 12] are recent examples of approaches to end-to-end spoken language translation, but us- Figure 2: NMT output alignment for true phones (top) and AUD using MBN SVAE (bottom). For illustration purposes, we give the transcription of the audio in Mboshi. ing much larger data conditions than ours. Among the most relevant to our approach are the works of [5] on speech-to-translation alignment using attentional NMT and of [32] for language documentation. However, the former does not address word segmentation and is not applied to a lan- guage documentation scenario, while the latter does not provide a full coverage of the speech corpus analyzed. 6. Conclusions Different from these related works and inspired by [9], this pa- per presented word segmentation from speech, in a bilingual setup and for a real language documentation scenario (Mboshi). The proposed approach first performs AUD to generate pseudo- phones from speech, and then uses these units in an encoder- decoder NMT for word segmentation. Our method leads to promising results for word segmentation from speech, outper- forming three baselines in noisy (pseudo-phones) setups and fi- nally delivering the best results reported so far for the Mboshi5k corpus. Future work includes investigating sources of weak su- pervision and minimal viable corpus sizes. 7. Acknowledgements This work was partly funded by French ANR and German DFG under grant ANR-14-CE35-0002 (BULB project). This work was started at JSALT 2017 in CMU, Pittsburgh, and was sup- ported by JHU and CMU (via grants from Google, Microsoft, Amazon, Facebook, Apple). It used the Extreme Science and Engineering Discovery Environment (NSF grant number OCI- 1053575 and NSF award number ACI-1445606). [18] M. Johnson, "Composing graphical models with neural networks for structured representations and fast inference," in Advances in Neural Information Processing Systems, D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, Eds. Curran Associates, Inc., 2016, pp. 2946–2954. [19] D. Kingma and M. Welling, "Auto-encoding variational Bayes," in Proc. ICLR, Banff, Australia, 2014. [20] M. Hoffman, "Stochastic variational inference," Journal of Ma- chine Learning Research, vol. 14, pp. 1303–1347, 2013. [21] F. Gr´ezl and M. Karafi´at, "Adapting multilingual neural network hierarchy to a new language," in Proc. SLTU, 2014, pp. 39–45. [22] B. Ludusan, M. Versteegh, A. Jansen, G. Gravier, X.-N. Cao, M. Johnson, and E. Dupoux, "Bridging the gap between speech technology and natural language processing: an evaluation tool- box for term discovery systems," in Proc. LREC, 2014. [23] A. Jansen and B. Van Durme, "Efficient spoken term discovery using randomized algorithms," in Proc. Automatic Speech Recog- nition and Understanding (IEEE ASRU), 2011, pp. 401–406. [24] L. Ondel, P. Godard, L. Besacier, E. Larsen, M. Hasegawa- Johnson, O. Scharenborg, E. Dupoux, L. Burget, F. Yvon, and S. Khudanpur, "Bayesian Models for Unit Discovery on a Very Low Resource Language," in Proc. ICASSP, Calgary, Alberta, Canada, 2018. [25] C.-y. Lee, T. J. O'Donnell, and J. Glass, "Unsupervised lexicon discovery from acoustic input," Transactions of the Association for Computational Linguistics, vol. 3, pp. 389–403, 2015. [26] C. Bartels, W. Wang, V. Mitra, C. Richey, A. Kathol, D. Vergyri, H. Bratt, and C. Hung, "Toward human-assisted lexical unit dis- covery without text resources," in Spoken Language Technology Workshop (IEEE SLT), 2016, pp. 64–70. [27] M. Elsner, S. Goldwater, N. Feldman, and F. Wood, "A joint learn- ing model of word segmentation, lexical acquisition, and phonetic variability," in Proc. EMNLP. Association for Computational Linguistics, 2013, pp. 42–54. [28] P. Godard, G. Adda, M. Adda-Decker, A. Allauzen, L. Besacier, H. Bonneau-Maynard, G.-N. Kouarata, K. Loser, A. Rialland, and F. Yvon, "Preliminary experiments on unsupervised word discov- ery in mboshi," in Proc. Interspeech, 2016. [29] S. Stuker, "Towards human translations guided language discov- ery for ASR systems," in Proc. SLTU, Hanoi, Vietnam, May 2008. [30] S. Stuker, L. Besacier, and A. Waibel, "Human Translations Guided Language Discovery for ASR Systems," in Proc. Inter- speech. Brighton (UK): Eurasip, 2009, pp. 1–4. [31] F. Stahlberg, T. Schlippe, S. Vogel, and T. Schultz, "Word seg- mentation through cross-lingual word-to-phoneme alignment." in Spoken Language Technology Workshop (IEEE SLT), 2012, pp. 85–90. [32] A. Anastasopoulos, S. Bansal, D. Chiang, S. Goldwater, and A. Lopez, "Spoken term discovery for language documentation using translations," in Proc. Workshop on Speech-Centric Natural Language Processing, 2017, pp. 53–58. 8. References [1] J. Glass, "Towards unsupervised speech processing," in Proc. IEEE-ISSPA, 2012, pp. 1–4. [2] A. Jansen, E. Dupoux, S. Goldwater, M. Johnson, S. Khudan- pur, K. Church, N. Feldman, H. Hermansky, F. Metze, R. Rose, M. Seltzer, P. Clark, I. McGraw, B. Varadarajan, E. Bennett, B. Borschinger, J. Chiu, E. Dunbar, A. Fourtassi, D. Harwath, C.-y. Lee, K. Levin, A. Norouzian, V. Peddinti, R. Richardson, T. Schatz, and S. Thomas, "A summary of the 2012 JH CLSP Workshop on zero resource speech technologies and models of early language acquisition," in Proc. ICASSP, 2013. [3] E. Dunbar, X. Nga-Cao, J. Benjumea, J. Karadayi, M. Bernard, L. Besacier, X. Anguera, and E. Dupoux, "The zero resource speech challenge 2017," in Proc. Automatic Speech Recognition and Understanding (IEEE ASRU), 2017. [4] L. Besacier, B. Zhou, and Y. Gao, "Towards speech translation of non-written languages," in Spoken Language Technology Work- shop, 2006. IEEE, 2006, pp. 222–225. [5] L. Duong, A. Anastasopoulos, D. Chiang, S. Bird, and T. Cohn, "An attentional model for speech translation without transcrip- tion," in Proc. NAACL-HLT, San Diego, CA, 2016, pp. 949–959. [6] E. Dupoux, "Cognitive science in the era of artificial intelligence: A roadmap for reverse-engineering the infant language-learner," Cognition, vol. 173, pp. 43–59, 2018. [7] G. Adda, S. Stuker, M. Adda-Decker, O. Ambouroue, L. Be- sacier, D. Blachon, H. Bonneau-Maynard, P. Godard, F. Ham- laoui, D. Idiatov, G.-N. Kouarata, L. Lamel, E.-M. Makasso, A. Rialland, M. V. de Velde, F. Yvon, and S. Zerbian, "Break- ing the unwritten language barrier: The BULB project," Procedia Computer Science, vol. 81, pp. 8–14, 2016. [8] D. Blachon, E. Gauthier, L. Besacier, G.-N. Kouarata, M. Adda- Decker, and A. Rialland, "Parallel speech collection for under- resourced language studies using the LIG-Aikuma mobile device app," Procedia Computer Science, vol. 81, pp. 61–66, 2016. [9] M. Zanon Boito, A. Berard, A. Villavicencio, and L. Besacier, "Unwritten languages demand attention too! Word discovery with encoder-decoder models," in Proc. Automatic Speech Recognition and Understanding (IEEE ASRU), 2017. [10] S. Goldwater, T. L. Griffiths, and M. Johnson, "A Bayesian frame- work for word segmentation: Exploring the effects of context," Cognition, vol. 112, no. 1, pp. 21–54, 2009. [11] A. B´erard, O. Pietquin, C. Servan, and L. Besacier, "Listen and translate: A proof of concept for end-to-end speech-to-text trans- lation," in NIPS workshop on End-to-end Learning for Speech and Audio Processing, 2016. [12] R. J. Weiss, J. Chorowski, N. Jaitly, Y. Wu, and Z. Chen, "Sequence-to-sequence models can directly transcribe foreign speech," arXiv preprint arXiv:1703.08581, 2017. [13] P. Godard, G. Adda, M. Adda-Decker, J. Benjumea, L. Besacier, J. Cooper-Leavitt, G. Kouarata, L. Lamel, H. Maynard, M. Muller, A. Rialland, S. Stuker, F. Yvon, and M. Z. Boito, "A Very Low Resource Language Speech Corpus for Computational Language Documentation Experiments," in Proc. LREC, Miyazaki, Japan, 2018. [14] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine transla- tion by jointly learning to align and translate," in Proc. ICLR, San Diego, CA, 2015. [15] L. Ondel, L. Burget, and J. Cernock`y, "Variational inference for acoustic unit discovery," Procedia Computer Science, vol. 81, pp. 80–86, 2016. [16] Y. W. Teh and M. I. Jordan, "Hierarchical Bayesian nonparametric models with applications," in Bayesian Nonparametrics: Princi- ples and Practice, N. Hjort, C. Holmes, P. Muller, and S. Walker, Eds. Cambridge University Press, 2010. [17] K. Kurihara, M. Welling, and Y. W. Teh, "Collapsed variational Dirichlet process mixture models," in Proc. IJCAI. Morgan Kauf- mann Publishers, 2007, pp. 2796–2801.
1910.04519
1
1910
2019-10-10T12:42:19
Language Transfer for Early Warning of Epidemics from Social Media
[ "cs.CL", "cs.AI", "cs.LG" ]
Statements on social media can be analysed to identify individuals who are experiencing red flag medical symptoms, allowing early detection of the spread of disease such as influenza. Since disease does not respect cultural borders and may spread between populations speaking different languages, we would like to build multilingual models. However, the data required to train models for every language may be difficult, expensive and time-consuming to obtain, particularly for low-resource languages. Taking Japanese as our target language, we explore methods by which data in one language might be used to build models for a different language. We evaluate strategies of training on machine translated data and of zero-shot transfer through the use of multilingual models. We find that the choice of source language impacts the performance, with Chinese-Japanese being a better language pair than English-Japanese. Training on machine translated data shows promise, especially when used in conjunction with a small amount of target language data.
cs.CL
cs
Language Transfer for Early Warning of Epidemics from Social Media Mattias Appelgren1, Patrick Schrempf1,2, Matúš Falis1, Satoshi Ikeda1, Alison Q. O'Neil1,3 1Canon Medical Research Europe, 2University of St Andrews, 3University of Edinburgh {mattias.appelgren, patrick.schrempf, matus.falis}@eu.medical.canon {satoshi.ikeda, alison.oneil}@eu.medical.canon Abstract Statements on social media can be analysed to identify individuals who are experi- encing red flag medical symptoms, allowing early detection of the spread of disease such as influenza. Since disease does not respect cultural borders and may spread between populations speaking different languages, we would like to build multilin- gual models. However, the data required to train models for every language may be difficult, expensive and time-consuming to obtain, particularly for low-resource languages. Taking Japanese as our target language, we explore methods by which data in one language might be used to build models for a different language. We evaluate strategies of training on machine translated data and of zero-shot transfer through the use of multilingual models. We find that the choice of source language impacts the performance, with Chinese-Japanese being a better language pair than English-Japanese. Training on machine translated data shows promise, especially when used in conjunction with a small amount of target language data. 1 Introduction The spread of influenza is a major health concern. Without appropriate preventative measures, this can escalate to an epidemic, causing high levels of mortality. A potential route to early detection is to analyse statements on social media platforms to identify individuals who have reported experiencing symptoms of the illness. These numbers can be used as a proxy to monitor the spread of the virus. Since disease does not respect cultural borders and may spread between populations speaking different languages, we would like to build models for several languages without going through the difficult, expensive and time-consuming process of generating task-specific labelled data for each language. In this paper we explore ways of taking data and models generated in one language and transferring to other languages for which there is little or no data. 2 Related Work Previously, authors have created multilingual models which should allow transfer between languages by aligning models [van der Plas and Tiedemann, 2006] or embedding spaces [Johnson et al., 2019, Alaux et al., 2019]. An alternative is translation of a high-resource language into the target low- resource language; for instance, [Chaudhary et al., 2019] combined translation with subsequent selective correction by active learning of uncertain words and phrases believed to describe entities, to create a labelled dataset for named entity recognition. 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada. 3 MedWeb Dataset We use the MedWeb ("Medical Natural Language Processing for Web Document") dataset [Wakamiya et al., 2017] that was provided as part of a subtask at the NTCIR-13 Conference [Kato and Liu, 2017]. The data is summarised in Table 1. There are a total of 2,560 pseudo-tweets in three different languages: Japanese (ja), English (en) and Chinese (zh). These were created in Japanese and then manually translated into English and Chinese (see Figure 1). Each pseudo-tweet is labelled with a subset of the following 8 labels: influenza, diarrhoea/stomach ache, hay fever, cough/sore throat, headache, fever, runny nose, and cold. A positive label is assigned if the author (or someone they live with) has the symptom in question. As such it is more than a named entity recognition task, as can be seen in pseudo-tweet #3 in Figure 1 where the term "flu" is mentioned but the label is negative. s t e e w T - o d u e s P Dataset # 1,920 Training 640 Test (ja) (en) (zh) (ja) (en) (zh) (ja) (en) (zh) Table 1: MedWeb dataset overview statistics. h t i e l p m a x e s l e b a l # n a e M 0.997 0.933 r e p a z n e u fl n I 106 24 a e o h r r a i D 182 64 r e v e f y a H 163 46 h g u o C 227 80 e h c a d a e H 251 77 r e v e F 345 93 e s o n y n n u R 375 123 d l o C 265 90 Pseudo-tweet bZఔİ௼ᐰİ௴ĴİIJĴ஺ The cold makes my whole body weak. ɣᑈ⏚Aȑ஺ s l e b a l o n w s e l p m a x E # 530 195 Labels Cold ௼RKİ[IJ௷௺௸఑௤ Hay fever It's really bad. My eczema and allergies are acting up at the same time. & ʎK4RK5஺ Runny nose AIJɰ⊕௲ఋIJ௤ı௴IJIJIJIJĴ I'm so scared of today's flu shot, and it's not even surgery or anything. No labels ᜩ5ᡭǹɣɰʖ᝿஺ Figure 1: Example pseudo-tweet triplets. 4 Methods Bidirectional Encoder Representations from Transformers (BERT): The BERT model [Devlin et al., 2018] base version is a 12-layer Transformer model trained on two self-supervised tasks using a large corpus of text. In the first (denoising autoencoding) task, the model must map input sentences with some words replaced with a special "MASK" token back to the original unmasked sentences. In the second (binary classification) task, the model is given two sentences and must predict whether or not the second sentence immediately follows the first in the corpus. The output of the final Transformer layer is passed through a logistic output layer for classification. We have used the original (English) BERT-base1, trained on Wikipedia and books corpus [Zhu et al., 2015], and a Japanese BERT (jBERT) [Kikuta, 2019] trained on Japanese Wikipedia. The original BERT model and jBERT use a standard sentence piece tokeniser with roughly 30,000 tokens. 1PyTorch code and pre-trained models for BERT: https://github.com/huggingface/transformers 2 Multilingual BERT: Multilingual BERT (mBERT)2 is a BERT model simultaneously trained on Wikipedia in 100 different languages. It makes use of a shared sentence piece tokeniser with roughly 100,000 tokens trained on the same data. This model provides state-of-the-art zero-shot transfer results on natural language inference and part-of-speech tagging tasks [Pires et al., 2019]. Translation: We use two publicly available machine translation systems to provide two possible translations for each original sentence: Google's neural translation system [Wu et al., 2016] via Google Cloud3, and Amazon Translate4. We experiment using the translations singly and together. Training procedure: Models are trained for 20 epochs, using the Adam optimiser [Kingma and Ba, 2014] and a cyclical learning rate [Smith, 2017] varied linearly between 5 × 10−6 and 3 × 10−5. 5 Experiments Using the multilingual BERT model, we run three experiments as described below. The "exact match" metric from the original MedWeb challenge is reported, which means that all labels must be predicted correctly for a given pseudo-tweet to be considered correct; macro-averaged F1 is also reported. Each experiment is run 5 times (with different random seeds) and the mean performance is shown in Table 2. Our experiments are focused around using Japanese as the low-resource target language, with English and Chinese as the more readily available source languages. Source Train - - EN JA ZH EN JA ZH Test Exact Match Accuracy Table 2: Overall results, given as mean (standard deviation) of 5 runs, for different training/test data pairs. The leading results on the original challenge are shown as baselines for benchmarking purposes. EN - English, JA - Japanese, ZH - Chinese, TJA - Translated Japanese. Model Baselines Majority class classifier Random classifier Iso et al. [2017] Iso et al. [2017] Iso et al. [2017] BERT jBERT mBERT Zero-shot transfer mBERT mBERT Machine translation mBERT mBERT mBERT mBERT 0.305 0.130 (0.012) 0.795 0.825 0.809 0.847 (0.003) 0.843 (0.012) 0.835 (0.004) 0.740 (0.011) 0.774 (0.008) 0.754 (0.009) 0.804 (0.004) 0.740 (0.012) 0.821 (0.010) 0.758 (0.034) 0.849 (0.098) 0.884 (0.004) 0.880 (0.006) 0.876 (0.006) - - EN JA ZH EN JA ZH 0.305 (0.001) 0.507 (0.007) EN ZH TJA TJA TJA (x2) TJA (x2) JA JA JA JA JA JA - - - - - - - - - - EN ZH EN ZH 0.484 (0.032) F1 macro 0.118 (0.007) - - - - - 2Multilingual BERT Models: https://github.com/google-research/bert/blob/master/multilingual.md 3Cloud Translation Google Cloud: https://cloud.google.com/translate/ 4Amazon Translate: Neural Machine Translation: https://aws.amazon.com/translate/ 3 5.1 Baselines To establish a target for our transfer techniques we train and test models on a single language, i.e. English to English, Japanese to Japanese, and Chinese to Chinese. For English we use the uncased base-BERT, for Japanese we use jBERT, and for Chinese we use mBERT (since there is no Chinese- specific model available in the public domain). This last choice seems reasonable since mBERT performed similarly to the single-language models when trained and tested on the same language. For comparison, we show the results of Iso et al. [2017] who created the most successful model for the MedWeb challenge. Their final system was an ensemble of 120 trained models, using two architectures: a hierarchical attention network and a convolutional neural network. They exploited the fact that parallel data is available in three languages by ensuring consistency between outputs of the models in each language, giving a final exact match score of 0.880. However, for the purpose of demonstrating language transfer we report their highest single-model scores to show that our single-language models are competitive with the released results. We also show results for a majority class classifier (predicting all negative labels, see Table 1) and a random classifier that uses the label frequencies from the training set to randomly predict labels. 5.2 Zero-shot transfer with multilingual pre-training Our first experiment investigates the zero-shot transfer ability of multilingual BERT. If mBERT has learned a shared embedding space for all languages, we would expect that if the model is fine-tuned on the English training dataset, then it should be applicable also to the Japanese dataset. To test this we have run this with both the English and Chinese training data, results are shown in Table 2. We ran additional experiments where we froze layers within BERT, but observed no improvement. The results indicate poor transfer, especially between English and Japanese. To investigate why the model does not perform well, we visualise the output vectors of mBERT using t-SNE [Maaten and Hinton, 2008] in Figure 2. We can see that the language representations occupy separate parts of the representation space, with only small amounts of overlap. Further, no clear correlation can be observed between sentence pairs. Figure 2: Max-pooled output of mBERT final layer (before fine tuning), reduced using principal component analysis (to reduce from 768 to 50 dimensions) followed by t-SNE (to project into 2 dimensions). 20 sentence triplets are linked to give an idea of the mapping between languages. The better transfer between Chinese and Japanese likely reflects the fact that these languages share tokens; one of the Japanese alphabets (the Kanji logographic alphabet) consists of Chinese characters. There is 21% vocabulary overlap for the training data and 19% for the test data, whereas there is no token overlap between English and Japanese. Our finding is consistent with previous claims that token overlap impacts mBERT's transfer capability [Pires et al., 2019]. 4 Zh-Ja PairsEn-Ja PairsEnglishJapaneseChinese 5.3 Training on machine translated data Our second experiment investigates the use of machine translated data for training a model. We train on the machine translated source data and test on the target test set. Results are shown in Table 2. Augmenting the data by using two sets of translations rather than one proves beneficial. In the end, the difference between training on real Japanese and training on translations from English is around 9% while training on translations from Chinese is around 4%. 5.4 Mixing translated data with original data Whilst the results for translated data are promising, we would like to bridge the gap to the performance of the original target data. Our premise is that we start with a fixed-size dataset in the source language, and we have a limited annotation budget to manually translate a proportion of this data into the target language. For this experiment we mix all the translated data with different portions of original Japanese data, varying the amount between 1% and 100%. The results of these experiments are shown in Figure 3. Using the translated data with just 10% of the original Japanese data, we close the gap by half, with 50% we match the single-language model, and with 100% appear to even achieve a small improvement (for English), likely through the data augmentation provided by the translations. Figure 3: Exact match accuracy when training on different proportions of the original Japanese training set, with or without either the original English data or the translated data. The pink and orange dashed lines show the accuracy of the full set of translated Japanese data (from English and Chinese respectively) and the blue dashed line shows the accuracy of the full original Japanese data. 6 Discussion and Conclusions Zero-shot transfer using multilingual BERT performs poorly when transferring to Japanese on the MedWeb data. However, training on machine translations gives promising performance, and this performance can be increased by adding small amounts of original target data. On inspection, the drop in performance between translated and original Japanese was often a result of translations that were reasonable but not consistent with the labels. For example, when translating the first example in Figure 1, both machine translations map "bZ", which means cold (the illness), into "௯", which means cold (low temperature). Another example is where the Japanese pseudo-tweet "RKIJ ᧲ʟIJ௳௮௤KĴĴ஺" was provided alongside an English pseudo-tweet "Allergy season is so exhausting.". Here, the Japanese word for hay fever "RK஺" has been manually mapped to the less specific word "allergies" in English; the machine translation maps back to Japanese using the word for "allergies" i.e. "" in the katakana alphabet (katakana is used to express words derived from foreign languages), since there is no kanji character for the concept of allergies. In future work, it would be interesting to understand how to detect such ambiguities in order to best deploy our annotation budget. 5 0102030405060708090100Original Japanese (%)0.30.40.50.60.70.8Exact Match ScoreOnly 100% Original JapaneseOnly 100% Chinese TranslationsOnly 100% English Translationsx% Original Japanesex% Original Japanese + 100% Original Englishx% Original Japanese + 100% Chinese Translationsx% Original Japanese + 100% English Translations References Jean Alaux, Edouard Grave, Marco Cuturi, and Armand Joulin. Unsupervised hyper-alignment for multilingual word embeddings. In International Conference on Learning Representations, 2019. Aditi Chaudhary, Jiateng Xie, Zaid Sheikh, Graham Neubig, and Jaime G Carbonell. A little annotation does a lot of good: A study in bootstrapping low-resource named entity recognizers. arXiv preprint arXiv:1908.08983, 2019. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. Hayate Iso, Camille Ruiz, Taichi Murayama, Katsuya Taguchi, Ryo Takeuchi, Hideya Yamamoto, Shoko Wakamiya, and Eiji Aramaki. Ntcir13 medweb task: Multi-label classification of tweets using an ensemble of neural networks. In Proceedings of the NTCIR-13 Conference, 2017. Andrew Johnson, Penny Karanasou, Judith Gaspers, and Dietrich Klakow. Cross-lingual transfer learning for Japanese named entity recognition. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Industry Papers), 2019. Makoto P Kato and Yiqun Liu. Overview of ntcir-13. In Proceedings of the NTCIR-13 Conference, 2017. Yohei Kikuta. Bert pretrained model trained on japanese wikipedia articles. https://github.com/ yoheikikuta/bert-japanese, 2019. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579 -- 2605, 2008. Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual bert? CoRR, abs/1906.01502, 2019. URL http://arxiv.org/abs/1906.01502. Leslie N Smith. Cyclical learning rates for training neural networks. In 2017 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 464 -- 472. IEEE, 2017. Lonneke van der Plas and Jörg Tiedemann. Finding synonyms using automatic word alignment and measures of distributional similarity. In Proceedings of the COLING/ACL on Main Conference Poster Sessions, COLING-ACL '06, Stroudsburg, PA, USA, 2006. Association for Computational Linguistics. Shoko Wakamiya, Mizuki Morita, Yoshinobu Kano, Tomoko Ohkuma, and Eiji Aramaki. Overview of the ntcir-13: Medweb task. In Proceedings of the NTCIR-13 Conference, 2017. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google's neural machine translation sys- tem: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pages 19 -- 27, 2015. 6
1906.05381
2
1906
2019-10-08T22:03:19
Compositional generalization through meta sequence-to-sequence learning
[ "cs.CL", "cs.AI", "cs.LG" ]
People can learn a new concept and use it compositionally, understanding how to "blicket twice" after learning how to "blicket." In contrast, powerful sequence-to-sequence (seq2seq) neural networks fail such tests of compositionality, especially when composing new concepts together with existing concepts. In this paper, I show how memory-augmented neural networks can be trained to generalize compositionally through meta seq2seq learning. In this approach, models train on a series of seq2seq problems to acquire the compositional skills needed to solve new seq2seq problems. Meta se2seq learning solves several of the SCAN tests for compositional learning and can learn to apply implicit rules to variables.
cs.CL
cs
Compositional generalization through meta sequence-to-sequence learning Brenden M. Lake New York University Facebook AI Reasearch [email protected] Abstract People can learn a new concept and use it compositionally, understanding how to "blicket twice" after learning how to "blicket." In contrast, powerful sequence-to- sequence (seq2seq) neural networks fail such tests of compositionality, especially when composing new concepts together with existing concepts. In this paper, I show how memory-augmented neural networks can be trained to generalize compositionally through meta seq2seq learning. In this approach, models train on a series of seq2seq problems to acquire the compositional skills needed to solve new seq2seq problems. Meta se2seq learning solves several of the SCAN tests for compositional learning and can learn to apply implicit rules to variables. 1 Introduction People can learn new words and use them immediately in a rich variety of ways, thanks to their skills in compositional learning. Once a person learns the meaning of the verb "to Facebook", she or he can understand how to "Facebook slowly," "Facebook eagerly," or "Facebook while walking." These abilities are due to systematic compositionality, or the algebraic capacity to understand and produce novel utterances by combining familiar primitives [5, 27]. The "Facebook slowly" example depends on knowledge of English, yet the ability is more general; people can also generalize compositionally when learning to follow instructions in artificial languages [18]. Despite its importance, systematic compositionality has unclear origins, including the extent to which it is inbuilt versus learned. A key challenge for cognitive science and artificial intelligence is to understand the computational underpinnings of human compositional learning and to build machines with similar capabilities. Neural networks have long been criticized for lacking compositionality, leading critics to argue they are inappropriate for modeling language and thought [8, 24, 25]. Nonetheless neural architectures have advanced and made important contributions in natural language processing (NLP) [20]. Recent work has revisited these classic critiques through studies of modern neural architectures [10, 16, 3, 21, 23, 2, 6], with a focus on the sequence-to-sequence (seq2seq) models used successfully in machine translation and other NLP tasks [34, 4, 38]. These studies show that powerful seq2seq approaches still have substantial difficulties with compositional generalization, especially when combining a new concept ("to Facebook") with previous concepts ("slowly" or "eagerly") [16, 3, 21]. New benchmarks have been proposed to encourage progress [10, 16, 2], including the SCAN dataset for compositional learning [16]. SCAN involves learning to follow instructions such as "walk twice and look right" by performing a sequence of appropriate output actions; in this case, the correct response is to "WALK WALK RTURN LOOK." A range of SCAN examples are shown in Table 1. Seq2seq models are trained on thousands of instructions built compositionally from primitives ("look", "walk", "run", "jump", etc.), modifiers ("twice", "around right," etc.) and conjunctions ("and" and "after"). After training, the aim is to execute, zero-shot, novel instructions such as "walk around right after look twice." Previous studies show that seq2seq recurrent neural networks 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada. (RNN) generalize well when the training and test sets are similar, but fail catastrophically when generalization requires systematic compositionality [16, 3, 21]. For instance, models often fail to understand how to "jump twice" after learning how to "run twice," "walk twice," and how to "jump." Building neural architectures with these compositional abilities remains an open problem. In this paper, I show how memory-augmented neural networks can be trained to generalize composi- tionally through "meta sequence-to-sequence learning" (meta seq2seq learning). As is standard with meta learning, training is distributed across a series of small datasets called "episodes" instead of a single static dataset [36, 32, 7], in a process called "meta-training." Specific to meta seq2seq learning, each episode is a novel seq2seq problem that provides "support" sequence pairs (input and output) and "query" sequences (input only), as shown in Figures 1 and 2. The network loads the support sequence pairs into an external memory [33, 11, 31] to provide needed context for producing the right output sequence for each query sequence. The network's output sequences are compared to the targets, demonstrating how to generalize compositionally from the support items to the query items. Meta seq2seq networks meta-train on multiple seq2seq problems that require compositional gener- alization, with the aim of acquiring the compositional skills needed to solve new problems. New seq2seq problems are solved entirely using the activation dynamics and external memory of the networks; no weight updates are made after the meta-training phase ceases. Through its unique choice of architecture and training procedure, the network can implicitly learn rules that operate on variables, an ability considered beyond the reach of eliminative connectionist networks [24, 25, 23] but which has been pursued by more structured alternatives [33, 11, 12, 28]. In the sections below, I show how meta seq2seq learning can solve several challenging SCAN tasks for compositional learning, although generalizing to longer output sequences remains unsolved. 2 Related work Meta sequence-to-sequence learning builds on several areas of active research. Meta learning has been successfully applied to few-shot image classification [36, 32, 7, 19] including sequential versions that require external memory [31]. Few-shot visual tasks are qualitatively different from the compositional reasoning tasks studied here, which demand different architectures and learning principles. Closer to the present work, meta learning has been recently applied to low resource machine translation [13], demonstrating one application of meta learning to seq2seq translation problems. Crucially, these networks tackle a new task through weight updates rather than through memory and reasoning [7], and it is unclear whether this approach would work for compositional reasoning. External memories have also expanded the capabilities of modern neural network architectures. Memory networks have been applied to reasoning and question answering tasks [33], in cases where only a single output is needed instead of a series of outputs. The Differentiable Neural Computer (DNC) [11] is also related to my proposal, in that a single architecture can reason through a wide range of scenarios, including seq2seq-like graph traversal tasks. The DNC is a complex architecture with multiple heads for reading and writing to memory, temporal links between memory cells, and trackers to monitor memory usage. In contrast, the meta seq2seq learner uses a simple memory mechanism akin to memory networks [33] and does not call the memory module with every new input symbol. Meta seq2seq uses higher-level abstractions to store and reason with entire sequences. There has been recent progress on SCAN due to clever data augmentation [1] and syntax-based attention [30], although both approaches are currently limited in scope. For instance, syntactic attention relies on a symbol-to-symbol mapping module that may be inappropriate for many domains. Meta seq2seq is compared against syntactic attention [30] in the experiments that follow. 3 Model The meta sequence-to-sequence approach learns how to learn sequence-to-sequence (seq2seq) problems -- it uses a series of training seq2seq problems to develop the needed compositional skills for solving new seq2seq problems. An overview of the meta seq2seq learner is illustrated in Figure 1. In this figure, the network is processing a query instruction "jump twice" in the context of a support set that shows how to "run twice," "walk twice", "look twice," and "jump." In broad strokes, the architecture is a standard seq2seq model [22] translating a query input into a query output (Figure 1). A recurrent neural network (RNN) encoder (fie; red RNN in bottom right of Figure 1) and a RNN 2 Figure 1: The meta sequence-to-sequence learner. The backbone is a sequence-to-sequence (seq2seq) network augmented with a context C produced by an external memory. The seq2seq model uses an RNN encoder (fie; bottom right) to read a query and then pass stepwise messages Q to an attention-based RNN decoder (fod; top right). Distinctive to meta seq2seq learning, the messages Q are transformed into C based on context from the support set (left). The transformation operates through a key-value memory. Support item inputs are encoded and used a keys K while outputs are encoded and used as value V . The query is stepwise compared to the keys, retrieving weighted sums M of the most similar values. This is mapped to C which is decoded as the final output sequence. Color coding indicates shared RNN modules. decoder (fod; green RNN in top right of Figure 1) work together to interpret the query sequence as an output sequence, with the encoder passing an embedding at each timestep (Q) to a Luong attention decoder [22]. The architecture differs from standard seq2seq modeling through its use of the support set, external memory, and training procedure. As the messages pass from the query encoder to the query decoder, they are infused with stepwise context C provided by an external memory that stores the support items. The inner-working of the architecture are described in detail below. Input encoder. The input encoder fie(·,·) (Figure 1 red) encodes the query input instruction (e.g., "jump twice') and each of the input instructions for the ns support items ("run twice", "walk twice", "jump", etc.). The encoder first embeds the sequence of symbols (e.g., words) to get a sequence of input embeddings wt ∈ Rm, which the RNN transforms into hidden embeddings ht ∈ Rm, ht = fie(ht−1, wt). (1) For the query sequence, the embedding ht at each step t = 1, . . . , T passes both through the external memory as well as directly to the decoder. For each support sequence, only the last step hidden embedding is needed, denoted Ki ∈ Rm for i = 1, . . . , ns. These vectors Ki become the keys in the external key-value memory (Figure 1). Although other choices are possible, this paper uses bidirectional long short-term memory encoders (biLSTM) [14]. Output encoder. The output encoder foe(·,·) (Figure 1 blue) is used for each of the of ns support items and their output sequences (e.g., "RUN RUN", "WALK WALK", "JUMP", etc.). First, the encoder embeds the sequence of output symbols (e.g., actions) using an embedding layer. Second, a single embedding for the entire sequence is computed using the same process as fie(·,·) (Equation 1). Only the final RNN state is captured for each support item i and stored as the value vector Vi ∈ Rm for i = 1, . . . , ns in the key-value memory. A biLSTM encoder is also used. External memory. The architecture uses a soft key-value memory similar to memory networks [33]. The precise formulation used is described in [35]. The key-value memory uses the attention function Attention(Q, K, V ) = softmax( QK T√ m )V = AV, (2) with matrices Q, K, and V for the queries, keys, and values respectively, and the matrix A as the attention weights, A = softmax(QK T / m). Each query instruction spawns T embeddings √ 3 RUN RUNWALK WALKJUMPLOOK LOOKValues<SOS><EOS>jumptwiceQueryinputjumplook twicewalk twicerun twiceJUMPLOOK LOOKWALK WALKRUN RUNJUMPJUMPJUMPJUMP{QueryoutputC<latexit sha1_base64="re76Zkt0iSC9uIARbCEdpPGTKdg=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI9ELh4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfj2txvP6HSPJYPZpKgH9Gh5CFn1FipUesXS27ZXYCsEy8jJchQ7xe/eoOYpRFKwwTVuuu5ifGnVBnOBM4KvVRjQtmYDrFrqaQRan+6OHRGLqwyIGGsbElDFurviSmNtJ5Ege2MqBnpVW8u/ud1UxPe+lMuk9SgZMtFYSqIicn8azLgCpkRE0soU9zeStiIKsqMzaZgQ/BWX14nrUrZuypXGtel6l0WRx7O4BwuwYMbqMI91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AJczjMs=</latexit>fod<latexit sha1_base64="U+MGEJTWXgkmGOC1uR9RF8rSuPc=">AAAB7XicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48V7Ae0oWw2m3btZjfsboQS+h+8eFDEq//Hm//GbZqDtj4YeLw3w8y8IOFMG9f9dkpr6xubW+Xtys7u3v5B9fCoo2WqCG0TyaXqBVhTzgRtG2Y47SWK4jjgtBtMbud+94kqzaR4MNOE+jEeCRYxgo2VOtEwk+FsWK25dTcHWiVeQWpQoDWsfg1CSdKYCkM41rrvuYnxM6wMI5zOKoNU0wSTCR7RvqUCx1T7WX7tDJ1ZJUSRVLaEQbn6eyLDsdbTOLCdMTZjvezNxf+8fmqiaz9jIkkNFWSxKEo5MhLNX0chU5QYPrUEE8XsrYiMscLE2IAqNgRv+eVV0mnUvYt64/6y1rwp4ijDCZzCOXhwBU24gxa0gcAjPMMrvDnSeXHenY9Fa8kpZo7hD5zPH9LYj0o=</latexit>foe<latexit sha1_base64="o21l2pT8fpQBg/PLx9uOyPQxGKk=">AAAB7XicbVBNS8NAEJ3Ur1q/qh69BIvgqSRV0GPRi8cK9gPaUDbbSbt2sxt2N0IJ/Q9ePCji1f/jzX/jts1BWx8MPN6bYWZemHCmjed9O4W19Y3NreJ2aWd3b/+gfHjU0jJVFJtUcqk6IdHImcCmYYZjJ1FI4pBjOxzfzvz2EyrNpHgwkwSDmAwFixglxkqtqJ9JnPbLFa/qzeGuEj8nFcjR6Je/egNJ0xiFoZxo3fW9xAQZUYZRjtNSL9WYEDomQ+xaKkiMOsjm107dM6sM3EgqW8K4c/X3REZirSdxaDtjYkZ62ZuJ/3nd1ETXQcZEkhoUdLEoSrlrpDt73R0whdTwiSWEKmZvdemIKEKNDahkQ/CXX14lrVrVv6jW7i8r9Zs8jiKcwCmcgw9XUIc7aEATKDzCM7zCmyOdF+fd+Vi0Fpx85hj+wPn8AdRdj0s=</latexit>fie<latexit sha1_base64="ZPEAacR//NePNU2YWdbglbCf2hk=">AAAB7XicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48V7Ae0oWy2k3btZhN2N0IJ/Q9ePCji1f/jzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU0nGqGDZZLGLVCahGwSU2DTcCO4lCGgUC28H4dua3n1BpHssHM0nQj+hQ8pAzaqzUCvsZx2m/XHGr7hxklXg5qUCORr/81RvELI1QGiao1l3PTYyfUWU4Ezgt9VKNCWVjOsSupZJGqP1sfu2UnFllQMJY2ZKGzNXfExmNtJ5Ege2MqBnpZW8m/ud1UxNe+xmXSWpQssWiMBXExGT2OhlwhcyIiSWUKW5vJWxEFWXGBlSyIXjLL6+SVq3qXVRr95eV+k0eRxFO4BTOwYMrqMMdNKAJDB7hGV7hzYmdF+fd+Vi0Fpx85hj+wPn8Acs5j0U=</latexit>V<latexit sha1_base64="ZHTJuVrsXJ8Nz2mGcO2drL0vXec=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlZrtfrrhVdw6ySrycVCBHo1/+6g1ilkYoDRNU667nJsbPqDKcCZyWeqnGhLIxHWLXUkkj1H42P3RKzqwyIGGsbElD5urviYxGWk+iwHZG1Iz0sjcT//O6qQmv/YzLJDUo2WJRmApiYjL7mgy4QmbExBLKFLe3EjaiijJjsynZELzll1dJu1b1Lqq15mWlfpPHUYQTOIVz8OAK6nAHDWgBA4RneIU359F5cd6dj0VrwclnjuEPnM8fs/+M3g==</latexit>M<latexit sha1_base64="LYKb6VVKloxBSLpM78v6ttRQbOI=">AAAB6HicbVDLSgNBEOyNrxhfUY9eBoPgKexGQY9BL16EBMwDkiXMTnqTMbOzy8ysEEK+wIsHRbz6Sd78GyfJHjSxoKGo6qa7K0gE18Z1v53c2vrG5lZ+u7Czu7d/UDw8auo4VQwbLBaxagdUo+ASG4Ybge1EIY0Cga1gdDvzW0+oNI/lgxkn6Ed0IHnIGTVWqt/3iiW37M5BVomXkRJkqPWKX91+zNIIpWGCat3x3MT4E6oMZwKnhW6qMaFsRAfYsVTSCLU/mR86JWdW6ZMwVrakIXP198SERlqPo8B2RtQM9bI3E//zOqkJr/0Jl0lqULLFojAVxMRk9jXpc4XMiLEllClubyVsSBVlxmZTsCF4yy+vkmal7F2UK/XLUvUmiyMPJ3AK5+DBFVThDmrQAAYIz/AKb86j8+K8Ox+L1pyTzRzDHzifP6ZbjNU=</latexit>KeysK<latexit sha1_base64="HQfadDQrozr2PpvG928HQmjcOjI=">AAAB6HicbVDLSgNBEOyNrxhfUY9eBoPgKexGQY9BL4KXBMwDkiXMTnqTMbOzy8ysEEK+wIsHRbz6Sd78GyfJHjSxoKGo6qa7K0gE18Z1v53c2vrG5lZ+u7Czu7d/UDw8auo4VQwbLBaxagdUo+ASG4Ybge1EIY0Cga1gdDvzW0+oNI/lgxkn6Ed0IHnIGTVWqt/3iiW37M5BVomXkRJkqPWKX91+zNIIpWGCat3x3MT4E6oMZwKnhW6qMaFsRAfYsVTSCLU/mR86JWdW6ZMwVrakIXP198SERlqPo8B2RtQM9bI3E//zOqkJr/0Jl0lqULLFojAVxMRk9jXpc4XMiLEllClubyVsSBVlxmZTsCF4yy+vkmal7F2UK/XLUvUmiyMPJ3AK5+DBFVThDmrQAAYIz/AKb86j8+K8Ox+L1pyTzRzDHzifP6NTjNM=</latexit>run twicewalk twicejumplook twicefie<latexit sha1_base64="ZPEAacR//NePNU2YWdbglbCf2hk=">AAAB7XicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48V7Ae0oWy2k3btZhN2N0IJ/Q9ePCji1f/jzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU0nGqGDZZLGLVCahGwSU2DTcCO4lCGgUC28H4dua3n1BpHssHM0nQj+hQ8pAzaqzUCvsZx2m/XHGr7hxklXg5qUCORr/81RvELI1QGiao1l3PTYyfUWU4Ezgt9VKNCWVjOsSupZJGqP1sfu2UnFllQMJY2ZKGzNXfExmNtJ5Ege2MqBnpZW8m/ud1UxNe+xmXSWpQssWiMBXExGT2OhlwhcyIiSWUKW5vJWxEFWXGBlSyIXjLL6+SVq3qXVRr95eV+k0eRxFO4BTOwYMrqMMdNKAJDB7hGV7hzYmdF+fd+Vi0Fpx85hj+wPn8Acs5j0U=</latexit>SupportoutputSupportinput{Q<latexit sha1_base64="TIwmk8u21VOUoY7U7p41qYBa1Ac=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mqoMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlZrNfrrhVdw6ySrycVCBHo1/+6g1ilkYoDRNU667nJsbPqDKcCZyWeqnGhLIxHWLXUkkj1H42P3RKzqwyIGGsbElD5urviYxGWk+iwHZG1Iz0sjcT//O6qQmv/YzLJDUo2WJRmApiYjL7mgy4QmbExBLKFLe3EjaiijJjsynZELzll1dJu1b1Lqq15mWlfpPHUYQTOIVz8OAK6nAHDWgBA4RneIU359F5cd6dj0VrwclnjuEPnM8frGuM2Q==</latexit>A<latexit sha1_base64="Lihtv2jYSe0RaYbwwPdS8141boc=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHbRRI+oF4+QyCOBDZkdemFkdnYzM2tCCF/gxYPGePWTvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCoqeNUMWywWMSqHVCNgktsGG4EthOFNAoEtoLR3cxvPaHSPJYPZpygH9GB5CFn1FipftMrltyyOwdZJV5GSpCh1it+dfsxSyOUhgmqdcdzE+NPqDKcCZwWuqnGhLIRHWDHUkkj1P5kfuiUnFmlT8JY2ZKGzNXfExMaaT2OAtsZUTPUy95M/M/rpCa89idcJqlByRaLwlQQE5PZ16TPFTIjxpZQpri9lbAhVZQZm03BhuAtv7xKmpWyd1Gu1C9L1dssjjycwCmcgwdXUIV7qEEDGCA8wyu8OY/Oi/PufCxac042cwx/4Hz+AJQrjMk=</latexit> from the RNN encoder, one for each query symbol, which populate the rows of the query matrix Q ∈ RT,m. The encoded support items form the rows of K ∈ Rns,m and the rows of V ∈ Rns,m for their input and output sequences, respectively. Attention weights A ∈ RT,ns indicate which memory cells are active for each query step. The output of the memory is a matrix M = AV where each row is a weighted combination of the value vectors, indicating the memory output for each of the T query input steps, M ∈ RT,m. Finally, a stepwise context is computed by combining the query input embeddings ht and the stepwise memory outputs Mt ∈ Rm with a concatenation layer Ct = tanh(Wc1[ht; Mt]) producing a stepwise context matrix C ∈ RT,m. For additional representational power, the key-value memory could replace the simple attention module with a multi-head attention module, or even a transformer-style multi-layer multi-head attention module [35]. This additional power was not needed for the tasks tackled in this paper, but it is compatible with the meta seq2seq approach. Output decoder. The output decoder translates the stepwise context C into an output sequence (Figure 1 green). The decoder embeds the previous output symbol as vector oj−1 ∈ Rm which is fed to the RNN (LSTM) along with the previous hidden state gj−1 ∈ Rm to get the next hidden state, (3) The initial hidden state g0 is set as the context from the last step CT ∈ Rm. Luong-style attention [22] is used to compute a decoder context uj ∈ Rm such that uj = Attention(gj, C, C). This context softmax output layer to produce an output symbol. This process repeats until all of the output symbols are produced and the RNN terminates the response by producing an end-of-sequence symbol. Meta-training. Meta-training optimizes the network across a series of training episodes, each of which is a novel seq2seq problem with ns support items and nq query items (see example in Figure 2). The model's vocabulary is the union of the episode vocabularies, and the loss function is the negative log-likelihood of the predicted output sequences for the queries. My implementation uses each episode as a training batch and takes one gradient step per episode. For improved sample and training efficiency, the optimizer could take multiple steps per episode or replay past episodes, although this was not explored here. During meta-training, the network may need extra encouragement to use its memory. To provide this, the support items are passed through the network as additional query items, i.e. using an auxiliary "support loss" that is added to the query loss computed from the query items. The support items have already been observed and stored in memory, and thus it is not noteworthy that the network learns to reconstruct these output sequences. Nevertheless, it amplifies the memory during meta-training. is passed through another concatenation layer (cid:101)gj = tanh(Wc2 [gj; uj]) which is then mapped to a gj = fod(gj−1, oj−1). 4 Experiments 4.1 Architecture and training parameters A PyTorch implementation is available (see acknowledgements). All experiments use the same hyperparameters, and many were set according to the best-performing seq2seq model in [16]. The input and output sequence encoders are two-layer biLSTMs with m = 200 hidden units per layer, producing m dimensional embeddings. The output decoder is a two-layer LSTM also with m = 200. Dropout is applied with probability 0.5 to each LSTM and symbol embedding. A greedy decoder is effective due to SCAN's determinism [16]. Networks are meta-trained for 10,000 episodes with the ADAM optimizer [15]. The learning rate is reduced from 0.001 to 0.0001 halfway, and gradients with a l2-norm greater than 50 are clipped. With my PyTorch implementation, it takes less than 1 hour to train meta seq2seq on SCAN using one NVIDIA Titan X GPU (regular seq2seq trains in less than 30 minutes). All models were trained five times with different random initializations and random meta-training episodes. 4.2 Experiment: Mutual exclusivity This experiment evaluates meta seq2seq learning on a synthetic task borrowed from developmental psychology (Figure 2). Each episode introduces a new mapping from non-sense words ("dax", "wif", etc.) to non-sense meanings ("red circle", "green circle", etc.), partially revealed in the support set. 4 Figure 2: The mutual exclusivity task showing two meta-training episodes (left) and one test episode (right). Each episode requires executing instructions in a novel language of 4 input pseudowords ("dax", "wif", etc.) and four output actions ("red", "yellow", etc.). Each episode has a random mapping from pseudowords to meanings, providing three isolated words and their outputs as support. Answering queries requires concatenation as well as reasoning by mutual exclusivity to infer the fourth mapping ("dax" means "blue" in the test episode). To answer the queries, a model must acquire two abilities inspired by human generalization patterns [18]: 1) using isolated symbol mappings to translate concatenated symbol sequences, and 2) using mutual exclusivity (ME) to resolve unseen mappings. Children use ME to help learn the meaning of new words, assuming that an object with one label does not need another [26]. When provided with a familiar object (e.g., a cup) and an unfamiliar object (e.g., a cherry pitter) and asked to "Show me the dax," children tend to pick the unfamiliar object rather than the familiar one. Adults also use ME to help resolve ambiguity. When presented with episodes like Figure 2 in a laboratory setting, participants use ME to resolve unseen mappings and translate sequences in a symbol-by-symbol manner. Most people generalize in this way spontaneously, without any instructions or feedback about how to respond to compositional queries [18]. An untrained meta seq2seq learner would not be expected to generalize spontaneously -- human participants come to the task with a starting point that is richer in every way -- but computational models should nonetheless be capable of these inferences if trained to make them. This is a challenge for neural networks because the mappings change every episode, and standard architectures do not reason using ME. In fact, standard networks map novel inputs to familiar outputs, which is the opposite of ME [9]. Experimental setup. During meta-training, each episode is generated by sampling a random mapping from four input symbols to four output symbols (19 permutations used for meta-training and 5 for testing). The support set shows how three symbols should be translated, while one is withheld. The queries consist of arbitrary concatenations of the pseudowords (length 2 to 6) which can be translated symbol-by-symbol to produce the proper output responses (20 queries per episode). The fourth input symbol, which was withheld from the support, is used in the queries. The model must learn how to use ME to map this unseen symbol to an unseen meaning rather than a seen meaning (Figure 2). Results. Meta seq2seq successfully learns to reason with ME to answer queries, achieving 100% accuracy (SD = 0%). Based on the isolated mappings stored in memory, the network learns to translate sequences of those items. Moreover, it can acquire and use new mappings at test time, utilizing only its external memory and the activation dynamics. By learning to use ME, the network shows it can reason about the absence of symbols in the memory rather than simply their presence. The attention weights and use of memory is visualized and presented in the appendix (Figure A.1). 4.3 Experiment: Adding a new primitive through permutation meta-training This experiment evaluates meta seq2seq learning on the SCAN task of adding a new primitive [16]. Models are trained to generalize compositionally by decomposing the original SCAN task into a series of related seq2seq sub-tasks. The goal is to learn a new primitive instruction and use it compositionally, operationalized in SCAN as the "add jump" split [16]. Models learn a new primitive "jump" and aim to use it in combination with other instructions, resembling the "to Facebook" example introduced earlier in this paper. First, the original seq2seq problem from [16] is described. Second, the adapted problem for training meta seq2seq learners is described. 5 Query setzup dax wif!!!lug zup lug wif dax zup!!!!!!lug dax dax wif lug!!!!!Support setwif!lug!zup!dax!wif!lug!Support setwif zup dax!!!lug dax lug zup lug!!!!!dax wif lug!!!Query setdax dax!!wif dax lug zup lug wif !!!!!!wif lug lug!!!Query setdax!lug!zup!Support setMeta-training episodesTest episodePossible inputs: dax, wif, lug, zupPossible outputs: !, !, !, !……………… Table 1: SCAN task for compositional learning with input instructions (left) and their output actions (right) [16]. jump jump left jump around right turn left twice jump thrice jump opposite left and walk thrice jump opposite left after walk around left ⇒ LTURN WALK LTURN WALK LTURN WALK LTURN WALK ⇒ JUMP ⇒ LTURN JUMP ⇒ RTURN JUMP RTURN JUMP RTURN JUMP RTURN JUMP ⇒ LTURN LTURN ⇒ JUMP JUMP JUMP ⇒ LTURN LTURN JUMP WALK WALK WALK LTURN LTURN JUMP Seq2seq learning. Standard seq2seq models applied to SCAN have both a training and a test phase. During training, seq2seq models are exposed to the "jump" instruction in a single context demonstrating how to jump in isolation. Also during training, the models are exposed to all primitive and composed instructions for the other actions (e.g., "walk", "walk twice", "look around right and walk twice", etc.) along with the correct output sequences, which is about 13,000 unique instructions. Following [16], the critical "jump" demonstration is overrepresented in training to ensure it is learned. During test, models are evaluated on all of the composed instructions that use the "jump" primitive, examining the ability to integrate new primitives and use them productively. For instance, models are evaluated on instructions such as "jump twice", "jump around right and walk twice", "walk left thrice and jump right thrice," along with about 7,000 other instructions using jump. Meta seq2seq learning. Meta seq2seq models applied to SCAN have both a meta-training and a test phase. During meta-training, the models observe episodes that are variants of the original seq2seq problem, each of which requires rapid learning of new meanings for the primitives. Specifically, each meta-training episode provides a different random assignment of the primitive instructions ('jump','run', 'walk', 'look') to their meanings ('JUMP','RUN','WALK','LOOK'), with the restric- tion that the proper (original) permutation not be observed during meta-training. Withholding the original permutation, there are 23 possible permutations for meta-training. Each episode presents 20 support and 20 query instructions, with instructions sampled from the full SCAN set. The models predict the response to the query instructions, using the support instructions and their outputs as context. Through meta-training, the models are familiarized with all of the possible SCAN training and test instructions, but no episode maps all of its instructions to their original (target) outputs sequences. In fact, models have no signal to learn which primitives in general correspond to which actions, since the assignments are sampled anew for each episode. During test, models are evaluated on rapid learning of new meanings. Just four support items are observed and loaded into memory, consisting of the isolated primitives ('jump','run', 'walk', 'look') paired with their original meanings ('JUMP','RUN','WALK','LOOK'). Notably, memory use at test time (with only four primitive items in memory) diverges substantially from memory use during meta-training (with 20 complex instructions in memory). To evaluate test accuracy, models make predictions on the original SCAN test instructions consisting of all composed instructions using "jump." An output sequence is considered correct only if it perfectly matches the target sequence. Alternative models. The meta seq2seq learner is compared with an analogous "standard seq2seq" learner [22], which uses the same architecture with the external memory removed. The standard seq2seq learner is trained on the original SCAN problem with a fixed meaning for each primitive. Each meta seq2seq "episode" can be interpreted as a standard seq2seq "batch," and a batch size of 40 is chosen to equate the total number of presentations between approaches. All other architectural and training parameters are shared between meta seq2seq learning and seq2seq learning. The meta seq2seq learner is also compared with two additional lesioned variants that examine the importance of different architectural components. First, the meta seq2seq learner is trained "without support loss" (Section 3 meta-training), which guides the architecture about how to best use its memory. Second, the meta seq2seq learner is trained "without decoder attention" (Section 3 output decoder). This leads to substantial differences in the architecture operation; rather than producing a sequence of context embeddings C1, . . . , CT for each step of the T steps of a query sequence, only the last step context CT is computed and passed to the decoder. Results. The results are summarized in Table 2. On the "add jump" test set [16], standard seq2seq modeling completely fails to generalize compositionally, reaching an average performance of only 0.03% correct (SD = 0.02). It fails even while achieving near perfect performance on the training set 6 Table 2: Test accuracy on the SCAN "add jump" task across different training paradigms. standard training Model -- meta seq2seq learning -- -without support loss -without decoder attention -- standard seq2seq syntactic attention [30] 0.03% 78.4% permutation augmentation meta-training meta-training 99.95% 5.43% 10.32% -- -- 98.71% 99.48% 9.29% 12.26% -- (>99% on average). This replicates the results from [16] which trained many seq2seq models, finding the best network performed at only 1.2% accuracy. Again, standard seq2seq models do not show the necessary systematic compositionality. The meta seq2seq model succeeds at learning compositional skills, achieving an average performance of 99.95% correct (SD = 0.08). At test, the support set contains only the four primitives and their mappings, demonstrating that meta seq2seq learning can handle test episodes that are qualitatively different from those seen during training. Moreover, the network learns how to store and retrieve variables from memory with arbitrary assignments, as long as the network is familiarized with the possible input and output symbols during meta-training (but not necessarily how they correspond). A visualization of how meta seq2seq uses attention on SCAN is shown in the appendix (Figure A.2). The meta seq2seq learner also outperforms syntactic attention which achieves 78.4% and varies widely in performance across runs (SD = 27.4) [30]. The lesion analyses demonstrate the importance of various components. The meta seq2seq learner fails to solve the task without the guidance of the support loss, achieving only 5.43% correct (SD = 7.6). These runs typically learn the consistent, static meanings such as "twice", "thrice", "around right" and "after", but fail to learn the dynamic primitives which require using memory. The meta seq2seq learner also fails when the decoder attention is removed (10.32% correct; SD = 6.4), suggesting that a single m dimensional embedding is not sufficient to relate a query to the support items. 4.4 Experiment: Adding a new primitive through augmentation meta-training Experiment 4.3 demonstrates that the meta seq2seq approach can learn how to learn the meaning of a primitive and use it compositionally. However, only a small set of four input primitives and four meanings was considered; it is unclear whether meta seq2seq learning works in more complex compositional domains. In this experiment, meta seq2seq is evaluated on a much larger domain produced by augmenting the meta-training with 20 additional input and action primitives. This more challenging task requires that the networks handle a much larger set of possible meanings. The architecture and training procedures are identical to those used in Experiment 4.3 except where noted. Seq2seq learning. To equate learning environment across approaches, standard seq2seq models use a training phase that is substantially expanded from that in Experiment 4.3. During train- ing, the input primitives include the original four ('jump','run', 'walk', 'look') as well as 20 new symbols ('Primitive1,' . . . , 'Primitive20'). The output meanings include the original four ('JUMP','RUN','WALK','LOOK') as well as 20 new actions ('Action1,' . . . , 'Action20'). In the seq2seq training (but notably, not in meta seq2seq training), 'Primitive1' always corresponds to 'Action1,' 'Primitive2' corresponds to 'Action2,' and so on. A training batch uses the original SCAN templates with primitives sampled from the augmented set rather than the original set; for instance, a training instruction may be "look around right and Primitive20 twice." During training the "jump" primitive is only presented in isolation, and it is included in every batch to ensure the network learns it properly. Compared to Experiment 4.3, the augmented SCAN domain provides substantially more evidence for compositionality and productivity. Meta seq2seq learning. Meta seq2seq models are trained similarly to Experiment 4.3 with an augmented primitive set. During meta-training, episodes are generated by randomly sampling a set of four primitive instructions (from the set of 24) and their corresponding meanings (from the set of 24). For instance, an example training episode could use the four instruction primitives 'Primitive16', 'run', 'Primitive2', and 'Primitive12' mapped respectively to actions 'Action3', 'Action20', 'JUMP', and 'Action11'. Although Experiment 4.3 has only 23 possible assignments, this experiment has orders- 7 of-magnitude more possible assignments than training episodes, ensuring meta-training only provides a small subset. Moreover, the models are evaluated using a stricter criterion for generalization: the primitive "jump" is never assigned to the proper action "JUMP" during meta-training. The test phase is analogous to the previous experiment. Models are evaluated by loading all of the isolated primitives ('jump','run', 'walk', 'look') paired with their original meanings ('JUMP','RUN','WALK','LOOK') into memory as support items. No other items are included in memory. To evaluate test accuracy, models make predictions on the original SCAN test instructions consisting of all composed instructions using "jump." Results. The results are summarized in Table 2. The meta seq2seq learner succeeds at acquiring "jump" and using it correctly, achieving 98.71% correct (SD = 1.49) on the test instructions. The slight decline in performance compared to Experiment 4.3 is not statistically significant with five runs. The standard seq2seq learner takes advantage of the augmented training to generalize better than when using standard SCAN training (Experiment 4.3 and [16]), achieving 12.26% accuracy (SD = 8.33) on the test instructions (with >99% accuracy during training). The augmented task provides 23 fully compositional primitives during training, compared to the three in the original task. The basic seq2seq model still fails to properly discover and utilize this salient compositionality. The lesion analyses show that the support loss is not critical in this setting, and the meta seq2seq learner achieves 99.48% correct without it (SD = 0.37). In contrast to Experiment 4.3, using many primitives more strongly guides the network to use the memory, since the network cannot substantially reduce the training loss without it. The decoder attention remains critical in this setting, and the network attains merely 9.29% correct without it (SD = 13.07). Only the full meta seq2seq learner masters both the current and the previous learning settings (Table 2). 4.5 Experiment: Combining familiar concepts through meta-training The next experiment examines combining familiar concepts in new ways. Seq2seq learning. Seq2seq training holds out all instances of "around right" for testing, while training on all other SCAN instructions ("around right" split [21]). Using the symmetry between "left" and "right," the network must extrapolate to "jump around right" from training examples like "jump around left," "jump left," and "jump right." Meta seq2seq learning. Meta-training follows Experiment 4.4. Instead of just two directions "left" and "right", the possibilities also include "Direction1" and "Direction2" (or equivalently, "for- ward" and "backward"). Meta-training episodes are generated by randomly sampling two directions to be used in the instructions (from "left", "right", "forward", "backward") and their meanings (from "LTURN," "RTURN," "FORWARD","BACKWARD"), permuted to have no systematic cor- respondence. The primitive "right" is never assigned to the proper meaning during meta-training. Meta-training uses both 20 support and 20 query instructions. During test, models must infer how to perform an action "around right" and use it compositionally in all possible ways, with a support set of just "turn left" and "turn right" mapped to their proper meanings. Results. Meta seq2seq learning is nearly perfect at inferring the meaning of "around right" from its components (99.96% correct; SD = 0.08; Table 3), while standard seq2seq fails catastrophically (0.0% correct) and syntactic attention struggles (28.9%; SD = 34.8) [30]. 4.6 Experiment: Generalizing to longer instructions through meta-training The final experiment examines whether the meta seq2seq approach can learn to generalize to longer sequences, even when the test sequences are longer than any experienced during meta-training. Seq2seq learning. The SCAN instructions are divided into training and test sets based on the number of required output actions. Following the SCAN "length" split [16], standard seq2seq models are trained on all instructions that require 22 or fewer actions (∼17,000) and evaluated on all instructions that require longer action sequences (∼4,000 ranging in length from 24-28). During test, the network must execute instructions that require ≥24 actions such as "jump around right twice and look opposite right thrice," where both sub-instructions have been trained but the conjunction is novel. Meta seq2seq learning. Meta-training optimizes the network to extrapolate from shorter support instructions to longer query instructions. During test, the model is examined on even longer queries 8 than seeing during meta-training (drawn from the SCAN "length" test set). For meta-training, the original "length" training set is sub-divided into the support pool (all instructions with less than 12 output actions) and a query pool (all instructions with 12 to 22 output actions). In each episode, the network gets 100 support items and must respond to 20 (longer) query items. To encourage use of the external memory, primitive augmentation as in Experiment 4.4 is also applied. During test, the models load 100 support items from the original "length" split training set (lengths 1 to 22 output actions) and responds to queries from the original test set (lengths 24-28). Results. None of the models perform well on longer sequences (Table 3). The meta seq2seq learner achieves 16.64% accuracy (SD = 2.10) while the baseline seq2seq learner achieves 7.71% (SD = 1.90). Syntactic attention also per- forms poorly at 15.2% (SD = 0.7) [30]. Despite its other compositional successes, meta seq2seq lacks the truly systematic generalization needed to extrapolate to longer sequences. Table 3: Test accuracy on the SCAN "around right" and "length" tasks. length 16.64% 7.71% 15.2% Model meta seq2seq learning standard seq2seq syntactic attention [30] around right 99.96% 0.0% 28.9% 5 Discussion People are skilled compositional learners while standard neural networks are not. After learning how to "dax," people understand how to "dax twice," "dax slowly," or even "dax like there is no tomorrow." These abilities are central to language and thought yet they are conspicuously lacking in modern neural networks [16, 3, 21, 23, 2]. In this paper, I introduced a meta sequence-to-sequence (meta seq2seq) approach for learning to generalize compositionally, exploiting the algebraic structure of a domain to help understand novel utterances. Unlike standard seq2seq, meta seq2seq learners can abstract away the surface patterns and operate closer to rule space. Rather than attempting to solve "jump around right twice and walk thrice" by comparing surface level patterns with training items, meta seq2seq learns to treat the instruction as a template "x around right twice and y thrice" where x and y are variables. This approach solves several SCAN compositional learning tasks that have eluded standard NLP approaches, although it still does not generalize systematically to longer sequences [16]. In this way, meta seq2seq learning is a step forward in capturing the compositional abilities studied in synthetic learning tasks [18] and motivated in the "to dax" or "to Facebook" thought experiments. Meta seq2seq learning has implications for understanding how people generalize compositionally. Similarly to meta-training, people learn in dynamic environments, tackling a series of changing learning problems rather than iterating through a static dataset. There is natural pressure to generalize systematically after a single experience with a new verb like "to Facebook," and thus people are incentivized to generalize compositionally in ways that resemble the meta seq2seq loss. Meta learning is a powerful new toolbox for studying learning-to-learn and other elusive cognitive abilities [17, 37], although more work is needed to understand its implications for cognitive science. The models studied here can learn variables that assign novel meanings to words at test time, using only the network dynamics and the external memory. Although powerful, this is a limited concept of "variable" since it requires familiarity with all of the possible input and output assignments during meta-training. This limitation is shared by nearly all existing neural architectures [33, 11, 31] and shows that the meta seq2seq framework falls short of addressing Marcus's challenge of extrapolating outside the training space [24, 25, 23]. In future work, I intend to explore adding more symbolic machinery to the architecture [29] with the goal of handling genuinely new symbols. Hybrid neuro- symbolic models could also address the challenge of generalizing to longer output sequences, a problem that continues to vex neural networks [16, 3, 30] including meta seq2seq learning. The meta seq2seq approach could be applied to a wide range of tasks including low resource machine translation [13], graph traversal [11], or "Flash Fill" style program induction [28]. For traditional seq2seq tasks like machine translation, standard seq2seq training could be augmented with hybrid training that alternates between standard training and meta-training to encourage compositional generalization. I am excited about the potential of the meta seq2seq approach both for solving practical problems and for illuminating the foundations of human compositional learning. 9 Acknowledgments PyTorch code is available at https://github.com/brendenlake/meta_seq2seq. I am very grateful to Marco Baroni for contributing key ideas to the architecture and experiments. I also thank Kyunghyun Cho, Guy Davidson, Tammy Kwan, Tal Linzen, Gary Marcus, and Maxwell Nye for their helpful comments. References [1] Jacob Andreas. Good-Enough Compositional Data Augmentation. arXiv preprint, 2019. [2] Dzmitry Bahdanau, Shikhar Murty, Michael Noukhovitch, Thien Huu Nguyen, Harm de Vries, and Aaron Courville. Systematic generalization: What is required and can it be learned? pages 1 -- 16, 2018. [3] Joost Bastings, Marco Baroni, Jason Weston, Kyunghyun Cho, and Douwe Kiela. Jump to better conclusions: SCAN both left and right. In Proceedings of the EMNLP BlackboxNLP Workshop, pages 47 -- 55, Brussels, Belgium, 2018. [4] Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aurelie Neveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Specia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. Findings of the 2016 Conference on Machine Translation. In Proceedings of the First Conference on Machine Translation, pages 131 -- 198, Berlin, Germany, 2016. [5] Noam Chomsky. Syntactic Structures. Mouton, Berlin, Germany, 1957. [6] Ishita Dasgupta, Demi Guo, Andreas Stuhlmuller, Samuel J Gershman, and Noah D Goodman. Evaluating Compositionality in Sentence Embeddings. arXiv preprint, 2018. [7] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. International Conference on Machine Learning (ICML), 2017. [8] Jerry Fodor and Zenon Pylyshyn. Connectionism and cognitive architecture: A critical analysis. [9] Kanishk Gandhi and Brenden M Lake. Mutual exclusivity as a challenge for neural networks. Cognition, 28:3 -- 71, 1988. arXiv preprint, 2019. [10] Samuel J Gershman and Joshua B Tenenbaum. Phrase similarity in humans and machines. In Proceedings of the 37th Annual Conference of the Cognitive Science Society, 2015. [11] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska- Barwi´nska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 2016. [12] Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to Transduce with Unbounded Memory. In Advances in Neural Information Processing Systems, 2015. [13] Jiatao Gu, Yong Wang, Yun Chen, Kyunghyun Cho, and Victor OK Li. Meta-Learning for Low- Resource Neural Machine Translation. In Empirical Methods in Natural Language Processing (EMNLP), 2018. [14] S Hochreiter and J Schmidhuber. Long short-term memory. Neural computation, 9:1735 -- 1780, [15] Diederik P Kingma and Max Welling. Efficient Gradient-Based Inference through Transforma- tions between Bayes Nets and Neural Nets. In International Conference on Machine Learning (ICML 2014), 2014. [16] Brenden M Lake and Marco Baroni. Generalization without Systematicity: On the Composi- tional Skills of Sequence-to-Sequence Recurrent Networks. In International Conference on Machine Learning (ICML), 2018. [17] Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, 40:E253, 2017. [18] Brenden M Lake, Tal Linzen, and Marco Baroni. Human few-shot learning of compositional instructions. In Proceedings of the 41st Annual Conference of the Cognitive Science Society, 2019. [19] Brenden M Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. The Omniglot Challenge: A 3-Year Progress Report. Current Opinion in Behavioral Sciences, 29:97 -- 104, 2019. 1997. 10 [20] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521:436 -- 444, 2015. [21] João Loula, Marco Baroni, and Brenden M Lake. Rearranging the Familiar: Testing Compositional Generalization in Recurrent Networks. arXiv preprint, 2018. URL http: //arxiv.org/abs/1807.07545. [22] Minh-Thang Luong, Hieu Pham, and Christopher D. Manning. Effective Approaches to Attention-based Neural Machine Translation. In Empirical Methods in Natural Language Processing (EMNLP), 2015. [23] Gary Marcus. Deep Learning: A Critical Appraisal. arXiv preprint, 2018. [24] Gary F Marcus. Rethinking Eliminative Connectionism. Cognitive Psychology, 282(37): [25] Gary F Marcus. The Algebraic Mind: Integrating Connectionism and Cognitive Science. MIT 243 -- 282, 1998. Press, Cambridge, MA, 2003. [26] Ellen M Markman and Gwyn F Wachtel. Children's Use of Mutual Exclusivity to Constrain the Meanings of Words. Cognitive Psychology, 20:121 -- 157, 1988. [27] Richard Montague. Universal Grammar. Theoria, 36:373 -- 398, 1970. [28] Maxwell Nye, Luke Hewitt, Joshua B. Tenenbaum, and Armando Solar-lezama. Learning to Infer Program Sketches. International Conference on Machine Learning (ICML), 2019. [29] Scott Reed and Nando de Freitas. Neural Programmer-Interpreters. In International Conference on Learning Representations (ICLR), 2016. [30] Jake Russin, Jason Jo, Randall C. O'Reilly, and Yoshua Bengio. Compositional generalization in a deep seq2seq model by separating syntax and semantics. arXiv preprint, 2019. URL http://arxiv.org/abs/1904.09708. [31] Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-Learning with Memory-Augmented Neural Networks. In International Conference on Machine Learning (ICML), 2016. [32] Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems (NIPS), 2017. [33] Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-To-End Memory Networks. In Advances in Neural Information Processing Systems 29, 2015. [34] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to Sequence Learning with Neural Networks. In Advances in Neural Information Processing Systems (NIPS), 2014. [35] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. Advances in Neural Information Processing Systems., 2017. [36] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching Networks for One Shot Learning. In Advances in Neural Information Processing Systems 29 (NIPS), 2016. [37] Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv, 2016. URL http://arxiv.org/abs/1611.05763. [38] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google's neural machine translation system: Bridging the gap between human and machine translation. http://arxiv.org/abs/1609.08144, 2016. 11 A Appendix: Compositional generalization through meta seq2seq learning Figure A.1: During a test episode of the ME task, the support set (top left) and two queries are shown. The ME inference is that "dax" maps to "blue." The key-value memory attention A for each query is shown in the left matrix, with rows as encoder steps and columns as support items. The decoder attention for each query is shown in the right matrix, with rows as the decoder steps and columns as encoder steps. <EOS> marks the end-of-sequence. Mutual exclusivity (ME). Attention is visualized in Figure A.1 for a test episode in the ME task (Experiment 4.2) with two queries "lug zup lug wif dax zup" and "lug dax dax wif lug." When passing a query symbol-by-symbol through the key-value memory (Figure A.1 left), the network allocates attention to all of the cells that do not contain the current query symbol, a counterintuitive but valid encoding strategy. This pattern is reversed in the last step before the end-of-sequence symbol (<EOS>), where more intuitively the input symbol activates the memory cell that contains its corresponding support item. The withheld ME symbol "dax" leads to a broad, uniform pattern of attention spread across the support items, indicating its novelty. The RNN decoder attention is more straightforward. The diagonal pattern indicates strong alignment between each output symbol from the decoder (color; row) and its corresponding input symbol in the encoder (pseudoword; column). The first decoder step is an exception because the decoder hidden state is initialized with the last context step CT (Section 3). The attention vectors do not sum to 1 because of padded elements from the batched decoder. Figure A.2: Attention in meta seq2seq learning on the SCAN task. During test, the network is evaluated on the query "walk left after run right thrice." <EOS> marks the end-of-sequence. SCAN. Attention is visualized in Figure A.2 for a test episode in the "add jump" task (Experiment 4.4). The key-value memory attention provides a lookup mechanism for retrieving the response for each input primitive, including "walk" and "run" (Figure A.2 left). The decoder attention also provides an intuitive alignment, attending to "run", "right," and "thrice" in alternation while executing "run right thrice" (Figure A.2 right). 12 wif!lug!zup!lug zup lug wif dax zup!!!!!!query instructionsupport items! ! ! ! ! !query instructiondecoder outputlug dax dax wif lug!!!!!Support setQuery 1Query 2! ! ! ! !query instructionsupport itemsquery instructiondecoder outputKey-value memory attentionDecoder attentionquery instructionsupport itemsquery instructiondecoder output
1505.07302
4
1505
2015-07-07T10:13:04
Unveiling the Political Agenda of the European Parliament Plenary: A Topical Analysis
[ "cs.CL", "cs.CY" ]
This study analyzes political interactions in the European Parliament (EP) by considering how the political agenda of the plenary sessions has evolved over time and the manner in which Members of the European Parliament (MEPs) have reacted to external and internal stimuli when making Parliamentary speeches. It does so by considering the context in which speeches are made, and the content of those speeches. To detect latent themes in legislative speeches over time, speech content is analyzed using a new dynamic topic modeling method, based on two layers of matrix factorization. This method is applied to a new corpus of all English language legislative speeches in the EP plenary from the period 1999-2014. Our findings suggest that the political agenda of the EP has evolved significantly over time, is impacted upon by the committee structure of the Parliament, and reacts to exogenous events such as EU Treaty referenda and the emergence of the Euro-crisis have a significant impact on what is being discussed in Parliament.
cs.CL
cs
Unveiling the Political Agenda of the European Parliament Plenary: A Topical Analysis Derek Greene School of Computer Science & Informatics University College Dublin, Ireland [email protected] James P. Cross School of Politics & International Relations University College Dublin, Ireland [email protected] 5 1 0 2 l u J 7 ] L C . s c [ 4 v 2 0 3 7 0 . 5 0 5 1 : v i X r a ABSTRACT This study analyzes political interactions in the European Parlia- ment (EP) by considering how the political agenda of the plenary sessions has evolved over time and the manner in which Members of the European Parliament (MEPs) have reacted to external and internal stimuli when making Parliamentary speeches. It does so by considering the context in which speeches are made, and the content of those speeches. To detect latent themes in legislative speeches over time, speech content is analyzed using a new dy- namic topic modeling method, based on two layers of matrix factor- ization. This method is applied to a new corpus of all English lan- guage legislative speeches in the EP plenary from the period 1999- 2014. Our findings suggest that the political agenda of the EP has evolved significantly over time, is impacted upon by the committee structure of the Parliament, and reacts to exogenous events such as EU Treaty referenda and the emergence of the Euro-crisis have a significant impact on what is being discussed in Parliament. INTRODUCTION 1. The plenary sessions of the European Parliament (EP) are one of the most important arenas in which European representatives can air questions, express criticisms and take policy positions to influ- ence EU politics. Indeed the plenary of the Parliament represents the closest that the European Union (EU) gets to engaging in the core democratic process of publicly-aired democratic debate. As a result, understanding how Members of the European Parliament (MEPs) express themselves in plenary, and investigating how the political discussions evolve and respond to internal and external stimuli is a fundamentally important undertaking. In recent years, there has been a concurrent explosion of online records detailing the content of MEP speeches, and the develop- ment of data mining techniques capable of extracting latent patterns in content across sets of these speeches. This allows us for the first time to investigate the plenary agenda of the Parliament in a holistic and rigorous manner. One approach to tracking the political atten- tion of political figures has been to apply topic modeling algorithms to large corpora of political texts, such as parliamentary speeches of the U.S. Senate [18]. These algorithms seek to distill the la- tent thematic patterns in a corpus of speeches [3], and can be used to improve the transparency of the political process by providing a macro-level overview of the activities and agendas of politicians in a time- and resource-efficient manner. This type of overview would otherwise be unavailable due to the time and resource costs associated with manually hand-coding such a large-scale corpus. modeling method1 to investigate how the plenary agenda of the EP has changed over three parliamentary terms (1999–2014), based on the analysis of a corpus of 210,247 speeches from 1,735 MEPs across the 28 EU member states. The method described in Sec- tion 3 involves applying two layers of Non-negative Matrix Factor- ization (NMF) topic modeling [12]. Firstly, the corpus of speeches is divided into distinct segments or time windows, on which low- level window topics are identified by applying NMF. Secondly, the topics from each window are represented as a combined matrix of “topic documents”. By applying NMF to this new representation, we can identify high-level dynamic topics which potentially span many time windows. This process allows us to explore parliamen- tary activity both at a granular level and over multiple parliamen- tary terms. In addition, we can relate these dynamic topics to the original speakers, allowing us to identify the topics to which indi- vidual MEPs are paying most attention. Applying our proposed topic modeling methodology reveals the breadth of policy areas covered by the EP, and the results presented later in Section 5 indicate that the political agenda of the Parliament has evolved significantly across the three parliamentary terms con- sidered here. By examining a number of topic case studies, ranging from the Euro-crisis to EU treaty changes, we can identify the re- lationship between the evolution of these dynamic topics and the exogenous events driving them. By using external data sources, we can also confirm the semantic and construct validity of these top- ics. In order to explain some of the patterns in speech making we observe, we conclude the paper with an exploration of the deter- minants of MEP speech-making behavior on the topics detected by our topic model. To provide access to the results of the project to interested parties, we make a browsable version available online2. This website provides a greater level of transparency into the activ- ities of the EP as a functioning democratic institution. 2. RELATED WORK 2.1 European Parliament The most prominent forms of MEP behavior that have been ex- amined in the existing literature include the expression of policy positions through speeches and written submissions, and voting in plenary. The formal committee structure of the Parliament pro- vides strategic advantages to certain MEPs by providing commit- tee members with privileged access to information, and opportunity to shape the Parliament’s negotiation stance. This has led MEPs to self-select into committees dealing with issues that they find salient in order to affect outcomes in those policy areas [5, 26]. This paper takes up the challenge of extracting latent thematic pat- terns in political speeches by developing a suitable dynamic topic 1https://github.com/derekgreene/dynamic-nmf 2http://erdos.ucd.ie/europarl Committee chairs hold important administrative powers to set the committee agenda and the topics for debate at committee meet- ings. Rapporteurs are tasked with preparing reports about commit- tee activities, and represent a medium for disseminating informa- tion about committee activities to the broader plenary [1]. Rappor- teurs thus plays a central role in shaping the image of committee activities available to committee outsiders. Outside of committees, strict institutional rules also govern the allocation of speaking time during the Parliament’s plenary sessions, and structure the ability of MEPs to intercede during negotiations [10, 16]. The total amount of speaking time for any particular issue is limited and divided be- tween time reserved for actors with formal duties in plenary such as rapporteurs, and time proportionally divided between party groups based upon their overall share of MEPs elected. Limits on speaking time can lead to competition between MEPs, and party group lead- ers allocate the scare resource of speaking time between competing demands from rank and file MEPs for maximum impact. Due to the limits in the total amount of speaking time available, MEPs can also submit written questions and statements that are ap- pended to the plenary records. These provide extra opportunity for MEPs to state their positions outside the time limits imposed on oral questioning during plenary debates. These written questions have been found to be the most popular avenue used by MEPs to interact with the Commission directly [19], and provide the oppor- tunity for ‘fire-alarm oversight’ of national governments guilty of implementation failures of EU law [11]. MEPs enjoy more discre- tion over their ability to submit written submissions than they do over oral speaking time. In terms of the content of legislative speeches in the Parliament, it has been shown that speeches reflect latent ideological conflict be- tween MEPs, with both left-right and pro-/anti-EU integration di- mensions of conflict having been detected [22]. Using text analysis techniques based upon word-frequency distributions, these authors were able to demonstrate the correspondence between the content of legislative speeches and other measures of ideological positions found in the literature based upon roll-call votes and expert surveys. 2.2 Topic Models In the field of data analytics advanced topic modeling algorithms that go beyond word-frequency distributions have recently been applied to large-scale text collections. Considerable research on topic modeling has focused on the use of probabilistic methods such as variants of Latent Dirichlet Allocation (LDA) [23]. Authors have subsequently developed analogous probabilistic approaches for tracking the evolution of topics over time in a sequentially- organized corpus of documents, such as the dynamic topic model (DTM) of Blei and Lafferty [2]. Alternative algorithms, such as Non-negative Matrix Factorization (NMF) [12], have also been ef- fective in discovering the underlying topics in text corpora [15, 25]. Saha & Sindhwani [20] proposed an online learning framework for employing NMF to extract topics from streaming social media con- tent, by dividing the streams into short sliding time windows so as discover topics that are smoothly evolving over time. As well as analyzing temporal data, recent work in this area has fo- cused on important practical issues, including automating param- eter selection (e.g. how many topics are appropriate for our cor- pus?) and assessing topic coherence (i.e. how meaningful are the topics generated by our algorithm?) [7, 15]. The latter corresponds closely to the concept of semantic validity introduced in [18] for as- sessing the reliability of topics found in text corpora. This concept covers both intra-topic validity (the extent to which a single topic is meaningful) and inter-topic validity (the extent to which different topics are related to one another in a meaningful way). 2.3 Topic Models Applied to Political Texts Some topic modeling methods have been adopted in the political science literature to analyze political attention. In settings where politicians have limited time-resources to express their views, such as the plenary sessions in parliaments, politicians must decide what topics to address. Analyzing such speeches can thus provide insight into the political priorities of the politician under consideration. Single membership topic models, that assume each speech relates to one topic, have successfully been applied to plenary speeches made in the 105th to the 108th U.S. Senate in order to trace politi- cal attention of the Senators within this context over time [18]. This study found that a rich and meaningful political agenda emerged from the collected speeches, where topics evolved significantly over time in response to both internal and external stimuli. Bayesian hierarchical topic models have also been used to capture the political priorities of Members of Congress as found in their official press releases [9]. This study shows that the press releases are also responsive to external stimuli such as upcoming votes in Congress or events external to Congress such as the anniversary of September 11th. Press release topics are also geographically structured with Members of Congress from rural farming commu- nities more likely to pay attention to agricultural issues than those from urban communities for instance. The introduction of these methods to the study of political attention has allowed researchers to consider larger and more complete datasets of political activity across longer time periods than has previously been possible. The results unveil latent patterns in political attention that are difficult and time-consuming to capture using more traditional methodolog- ical approaches, such as expert surveys and hand-coding of texts. Applying them to study the political agenda of the European Par- liament is the aim of this paper. 3. METHODS In this section we describe a two-layer strategy for applying topic modeling in a non-negative matrix factorization framework to a timestamped corpus of political speeches. Firstly, in Section 3.1 we describe the application of NMF topic modeling to a single set of speeches from a fixed time period. Secondly, in Section 3.2 we propose a new approach for combining the outputs of topic model- ing from successive time periods to detect a set of dynamic topics that span part or all of the duration of the corpus. 3.1 Topic Modeling Speeches While work on topic models often involves the use of LDA, NMF can also be applied to textual data to reveal topical structures [25]. The ability of NMF to apply TF-IDF weighting to the data prior to topic modeling has shown to be advantageous in producing di- verse but semantically coherent topics which are less likely to be represented by the same high frequency terms. This makes NMF suitable when the task is to identify both broad, high-level groups of documents and niche topics with specialized vocabularies [15]. Given a corpus of n speeches, we first construct a speech-term fre- quency matrix A ∈ IRn×m, where m is the number unique terms present across all speeches (i.e. the corpus vocabulary). Applying NMF to A results in a reduced rank-k approximation in the form of the product of two non-negative factors A ≈ WH, where the objective is to minimize the reconstruction error between A and WH. The rows of the factor H ∈ IRk×m can be interpreted as k topics, defined by non-negative weights for each of the m terms in the corpus vocabulary. Ordering each row provides a topic descrip- tor, in the form of a ranking of the terms relative to corresponding topic. The columns in the matrix W ∈ IRn×k provide membership weights for all n speeches with respect to the k topics. In our experiments we use the fast alternating least squares variant of NMF introduced in [13]. NMF algorithms are often initialized with random factors. However, this can lead to unstable results, where the algorithm converges to a variety of different local minima of poor quality, depending on the random initialization. To ensure a deterministic output and to improve the quality of the resulting topics, we generate initial factors using the Non-negative Double Singular Value Decomposition (NNDSVD) approach [4]. A key parameter selection decision in topic modeling pertains to the number of topics k. Choosing too few topics will produce results that are overly broad, while choosing too many will lead to many small, highly-similar topics. One general strategy proposed in the literature has been to compare the topic coherence of topic models generated for different values of k [7]. A range of such coherence measures exist in the literature, although many of these are specific to LDA. Recently, O’Callaghan et al. [15] proposed a general mea- sure, TC-W2V, which evaluates the relatedness of a set of top terms describing a topic, based on the similarity of their representations in a word2vec distributional semantic space [14]. Specifically, the coherence of a topic th represented by its t top ranked terms is given by the mean pairwise cosine similarity between all relevant term vectors in the word2vec space: coh(th) = cos(wvi, wvj) (1) (cid:1) t(cid:88) 1(cid:0)t j−1(cid:88) 2 j=2 i=1 k(cid:88) h=1 An overall score for a topic model T consisting of k topics is given by the mean of the individual topic coherence scores: coh(T ) = 1 k coh(th) (2) An appropriate value for k can be identified by examining a plot of the mean TC-W2V coherence scores for a fixed range [kmin, kmax] and selecting a value corresponding to the maximum coherence. An example is shown in Fig. 1, where the plot of mean coherence scores suggests a value k = 19 from a candidate range [10, 25]. Parliamentary speeches will often be short and concise. In the case of the EP, speeches are often limited to 1-2 minutes in duration. As such, we would expect each speech to be primarily related to a single topic. This is consistent with the observations made by Quinn et al. [18] when analyzing speeches from the U.S. Congress. Here we produce a single membership topic model (i.e. a disjoint clustering of individual speeches in relation to topics) by selecting the maximum membership weight for each row in the factor W. 3.2 Dynamic Topic Modeling When applying clustering to temporal data, authors have often pro- posed dividing the data into time windows of fixed duration [24]. In the case of streaming data, such as content originating from social media platforms, this involves artificially transforming the continu- ous streams into sliding windows. However, in the case of political speeches transcribed from distinct plenary sessions, the data is nat- urally divided into segments. While some aspects of the agenda Figure 1: Plot of mean TC-W2V topic coherence scores for dif- ferent values for the number window topics k, generated on a time window of European Parliament speeches from 2005-Q1. will remain common between successive sessions, in other cases the focus of debates will change considerably between sessions. Consequently, online learning approaches which use sliding win- dows and assume a smooth evolution in topics over time, such as proposed in [20], may be unsuitable. Following [24], we divide the full time-stamped corpus of parlia- mentary speeches into τ disjoint time windows {W1, . . . , Wτ} of equal length. The rationale for the use of time windows as opposed to processing the full corpus in batch is two-fold: 1) we are in- terested in identifying the agenda of the parliament at individual time points as well as over all time; 2) short-lived topics, appearing only in a small number of time windows, may be obscured by only analyzing the corpus in its entirety. At each time window Wi, we apply NMF with parameter selection based on Eqn. 2 to the transcriptions of all speeches delivered dur- ing that window, yielding a window topic model Ti containing ki window topics. This process produces a set of successive window topic models {T1, . . . , Tτ}, which represents the output of the first layer in our proposed methodology. From the window topic models we construct a new condensed rep- resentation of the original corpus, by viewing the rows of each factor Hi coming from each window topic model as “topic docu- ments”. Each topic document naturally contains non-negative weights indicating the descriptive terms for that window topic. We expect that window topics from different windows which share a common theme will have similar topic documents. Specifically, we construct a condensed topic-term matrix B as follows: 1. Start with an empty matrix B. 2. For each window topic model Ti: (a) For each window topic within Ti, select the t top ranked terms from the corresponding row vector of the associ- ated NMF factor H, set all weights for all other terms in that vector to 0. Add the vector as a new row in B. 3. Once vectors from all topic models have been stacked in this way, remove any columns with only zero values (i.e. terms from the original corpus which did not ever appear in the t top ranked terms for any window topics). The matrix B has size n(cid:48) × m(cid:48), where n(cid:48) =(cid:80)τ i=1 ki is the total number of “topic documents” and m(cid:48) << m is is the subset of rel- evant terms remaining after Step 3. The use of only the top t terms 0.2900.2950.3000.3050.3100.315 10 15 20 25Mean Topic CoherenceNumber of Window Topics (k)k=19 Rank 1 2 3 4 5 6 7 8 9 10 2008-Q4 energy climate emission package change renewable target industry carbon gas 2009-Q1 climate change future emission integrated water policy target industrial global 2009-Q4 climate change copenhagen developing emission conference summit agreement global energy 2010-Q1 climate copenhagen change summit emission international mexico conference global world Table 1: Example of 4 window topics, described by lists of top 10 terms, which have been grouped together in a single dynamic topic related to climate change. in each topic document allows us to implicitly incorporate feature selection into the process. The result is that we include those terms that were highly-descriptive in each time window, while excluding those terms that never featured prominently in any window topic. This reduces the computational cost for the second factorization procedure described below. Having constructed B, we now apply a second layer of NMF topic modeling to the matrix to identify k(cid:48) dynamic topics which poten- tially span multiple time windows. The process is the same as that outlined previously in Section 3.1. Here the TC-W2V coherence measure is used to detect number of dynamic topics k(cid:48). The re- sulting factors can be interpreted as follows: the top ranked terms in each row of H provide a description of the dynamic topics; the values in the columns of W indicate to what extent each window topic is related to each dynamic topic. We track the evolution of these topics over time as follows. Firstly, we assign each window topic to the dynamic topic for which it has the maximum weight, based on the values in each row in the factor W. We define the temporal frequency of a dynamic topic as the number of distinct time windows in which that dynamic topic appears. The set of all speeches related to this dynamic topic across the entire corpus corresponds to the union of the speeches assigned to the individual time window topics which are in turn assigned to the dynamic topic. To summarize, the key outputs of the two-layer topic modeling process are as follows: 1. A set of τ topic models, one per time window, each containing ki window topics. These are described using their top t terms and the set of all associated speeches. 2. A set of k(cid:48) dynamic topics, each with an associated set of win- dow topics. These are described using their top t terms and set of all associated speeches. Table 1 shows a partial example of a dynamic topic. We observe that, for the four window topics, there is a common theme pertain- ing to climate change. While the variation across the term lists reflects the evolution of this dynamic topic over the correspond- ing time period (2008-Q4 to 2010-Q1), the considerable number of terms shared between the lists underlines its semantic validity. 4. DATA During August 2014 we retrieved all plenary speeches available on Europarl, the official website of the European Parliament3, corre- sponding to parliamentary activities of MEPs during the 5th – 7th terms of the EP. This resulted in 269,696 unique speeches in 24 lan- 3http://europarl.europa.eu guages. While we considered the use of either multi-lingual topic modeling or automated translation of documents, issues with the accuracy and reliability of both strategies lead us to focus on En- glish language speeches in plenary – either from native speakers or translated – which make up the majority of the speeches available on Europarl. A corpus of 210,247 English language speeches was identified in total, representing 77.95% of the original collection. In terms of coverage of speeches from MEPs from the member states, this ranged from 100% for the United Kingdom, through 87% for Germany, down to 66.2% for Romania. However, the most recent state to accede to the EU, Croatia, represents an outlier in the sense that only 2.6% of speeches were available in English at the time of retrieval due to EP speech translation issues. We subsequently divided the corpus into 60 quarterly time win- dows, from 1999-Q3 to 2014-Q2. We selected a quarter as the time window duration to allow for the identification of granular topics, while also ensuring there there existed a sufficient number of speeches in each time window to perform meaningful topic mod- eling. In particular, we wished to avoid empty time windows oc- curring due to the summer recess of the EP. For each time window Wi we construct a speech-term matrix Ai as follows: 1. Select all speech transcriptions from window Wi, and remove all header and footer lines. 2. Find all unigram tokens in each speech, through standard case conversion, tokenization, and lemmitization. 3. Remove short tokens with < 3 characters, and tokens corre- sponding to generic stop words (e.g. “are”, “the”), parliamentary- specific stop words (e.g. “adjourn”, “comment”) and names of politicians as listed on the EP website. 4. Remove tokens occurring in < 5 speeches. 5. Construct At, based on the remaining tokens. Apply standard TF-IDF term weighting and document length normalization. The resulting time window data sets range in size from 679 speeches in 2004-Q3 to 9,151 speeches in 2011-Q4, with an average of 4,811 terms per data set. 5. EXPERIMENTAL RESULTS 5.1 Experimental Setup After pre-processing the data, to identify window topics we ap- plied NMF with parameter selection as described in Section 3.1. Given the relatively specialized vocabulary used in EP debates, when building the word2vec space for parameter selection, as our background corpus we used the complete set of English language speeches. We used the same word2vec settings and number of top terms per topic (t = 10) as described in [15]. At each time win- dow, we generated models containing k ∈ [10, 25] window topics, selecting the value k that maximized mean TC-W2V coherence. The resulting median number of topics per window was 15.5. The illustration of the number of topics per window in Fig. 2 shows that there is considerable variation in the number of topics detected for each window, which does not correlate with the number of speeches per quarter (Pearson correlation 0.006). The process above yielded 1,017 window topics across the 60 time window. We subsequently applied dynamic topic modeling as de- scribed in Section 3.2. For the number of terms t representing each window topic, we experimented with values from 10 to the entire number of terms present in a time window. However, values t > 20 did not result in significantly different dynamic topics. Therefore, Figure 2: Number of window topics identified per time window, from 1999-Q3 (#1) to 2014-Q2 (#60). Figure 4: Distribution of TC-W2V topic coherence values for 57 dynamic topics, based on top 10 terms. Figure 3: Plot of mean TC-W2V topic coherence scores for dif- ferent values for the number dynamic topics of k(cid:48), across a can- didate range [25, 90]. Figure 5: Recall plot for EP taxonomy subjects relative to dy- namic topics, for increasing thresholds for cosine similarity. to minimize the dimensionality of the data, we selected t = 20. This yielded a matrix of 1,017 window topics represented by 2,710 distinct terms. We applied parameter selection based on TC-W2V coherence to select an overall number of dynamic topics k(cid:48) from a range k(cid:48) ∈ [25, 90]. The resulting plot (see Fig. 3) indicated a maximal value at k(cid:48) = 57, although a number of close peaks exist in the range [62,80]. This corresponds to our manual inspections of the results, where the topic models for these values of k’ appeared to be highly similar, with minor variations corresponding to merges or splits of strongly-related topics. 5.2 Dynamic Topic Validation The 57 topics identified in our experiments are diverse, both in terms of their thematic content and temporal signatures. Table 2 lists the top 20 dynamic topics in the data, ranked with respect to their TC-W2V topic coherence scores. We report the temporal fre- quency of the topics, together with a manually-assigned short label for discussion purposes4. The frequency of dynamic topics ranged from 11 which appeared in < 10 time windows, to a broad ‘Plenary administration’ topic which appeared in 57 out of 60 windows. In general, we observed two distinct categories of dynamic top- ics. The first reflects the day-to-day politics of EU in terms of leg- islating and debating issues related to the core EU competencies (e.g. ‘Energy’, ‘Agriculture’), while the other reflects unanticipated exogenous shocks and MEPs reactions to these events (e.g. Euro- 4Full details of all window topics and dynamic topics are available at http://erdos.ucd.ie/europarl crisis, September 11th attacks). These two categories exhibit dif- fering temporal signatures. For instance, we see a considerable difference between the broad topic on fisheries policy (Fig. 7(a)), when compared to the two topics arising from the events during the financial crisis and subsequent Euro-crisis as shown in Figures 7(b) and 7(c) respectively. This distinction between dynamic topic types reflects two different forms of political process in the Parliament. To examine the intra-topic semantic validity of these dynamic top- ics, Fig. 4 illustrates the distribution of TC-W2V coherence values for all dynamic topics, when evaluated in the word2vec space built from the complete speech corpus. As evidence by the ranking in Table 2, the most coherent topics often correspond to core EU com- petencies. Unsurprisingly, broad administrative topics prove to be least coherent (e.g. ‘Commission questions’, ‘Council Presidency’, ‘Plenary administration’). Overall the mean topic coherence score of 0.36 is considerably higher than the lower bound for TC-W2V (-1.0), suggesting a high level of semantic validity across the board. To assess the inter-topic semantic validity of the results, we ex- amine the extent to which any meaningful higher-level grouping exists among the 57 dynamic topics. To do this we apply aver- age linkage agglomerative clustering to the topics. Following the approach described in [8], we re-cluster the row vectors from the second-layer NMF factor H using normalized Pearson correlation as a similarity metric. Here the vectors correspond the weights of each dynamic topic with respect to the 2,710 terms noted above. The dendrogram for the hierarchical clustering is shown in Fig. 6. Using the interpretation provided in [18], the lower the height at which any two topics are connected in the dendrogram, the more 0 5 10 15 20 25 30 0 10 20 30 40 50 60Number of Topics (k)Time Window (Quarter Number)0.3450.3500.3550.3600.365 30 40 50 60 70 80 90Mean Topic CoherenceNumber of Dynamic Topics (k’)k0=57Dynamic Topic 0 0.1 0.2 0.3 0.4 0.5 0.6 TC-W2V CoherenceDynamic Topic0.00.10.20.30.40.50.60.70.80.91.00.00.10.20.30.40.50.60.70.8RecallSimilarity Threshold Short Label Transport The Balkans Air transport Adjusting to globalisation Energy Education and culture Fisheries Human rights Topic 13 42 33 29 6 39 8 2 45 Maritime issues 21 26 56 16 15 35 32 47 11 49 17 Healthcare Child protection Road safety Research Turkish accession Tax Trade - WTO and aid Product labelling and regulation Trade - Trade partnerships Regional funds CFSP Top 10 Terms transport, railway, rail, passenger, road, network, freight, system, train, infrastructure kosovo, serbia, balkan, resolution, bosnia, albania, iceland, herzegovina, macedonia, process air, passenger, transport, aviation, airport, traffic, airline, flight, sky, single fund, globalisation, egf, worker, adjustment, mobilisation, european, redundant, application, eur energy, gas, renewable, efficiency, supply, source, electricity, market, target, project programme, education, culture, language, cultural, youth, sport, learning, young, training fishery, fishing, fish, stock, fisherman, fleet, sea, common, policy, measure rights, human, fundamental, freedom, democracy, law, charter, resolution, union, violation port, sea, maritime, safety, ship, accident, oil, vessel, transport, inspection health, patient, environment, safety, public, care, healthcare, action, disease, mental child, internet, pornography, sexual, school, exploitation, young, victim, education, crime road, safety, vehicle, transport, system, driver, accident, motor, noise, ecall research, programme, innovation, framework, funding, industry, technology, development, cell, institute turkey, turkish, accession, progress, cyprus, negotiation, union, membership, croatia, macedonia tax, vat, taxation, rate, system, fraud, states, evasion, car, transaction trade, wto, world, development, developing, international, negotiation, aid, free, relation product, medicinal, medicine, tobacco, labelling, safety, consumer, regulation, organic, advertising agreement, partnership, morocco, trade, negotiation, data, cooperation, association, korea, fishery policy, region, cohesion, development, regional, strategy, structural, fund, economic, area security, policy, defence, common, foreign, military, nato, immigration, aspect, european Coh. 0.54 0.50 0.48 0.47 0.47 0.43 0.43 0.43 0.43 0.42 0.42 0.41 0.41 0.41 0.41 0.39 0.39 0.39 0.39 0.39 Freq. 19 12 10 15 36 21 34 52 10 18 14 12 15 20 11 19 11 18 22 19 Table 2: List of top 20 dynamic topics, ranked by their TC-W2V topic coherence. For each dynamic topic, we report a manually- assigned short label, the top 10 terms, coherence, and frequency (i.e. number of time windows in which it appeared). Figure 6: Dendrogram for average linkage hierarchical agglomerative clustering of 57 dynamic topics. Subject 1.10 Fundamental Rights In The Union 4.40 Education, Vocational Training & Youth 5.20 Monetary Union 4.70 Regional Policy 3.50 Research & Technological Development 3.60 Energy Policy 6.10 Common Foreign & Security Policy 3.20 Transport Policy in General 4.60 Consumers’ Protection in General 3.70 Environmental Policy Matched Topic: Top 10 Terms rights, human, fundamental, freedom, democracy, law, charter, resolution, union, violation programme, education, culture, language, cultural, youth, sport, learning, young, training euro, economic, growth, stability, pact, bank, policy, monetary, economy, ecb policy, region, cohesion, development, regional, strategy, structural, fund, economic, area research, programme, innovation, framework, funding, industry, technology, development, cell, institute energy, gas, renewable, efficiency, supply, source, electricity, market, target, project security, policy, defence, common, foreign, military, nato, immigration, aspect, european transport, railway, rail, passenger, road, network, freight, system, train, infrastructure product, medicinal, medicine, tobacco, labelling, safety, consumer, regulation, organic, advertising waste, recycling, directive, packaging, management, environment, electronic, fuel, environmental, radioactive Sim. 0.66 0.63 0.62 0.62 0.57 0.53 0.52 0.51 0.50 0.50 Table 3: Top 10 legislative procedure subjects with corresponding matching dynamic topics, ranked by cosine similarity of the match. similar their corresponding term usage patterns in EP sessions. We observe a number of higher-level groupings of interest, which are highlighted in Fig. 6. These include groups related to transport in general, energy concerns, interactions with other institutions, ed- ucation and research, trade relations, and EU enlargement. The presence of these higher-level associations between topics provide semantic validity for the results presented, where topics one might expect to be related are found to be correlated with respect to their rows in the NMF factor H (i.e. they share similar terms in their topic descriptors). To externally quantify the extent to which the identified dynamic topics correspond to policy areas in which the EU has competen- cies, and thus provide evidence of construct validity, we compare the 57 dynamic topics to an existing taxonomy of subjects, which is used by Europarl to classify legislative procedures. The taxonomy as retrieved from the site has several different levels, ranging from broad top-level subjects (e.g. ‘3 Community policies’), to highly- specific low-level subjects (e.g. ‘3.10.06.05 Textile plants, cotton’). We compare our results to the second level of the taxonomy, con- taining 48 subjects (e.g. ‘3.10 Agricultural policy and economies’, ‘3.20 Transport policy in general’). For each subject code, we cre- ate a “subject document” consisting of the description of the sub- ject and all lower level subjects within that branch of the taxonomy. We then identify the most similar dynamic topic by comparing the top 10 terms for that topic with each subject document, based on cosine similarity. Table 3 shows the best matching subjects and topics identified using this approach. Fig. 5 shows the recall of all 48 subjects, for different threshold levels of cosine similarity. For instance, at a threshold of 0.25, suitably matching dynamic topics for 72.9% of subjects are identified. To give a couple of examples, the topic hand-coded as relating to ‘Tax’ from our topic model was correctly matched with the Europarl subject code ‘2.70 Taxation’ broadly defined at level-2 of the taxonomy, and ‘2.70.01 Direct taxation’ and ‘2.70.02 Indirect taxation’ separately at level-3 of the taxonomy. When looking at the topic manually labeled as relating to ‘Drugs’, cosine similarity matches this with the level-2 subject ‘4.20 Public health’, which has a level-3 sub-category relating to ‘4.20.04 Pharmaceutical products and industry’. When taken in the context of the matches shown in Table 3, this indicates that our dy- namic topics provide good coverage of the policy areas that might be expected to feature during EP debates, and thus increases our confidence in the construct validity of the method. 5.3 Case Studies In order to further investigate the construct validity of our topics, we focus on three specific examples that demonstrate how our mod- eling strategy captures variation in MEP attention to a topic over time, and how this attention is impacted upon by external stimuli. Our first case study relates to MEP attention to the financial/Euro- crisis. The temporal distribution of speeches relating to this topic is illustrated in Fig. 7(a). This is an interesting case study, as the initial financial crisis peaked in 2008, and the Euro-crisis that fol- lowed has gone through a number of phases with major events in 2009, 2010 and 2012. As such, these events can be thought of as exogenous shocks that only garner MEP attention after they occur, and their exogenous nature provides a way to externally validity the dynamic topic modeling approach in use here. Fig. 7(a) demon- strates a number of distinct peaks in MEP speech making on both the financial crisis topic (in orange) and the Euro-crisis topic (in green). Attention to the financial crisis starts to rise in 2008-Q3 and initially peaks in 2008-Q4 (point A in Fig. 7(a)). This peak in activity corresponds to the date when the Lehman Brothers invest- ment bank collapsed (15/9/2008). The other peaks in activity in Fig. 7(a) correspond to important events in the Euro-crisis. Point B corresponds to the revelations about under-reporting of Greek debt following the Greek parliamentary election in October 2010, Point C to the Irish bailout in November 2010, and Point D to Mario Draghi’s statement that the ECB was “ready to do whatever it takes to preserve the euro" in the July 2012 respectively. Our second case study relates to the process of EU treaty reform. This topic is of interest, because one would expect a large amount in variation in MEP attention to the topic over time, as Treaty re- vision and reform and the referenda that accompany them are rare event and should only garner MEP attention when such events oc- cur. Fig. 7(b) shows MEP attention to the treaty change and ref- erenda topic between 2000 and 2014 in terms of the number of speeches associated with this topic. Three distinct treaties were dis- cussed and debated over this period. The first was the Nice treaty, (a) “Financial & Euro crises” dynamic topics (b) “Treaty changes & referenda” dynamic topic (c) “Fisheries” dynamic topic Figure 7: Time plots for three sample dynamic topics across all time windows, from 1999-Q3 (#1) to 2014-Q2 (#60). Dates on the x-axis correspond to the dates on which speeches were made at EP plenary sessions. which was agreed upon in 2001 and put to the vote in a referen- dum in Ireland in June 2001. The ‘No’ vote in that resulted from this referendum accounts for Point A in Fig. 7(b). The next set of treaty related events to occur were the negotiations and failed rati- fication of the Constitutional Treaty between 2003 and 2005. This process accounts for Point B in Fig. 7(b), that correspond to the In- tergovernmental Conference negotiating the treaty text that begun in October 2003. In the end the Constitutional Treaty was rejected by the French and Dutch in referenda in May/June 2005. Point C indicates the date of the signing of the Enlargement treaty in May 2004. The Lisbon treaty was negotiated to replace the failed Consti- tutional treaty, and we observe a significant peak in MEP speeches directly relating to the Lisbon treaty when it was signed (Point D), and when the first Irish referendum failed to ratify the treaty in June 2008 (Point E). A similar peak in MEP speeches relating to treaty reform corresponds to the second Irish referendum that eventually approved the Lisbon treaty in October 2009 (Point F). Our third and final case study relates to fisheries policy. Fisheries 0100200300Number of speeches2000200520102015ABCDDateEuro crisisFinancial crisis050100150Number of speeches20012004200620092011ABCDEFDate050100150200Number of speeches2000200520102015ABDate is an interesting theme for the dynamic topic modeling approach to detect, because it is more associated with the day-to-day function- ing of the EU as a regulator of the fisheries industry, when com- pared to more headline making policies and events like the eco- nomic crisis and treaty changes. Fig. 7(c) demonstrates the preva- lence of the fisheries topic over time. As can be seen, MEPs are seen to pay a reasonably stable level of attention to fisheries in terms of the numbers of speeches being made between 2000 and 2010. This trend is interrupted in 2010, when an increase in MEP attention to the fisheries topic is observed. This can be explained by the fact that in 2009 the European Commission launched a public consultation on reforming EU fisheries policy, the results of which were presented to the Parliament and Council in April 2010. The launch of this working document corresponds to a increase in the number of MEP speeches related to the fisheries topic as detected by the dynamic topic model (Point A). The peak in MEP speech making relating to this topic (Point B) corresponds with Commis- sioner Maria Damanaki introducing a set of legislative proposals designed to reform the common fisheries policy in a speech to the European Parliament in July 2011. In general, the fact that the variation over time that we observe in MEP attention to these case study topics appears to be driven by exogenous events provides a form of construct validity for our topic modeling approach. 5.4 Explaining MEP Speech Counts We now focus our attention on the 7th European Parliament which sat between 2009–2014. We focus on this term as a set of inter- esting covariates are available at the MEP level that can help us explain MEP contributions to a given topic. The dependent vari- able we seek to explain is the observed variation in the number of speeches each MEP makes on each of our identified dynamic topics. We employ a count-model framework suitable for analyz- ing count data [6]. The first issue to note with the count variable under consideration is that there is a large number of zeros. This is due to the fact that, for many topics, a considerable number of MEPs are recorded as making no speeches. This is likely due to the data-generating process in the topic model from which our de- pendent variable emerges. As described in Section 3.1, we apply a single membership topic modeling approach where each speech is associated with one topic. This assumption is generally unprob- lematic, given the short amount of time allowed for speeches and the concentrated nature of the messages MEPs seek to communi- cate in them. However, any speeches that might contain multiple topics are only counted towards a single topic in the model. The re- sult is that, in some cases, the “true” number of topics addressed by MEPs is under-represented and an inflated zero count is ob- served. In order to account for the inflated zero count, we model MEP speech-making as a two-stage process using a zero-inflated negative binomial regression model [6]. A zero-inflated negative binomial model includes a Logit regression component to capture the binary process determining whether or not a MEP speaks on a topic, and a negative-binomial regression component that seeks to capture the count process determining the number of speeches made, given that a MEP has chosen to speak on a topic. In order to explain the variation observed in our dependent variable, we include variables relating to MEP’s ideology, voting behavior, and the institutional structures in which they find themselves em- bedded within. We account for the left-right ideological position of a MEP’s national party (as a proxy for MEP ideology) using data from [21]. Following [17], we also include a measure of how often Figure 8: Plot of coefficients for regression model. MEPs vote against their party group in favor of their national party and vice versa. The idea behind including these variables is that MEPs rebelling against one party in favor of another will either try to explain such behavior in their speeches thus increasing the count, or hide their behavior by making no speeches, thus decreasing the count. These data were taken from an updated version of the [10] dataset provided by those authors. In order to capture an MEP’s committee positions we include dummies for committee member- ship, chairs, and Rapporteurs in committees that are directly related to a given topic. Committees were manually matched with topics to achieve this. We control for whether or not an MEP serves in the Parliamentary leadership. Controls are also included for the total number of speeches made by an MEP and the percentage of MEP speeches that are available in English as these are liable to affect the observed MEP speech count. Finally, we also include dummy variables to control for an MEP’s country of origin, EP party-group membership, and the topic on which they are speaking. All in- stitutional and control variables were scraped from the legislative observatory of the European Parliament. The regression presented in Fig. 8 provides further validation for the results of our topic modeling approach. The coefficients of the model have been exponentiated so as to represent odds ratios and aid interpretation. For the Logit component of the model account- ing for zero inflation, an exponentiated coefficient value above 1 implies that an increase in that covariate leads to an increase in the odds that a zero is observed (no speech is made), while any value below 1 implies an increase that variable leads to a decrease in the odds of a zero being observed (a speech being made). For the count component of the model exponentiated coefficient values above 1 are interpreted as implying a positive relationship between the pre- dictor and outcome variable, while values below 1 imply a negative relationship between the predictor and outcome variable. We begin with the zero-inflated component of the model in Fig. 8. The model suggests that a MEP’s national party ideology impacts upon whether or not they make speeches on a given topic, with more right-wing MEPs tending to make no topic speeches more of- ten than left-wing MEPs. Furthermore, MEPs defecting to national parties tend to make speeches more often than those not defecting, while the opposite is true for MEPs defecting to EP groups from na- tional parties. This is in line with the findings of [17] who demon- strate that MEPs who rebel against their European party groups Party L-RMEP defector to nat. partyMEP defector to EP groupEP leadership=1Chair of topic-relevant comm.=1Rapporteur of topic-relevant comm.=1Member of topic-relevant comm.=1MEP's total speechesPercent Speeches translated.511.522.5Odds ratiosSpeech-count componentParty L-RMEP defector to nat. partyMEP defector to EP groupEP leadership=1Chair of topic-relevant comm.=1Rapporteur of topic-relevant comm.=1Member of topic-relevant comm.=1MEP's total speechesPercent Speeches translated05101520Odds ratiosZero-inflated component tend to make more speeches explaining why they do so, while those rebelling against their national party tend to make less speeches ad- vertising their defection from the national party majority. Of the institutionally related variables, holding a leadership posi- tion or a chair of a topic relevant committee has no significant rela- tionship to MEP speech making, while being a member of a com- mittee relevant to a topic, or holding a Rapporteurship for such a topic-relevant committee significantly impact upon whether or not MEPs make a speech that topic. The odds that a MEP makes no speeches on a given topic decrease by a factor of 0.255 if a MEP is a Rapporteur of a topic-relevant Committee and decrease by a fac- tor of 0.259 if that MEP is a member of a topic-relevant committee. The results also show that the odds of an MEP making no speeches on a given topic decrease for MEPs that make more speeches in to- tal. The result relating to the percentage of MEP speeches that are in English (whether translated or originally so) is also found to be significant, suggesting that MEPs with more speeches available in English tend to make speeches on a given topic more often. Moving to the speech-count component of the model, the results further reinforce our expectations that MEP positions within the Parliamentary committee system impact upon how much attention they pay to a particular topic. When an MEP holds a committee chair, Rapporteurship, or committee membership relevant to a par- ticular topic, the odds that said MEP will make a speech on that topic increase by a factor of 1.173, 1.582, and 2.077 respectively. In order to clarify the substantive size of the effects found in the model, Fig. 9(a) plots the odds ratio of different topics that entered into the regression model but were not displayed in Fig. 8. To plot these fixed effects odds rations, we treat the Euro crisis topic as the baseline. As can be seen, there are significant differences ob- served between the prevalence of different topics. The most preva- lent topic is related to administrative matters in the plenary, and the odds of this topic appearing in an MEP speech are about 3.5 times greater than the odds of a speech relating to the Euro crisis topic. This is not surprising given that administrative matters frame all discussions in the plenary. Perhaps more surprising is the preva- lence of the human rights topic relative to the other topics in the analysis. The odds of a speech relating to human rights is about 3 times greater than the odds that a speech relates to the Euro crisis. The relative prevalence of this topic suggests that MEPs regularly comment on human rights issues. Indeed, when one delves into the speeches appearing in this topic, a broad concern for violations of human rights across different contexts is evident. The relative prevalence of topics such as gender equality and social policy is also noteworthy, and suggests that the Parliament actively debates such issues despite the fact that the EU has little formal legislative competencies in these areas. Fig. 9(b) plots the odds ratios associated with different party groups within the Parliament, treating the European People’s Party (EPP) group as the baseline. As can be seen, there is some variation in the odds that a speech on a given topic emerges from a given party, but most of these differences are not statistically significant. This result reflects the fact that speech time is distributed between party groups according to their relative size. Both the Progressive Alliance of Socialists and Democrats (S & D) and the European Greens–European Free Alliance (G–EFA) groups are found to dif- fer from the EPP group in terms of the odds a speech on a given topic comes from them. The odds of a topic speech being from either of these groups is less than the odds of a topic speech being (a) Topic fixed effects topic (b) Party group fixed effects Figure 9: Fixed effects from regression model. from the EPP by a factor of just over 0.1. 6. CONCLUSIONS In this paper, we have proposed a new two-layer matrix factoriza- tion methodology for identifying topics in large political speech corpora over time, designed to identify both niche topics related to events at a particular point in time and broad, long-running topics. We applied this method to a new corpus of all ≈ 210k English language plenary speeches from the European Parliament during a 15 year period. In terms of providing substantive insight into the political processes of the European Parliament, the topic mod- eling method has allowed us to unveil the political agenda in the Parliament, and the manner in which this has evolved over the time period under consideration. By considering three distinct case studies, we have demonstrated the distinctions that can be drawn between the day-to-day political work of the Parliament in policy areas such as fisheries on the one hand, and the manner in which exogenous events such as economic crises and failed treaty refer- enda can give rise to new topics of discussion between MEPs on the other. Once the Parliamentary agenda was extracted from the corpus of speeches, we explored the determinants of MEP attention to particular topics in the 7th sitting of the Parliament. We demon- strated how MEP ideology and voting behavior affect whether or not they choose to contribute to a topic, and once such a decision has been made, we demonstrated how the committee structure of the Parliament structures MEP contributions on a given topic. The initial insights provide by the dynamic topic modeling ap- proach presented in this paper demonstrate the potential of these methods to uncover the latent dynamics in MEP speech-making ac- tivities and thus allow for new insights into how the EU functions as a political system. Much remains to be explored in terms of the patterns in political attention that emerge from the topic modeling approach. For instance, one would expect that political attention Plenary administrationHuman rightsFinancial crisisGender equalityFisheriesBudgetCFSPRussiaSocial policyClimate changeChild protectionTaxEnlargementFoot and mouthTreaties and referenda01234Odds ratiosEFDDS&DGUE-NGLG-EFAALDEECR.6.811.21.4Odds ratios [15] D. O’Callaghan, D. Greene, J. Carthy, and P. Cunningham. An analysis of the coherence of descriptors in topic modeling. Expert Systems with Applications (ESWA), 2015. [16] S.-O. Proksch and J. B. Slapin. Position taking in European Parliament speeches. British Journal of Political Science, 40(03):587–611, 2010. [17] S.-O. Proksch and J. B. Slapin. The politics of parliamentary debate: Parties, rebels and representation. Cambridge University Press, 2014. [18] K. M. Quinn, B. L. Monroe, M. Colaresi, M. H. Crespin, and D. R. Radev. How to analyze political attention with minimal assumptions and costs. American Journal of Political Science, 54(1):209–228, 2010. [19] T. Raunio. Parliamentary questions in the European Parliament: Representation, information and control. The Journal of Legislative Studies, 2(4):356–382, 1996. [20] A. Saha and V. Sindhwani. Learning evolving and emerging topics in social media: A dynamic NMF approach with temporal regularization. In Proc. 5th ACM Int. Conf. Web search and data mining, pages 693–702, 2012. [21] R. Scully, S. Hix, and D. M. Farrell. National or European Parliamentarians? Evidence from a New Survey of the Members of the European Parliament. JCMS: Journal of Common Market Studies, 50(4):670–683, 2012. [22] J. B. Slapin and S. O. Proksch. Look who’s talking: Parliamentary debate in the European Union. European Union Politics, 11(3):333–357, 2010. [23] M. Steyvers and T. Griffiths. Probabilistic Topic Models. In T. Landauer, D. Mcnamara, S. Dennis, and W. Kintsch, editors, Latent Semantic Analysis: A Road to Meaning. Laurence Erlbaum, 2006. [24] R. Sulo, T. Berger-Wolf, and R. Grossman. Meaningful selection of temporal resolution for dynamic networks. In Proc. 8th Workshop on Mining and Learning with Graphs, pages 127–136. ACM, 2010. [25] Q. Wang, Z. Cao, J. Xu, and H. Li. Group matrix factorization for scalable topic modeling. In Proc. 35th SIGIR Conf. on Research and Development in Information Retrieval, pages 375–384. ACM, 2012. [26] N. Yordanova. The Rationale behind Committee Assignment in the European Parliament Distributive, Informational and Partisan Perspectives. European Union Politics, 10(2):253–280, 2009. might well translate into influence over policy outcomes decided upon in the Parliament. Tracing influence to date has been diffi- cult, as a macro-level picture of where and on what topics MEP attention lies has been unavailable. Linking political attention to political outcomes would help to unveil who gets what and when in European politics, which is a central concern for a political system that is often criticized for lacking democratic legitimacy. this is but one direction in which future research might proceed. While this paper has focused on European Parliament speeches, the proposed topic modeling method has a number of potential appli- cations in the study of politics, including the analysis of speeches in other parliaments, political manifestos, and other more tradi- tional forms of political texts. It is also generally appropriate in domains where large-scale, longitudinal text corpora are naturally represented in discrete segments. Acknowledgments. This research was partly supported by Science Foundation Ireland (SFI) under Grant Number SFI/12/RC/2289. 7. REFERENCES [1] G. Benedetto. Rapporteurs as legislative entrepreneurs: the dynamics of the codecision procedure in europe’s parliament. Journal of European Public Policy, 12(1):67–88, 2005. [2] D. M. Blei and J. D. Lafferty. Dynamic topic models. In Proc. 23rd International Conference on Machine Learning, pages 113–120, 2006. [3] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, 2003. [4] C. Boutsidis and E. Gallopoulos. SVD based initialization: A head start for non-negative matrix factorization. Pattern Recognition, 2008. [5] S. Bowler and D. M. Farrell. The organizing of the european parliament: Committees, specialization and co-ordination. British Journal of Political Science, 25(02):219–243, 1995. [6] A. C. Cameron and P. K. Trivedi. Regression analysis of count data, volume 53. Cambridge university press, 2013. [7] J. Chang, J. Boyd-Graber, S. Gerrish, C. Wang, and D. M. Blei. Reading Tea Leaves: How Humans Interpret Topic Models. In NIPS, 2009. [8] D. Greene, G. Cagney, N. Krogan, and P. Cunningham. Ensemble Non-negative Matrix Factorization Methods for Clustering Protein-Protein Interactions. Bioinformatics, 24(15):1722–1728, 2008. [9] J. Grimmer. A bayesian hierarchical topic model for political texts: Measuring expressed agendas in senate press releases. Political Analysis, 18(1):1–35, 2010. [10] S. Hix, A. Noury, and G. Roland. Dimensions of politics in the european parliament. American Journal of Political Science, 50(2):494–520, 2006. [11] C. B. Jensen, S.-O. Proksch, and J. B. Slapin. Parliamentary Questions, Oversight, and National Opposition Status in the European Parliament. Legislative Studies Quarterly, 38(2):259–282, 2013. [12] D. D. Lee and H. S. Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401:788–91, 1999. [13] C. Lin. Projected gradient methods for non-negative matrix factorization. Neural Computation, 19(10):2756–2779, 2007. [14] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013.
1801.04962
1
1801
2018-01-15T19:39:19
What Level of Quality can Neural Machine Translation Attain on Literary Text?
[ "cs.CL" ]
Given the rise of a new approach to MT, Neural MT (NMT), and its promising performance on different text types, we assess the translation quality it can attain on what is perceived to be the greatest challenge for MT: literary text. Specifically, we target novels, arguably the most popular type of literary text. We build a literary-adapted NMT system for the English-to-Catalan translation direction and evaluate it against a system pertaining to the previous dominant paradigm in MT: statistical phrase-based MT (PBSMT). To this end, for the first time we train MT systems, both NMT and PBSMT, on large amounts of literary text (over 100 million words) and evaluate them on a set of twelve widely known novels spanning from the the 1920s to the present day. According to the BLEU automatic evaluation metric, NMT is significantly better than PBSMT (p < 0.01) on all the novels considered. Overall, NMT results in a 11% relative improvement (3 points absolute) over PBSMT. A complementary human evaluation on three of the books shows that between 17% and 34% of the translations, depending on the book, produced by NMT (versus 8% and 20% with PBSMT) are perceived by native speakers of the target language to be of equivalent quality to translations produced by a professional human translator.
cs.CL
cs
What Level of Quality can Neural Machine Translation Attain on Literary Text? Antonio Toral and Andy Way Abstract Given the rise of a new approach to MT, Neural MT (NMT), and its promising performance on different text types, we assess the translation quality it can attain on what is perceived to be the greatest challenge for MT: literary text. Specifically, we target novels, arguably the most popular type of literary text. We build a literary-adapted NMT system for the English-to-Catalan translation direc- tion and evaluate it against a system pertaining to the previous dominant paradigm in MT: statistical phrase-based MT (PBSMT). To this end, for the first time we train MT systems, both NMT and PBSMT, on large amounts of literary text (over 100 million words) and evaluate them on a set of twelve widely known novels spanning from the the 1920s to the present day. According to the BLEU automatic evaluation metric, NMT is significantly better than PBSMT (p < 0.01) on all the novels consid- ered. Overall, NMT results in a 11% relative improvement (3 points absolute) over PBSMT. A complementary human evaluation on three of the books shows that be- tween 17% and 34% of the translations, depending on the book, produced by NMT (versus 8% and 20% with PBSMT) are perceived by native speakers of the target language to be of equivalent quality to translations produced by a professional hu- man translator. 1 Introduction Literary text is considered to be the greatest challenge for machine translation (MT). According to perceived wisdom, despite the tremendous progress in the field of Antonio Toral Center for Language and Cognition, University of Groningen, The Netherlands, e-mail: a. [email protected] Andy Way ADAPT Centre, School of Computing, Dublin City University, Ireland, e-mail: andy.way@ adaptcentre.ie 1 2 Antonio Toral and Andy Way statistical MT over the past two decades, there is no prospect of machines being useful at (assisting with) the translation of this type of content. However, we believe that the recent emergence of two unrelated technologies opens a window of opportunity to explore this topic: 1. The electronic book: the market share of e-books is continuously growing,1 as a result of which there is a wide availability of books in digital format, including original novels and their translations. Because the main resource required to train statistical MT systems is bilingual parallel text, we are now able to build MT systems tailored to novels. This should result in better performance, as it has been shown in MT research again and again that for a statistical MT engine to perform optimally it should be trained on similar data to the data it is applied to, e.g. Pecina et al (2014). 2. Neural MT: NMT is a new approach to statistical MT, which, while having been introduced only very recently,2 has already shown great potential, as there is ev- idence that it can attain better translation quality than the dominant approach to date, namely phrase-based statistical MT (PBSMT). This has been shown for a number of language pairs and domains, including transcribed speeches (Lu- ong and Manning, 2015), newswire (S´anchez-Cartagena and Toral, 2016) and United Nations documents (Junczys-Dowmunt et al, 2016). Beyond its generally positive performance, NMT is of particular interest for literary texts due to the following two findings: • Its performance seems to be especially promising for lexically-rich texts (Ben- • There are claims that NMT "can, rather than do a literal translation, find the tivogli et al, 2016), which is the case of literary texts. cultural equivalent in another language".3 With respect to the last point, literal (but not word-for-word) translations are deemed acceptable for domains for which PBSMT is already widely used in indus- try, such as technical documentation, as the aim of the translation process here is purely to carry over the meaning of the source sentence to the target language, with- out necessarily reflecting any stylistic niceties of the target language. In contrast, literal translations are not at all suitable for literary texts because the expectations of the reader are considerably higher; it is not sufficient for the translation to merely preserve the meaning, as it should also preserve the reading experience of the origi- nal text. In this chapter we aim to assess the performance that can be offered by state- of-the-art MT for literary texts. To this end we train PBSMT and NMT systems 1 For example, in the US the market share of e-books surpassed that of printed books for fiction in 2014, http://www.ingenta.com/blog-article/adding-up-the-invisible- ebook-market-analysis-of-author-earnings-january-2015-2/ 2 Working models of NMT have only recently been introduced, but from a theoretical perspective, very similar models can be traced back two decades (Forcada and Neco, 1997). 3 understanding-language/ http://events.technologyreview.com/video/watch/alan-packer- What Level of Quality can Neural Machine Translation Attain on Literary Text? 3 for the first time on large amounts of literary texts (over 100 million words) and evaluate them on a set of twelve widely known novels that span from the 1920s to the beginning of the 21st century. The rest of the chapter is organised as follows. In the following section, we pro- vide an overview of the research carried out in the field of MT targeting literary texts. Next, we outline our experimental setup (Section 3) and provide technical de- tails of the PBSMT and NMT systems built (Section 4). Subsequently we evaluate and analyse the translations produced by both MT systems (Section 5). Finally, we conclude and outline lines of future work in Section 6. 2 State-of-the-Art in MT of Literary Text There has been recent interest in the Computational Linguistics community regard- ing the processing of literary text. The best example is the establishment of an annual workshop (Computational Linguistics for Literature) in 2012. A popular strand of research concerns the automatic identification of text snippets that convey figurative devices, such as metaphor (Shutova et al, 2013), idioms (Li and Sporleder, 2010), humour and irony (Reyes, 2013), applied to monolingual text. Conversely, there has been a rather limited amount of work on applying MT to literary texts, as we now survey. Genzel et al (2010) constrained SMT systems for poetry to produce French-to- English translations that obey length, meter, and rhyming rules. Form is preserved at the price of producing considerably lower quality translations; the score according to the BLEU automatic evaluation metric (Papineni et al, 2002) (see Castilho et al. and Way in this volume for more details of this metric) decreases by around 50%, although it should be noted that their evaluation was not on poetry but on news. Greene et al (2010) translated poetry, choosing target output realisations that con- form to the desired rhythmic patterns. Specifically, they translated Dante's Divine Comedy from Italian sonnets into English iambic pentameter. Instead of constrain- ing the SMT system, as done by Genzel et al (2010), they passed its output lattice through a device that maps words to sequences of stressed and unstressed syllables. These sequences were finally filtered with an iambic pentameter acceptor. Voigt and Jurafsky (2012) examined the role of referential cohesion in translation and found that literary texts have more dense reference chains. They concluded that incorporating discourse features beyond the level of the sentence (Hardmeier, 2014) is an important research focus for applying MT to literary texts. Jones and Irvine (2013) used general-domain MT systems to translate samples of French literature (prose and poetry) into English. They then used qualitative analy- sis grounded in translation theory on the MT output to assess the potential of MT in literary translation and to address what makes literary translation particularly diffi- cult. Besacier (2014) used MT followed by post-editing (by non-professional trans- lators) to translate a short story from English into French. Such a workflow was 4 Antonio Toral and Andy Way deemed a useful low-cost alternative for translating literary works, albeit at the ex- pense of disimproved translation quality. Our recent work (Toral and Way, 2015b) contributed to the state-of-the-art in two dimensions. First, we conducted a comparative analysis on the translatability of literary text according to narrowness of the domain and freedom of translation, which is more general and complementary to the analysis by Voigt and Jurafsky (2012). Second, related to Besacier (2014), we evaluated MT for literary text. There were two differences though; first, Besacier (2014) translated a short story, while we translated a novel; second, their MT systems were evaluated against a post- edited reference produced by non-professional translators, while we evaluated our MT systems against the translation produced by a professional translator. This work builds upon our previous study (Toral and Way, 2015b), the following being the main differences between the two: we now train a literary-adapted MT system under the NMT paradigm (while previously we used PBSMT), the trans- lation direction considered is more challenging as the languages are more distant (English-to-Catalan versus Spanish-to-Catalan), we conduct a considerably broader evaluation (12 books now versus 1 in the previous work) and analyse the results with respect to a set of textual features of each novel. 3 Experimental Setup This section covers the experimental settings. We explain the motivation for the language pair chosen for this chapter (Section 3.1), describe the data sets used in our experiments (Section 3.2) and finally the tools that were utilised (Section 3.3). 3.1 Language Pair In general, it is widely accepted that the quality attainable by MT correlates with the level of relatedness between the pair of languages involved. This is because trans- lations between related languages should be more literal, and complex phenomena (such as metaphorical expressions) might simply transfer rather straightforwardly to the target language, while they are more likely to require complex translations between unrelated languages. In our previous work (Toral and Way, 2015a,b), we considered a closely-related language pair (Spanish-to-Catalan), where both languages belong to the same family (Romance). We built a literary-adapted PBSMT system and used it to translate a novel from an internationally renowned author, Ruiz Zaf´on. We concluded that our system could be useful to assist with the translation of this kind of text due to the following two findings. 1. For a random subset of sentences from the novel, we asked native speakers to rank the translations coming from the MT system against those from a profes- What Level of Quality can Neural Machine Translation Attain on Literary Text? 5 sional translator (i.e. taken from the published novel in the target language), al- though they did not know which were which. For over 60% of the sentences, native speakers found both translations to be of the same quality (Toral and Way, 2015b). 2. The previous evaluation was carried out at the sentence level, so it might be ar- gued that this is somewhat limited as it does not take context beyond the sentence into account. Therefore we subsequently analysed 3 representive passages (up to 10 consecutive sentences): one of average MT quality (i.e. the quality of this pas- sage is similar to the quality obtained by MT on the whole novel, as measured with BLEU), another of high quality (i.e. its BLEU score is similar to the average BLEU score of the 20% highest-scoring passages) and finally, one of low quality (i.e. its BLEU score is similar to the average BLEU score of the 20% lowest- scoring passages). For the passages of high and average quality, we showed that the MT output requires only a few character edits to match the professional trans- lation (Toral and Way, 2015a). Encouraged by the positive results obtained on a closely-related language pair, we have now decided to explore the potential for a less-related pair - correspond- ingly a more challenging task. The language pair in this study is English-to-Catalan, where the two languages involved belong to different families (Germanic and Ro- mance, respectively). We choose Catalan as target language as an example of a mid-size European language.4 These are languages into which a significant number of novels have been translated - we have easily identified over 200 English e-books available in Catalan. Nonetheless, this number is very low compared to the amount of books translated into 'major' European languages (such as German, French, Italian, or Spanish). Concerning mid-size European languages, because there is a reasonable amount of data available to train literary-adapted MT systems and also room to have more novels translated if the output translations produced by MT are deemed useful to assist translators, we believe this is a sensible choice of target language type for this line of research. 3.2 Data sets 3.2.1 Training and Development Data We use parallel and monolingual in-domain data for training. The parallel data com- prises 133 parallel novels (over 1 million sentence pairs), while the monolingual data consists of around 1,000 books written in Catalan (over 5 million sentences) 4 With this term we refer to European languages with around 5 to 10 million speakers, as is the case of many other languages in Europe, such as Danish, Serbian, Czech, etc. 6 Antonio Toral and Andy Way and around 1,600 books in English5 (over 13 million sentences). In addition, we use out-of-domain datasets, namely OpenSubtitles6 as parallel data (around 400,000 sentence pairs) and monolingual Catalan data (around 16 million sentences) crawled from the web (Ljubesi´c and Toral, 2014). The development data consists of 2,000 sentence pairs randomly selected from the in-domain parallel training data and re- moved from the latter data set. Quantitative details of the training and development data sets are shown in Table 1. # tokens English # sentences Dataset Training parallel (in-domain) Training parallel (OpenSubs) Training monolingual (in-domain) Training monolingual (in-domain) 13,841,542 210,337,379 Training monolingual (web) Development Catalan 1,086,623 16,876,830 18,302,284 3,381,241 - 100,426,922 - - 486,961,317 38,114 16,516,799 2,000 402,775 5,306,055 3,577,109 34,562 Table 1 Number of sentences and tokens (source and target sides) in the training and development data sets. 3.2.2 Test Data We test our systems on 12 English novels and their professional translations into Catalan. In so doing we aim to build up a representative sample of literary fiction, encompassing novels from different periods (from the 1920s to the present day) and genres and targeted at different audiences. Details are provided in Table 2. For each novel, aside from the number of sentences and tokens (i.e. words) that it contains, we show also the portion of the source book (percentage of sentences) that was evaluated.7 Whilst obviously none of the novels in the test set is included in the training data, the latter dataset may contain other novels from writers represented in the test set. For example, the test set contains the 7th book in the Harry Potter series from J. K. Rowling and the training set contains the previous 6 books of that series. Table 3 shows, for each writer represented in the test set, how many books appear in the training set from this writer, and how many sentence pairs and tokens (source side) these books amount to. 5 While our experiments are for the English-to-Catalan language pair, we also use English mono- lingual data to generate synthetic data for our NMT system (see Section 4.2). 6 http://opus.lingfil.uu.se/OpenSubtitles.php 7 In order to build the test sets we sentence-align the source and target versions of the books. We keep the subset of sentence pairs whose alignment score is above a certain threshold. See Section 3.3.1 for further details. What Level of Quality can Neural Machine Translation Attain on Literary Text? 7 % sentences # sentences Author, book and year Auster's Sunset Park (2010) Collins' Hunger Games #3 (2010) Golding's Lord of the Flies (1954) Hemingway's The Old Man and the Sea (1952) Highsmith's Ripley Under Water (1991) Hosseini's A Thousand Splendid Suns (2007) Joyce's Ulysses (1922) Kerouac's On the Road (1957) Orwell's 1984 (1949) Rowling's Harry Potter #7 (2007) Salinger's The Catcher in the Rye (1951) Tolkien's The Lord of the Rings #3 (1955) 75.43% 73.36% 82.93% 76.01% 65.86% 67.54% 46.65% 76.35% 68.23% 69.61% 76.57% 66.60% # tokens English Catalan 2,167 70,285 73,541 7,287 103,306 112,255 5,195 64,634 69,807 1,461 24,233 25,765 5,981 84,339 94,565 6,619 97,728 105,989 11,182 136,250 159,460 5,944 106,409 111,562 4,852 84,062 90,545 10,958 186,624 209,524 5,591 77,717 77,371 6,209 114,847 129,671 Table 2 Percentage of sentences used from the original data set and number of sentences and tokens in the novels that make up the test set. Author Auster Collins Golding Hemingway Highsmith Hosseini Joyce Kerouac Orwell Rowling Salinger Tolkien # Books # sentence pairs # tokens (English) 145,195 216,658 0 0 382,565 105,040 146,525 0 88,372 836,942 141,389 397,328 6,831 15,315 0 0 27,024 7,672 8,762 0 4,068 50,000 8,350 23,713 2 2 0 0 4 1 2 0 2 6 4 3 Table 3 Number of books in the training set, together with their overall number of sentence pairs and source-side tokens for each writer that is also represented in the test set. 3.3 Tools We have leveraged state-of-the-art techniques in the field through the pervasive use of open-source tools throughout the different stages of our experimentation, namely preprocessing, MT experimentation and evaluation, as detailed in the remainder of this section. 3.3.1 Preprocessing The datasets (see Section 3.2) are preprocessed in order to make them suitable for MT. In-domain data is extracted from e-books and converted to plain text with Cali- 8 Antonio Toral and Andy Way bre support tools,8 then sentence-split with NLTK (Bird, 2006) and Freeling (Padr´o and Stanilovsky, 2012) for English and Catalan, respectively, subsequently to- kenised with Moses' scripts and Freeling, for English and Catalan, respectively, and finally sentence-aligned with Hunalign (Varga et al, 2005). Sentence alignment is carried out on lowercased text, in order to reduce data sparsity, with the assistance of a bilingual dictionary extracted from the Catalan–English Apertium rule-based MT system.9 Following empirical observations, we keep aligned sentences with confi- dence scores higher than 0.3 and 0.5 for the training and test sets, respectively. Subsequently, all the datasets are truecased and normalised in terms of punctu- ation with Moses' scripts. Finally, in the parallel training data we discard sentence pairs where either of the sides has fewer than 1 or more than 80 tokens. 3.3.2 MT Toolkits and Evaluation PBSMT systems are trained with version 3 of the Moses toolkit (Koehn et al, 2007), while NMT systems are trained with Nematus (Sennrich et al, 2017).10 For both paradigms default settings are used, unless mentioned otherwise in the description of the experiments (see Sections 4.1 and 4.2 for PBSMT and NMT, respectively). Automatic evaluation is carried out with the BLEU metric and is case-insensitive. Multi-bleu as implemented in Moses 3.0 is used for evaluating the development set while mteval (13a) is used to evaluate the test set. Statistical significance of the difference between systems is computed with paired bootstrap resampling (Koehn, 2004) (p ≤ 0.01, 1000 iterations).11 Human evaluation is ranked-based and is per- formed with the Appraise tool (Federmann, 2012).12 4 MT Systems 4.1 PBSMT System The PBSMT system is trained on both the in-domain and out-of-domain parallel datasets by means of linear interpolation (Sennrich, 2012) and uses three reorder- ing models (lexical- and phrase-based and hierarchical). In addition, the system makes use of additional feature functions based on the operation sequence model (OSM) (Durrani et al, 2011) and language models based not only on surface n-grams but also on continuous space n-grams (NPLM) (Vaswani et al, 2013). The OSM and 8 https://calibre-ebook.com/ 9 http://sourceforge.net/projects/apertium/files/apertium-en-ca/0. 9.3/ 10 https://github.com/rsennrich/nematus 11 http://www.cs.cmu.edu/ark/MT/paired_bootstrap_v13a.tar.gz 12 https://github.com/cfedermann/Appraise What Level of Quality can Neural Machine Translation Attain on Literary Text? 9 NPLM models are built on the in-domain parallel data (both sides in the case of OSM and only the target side for NPLM). The vocabulary size for NPLM is set to 100,000. Surface-form n-gram language models are built on the in-domain and out- domain datasets with KenLM (Heafield, 2011) and then linearly interpolated with SRILM (Stolcke et al, 2002). Tuning is carried out with batch MIRA (Cherry and Foster, 2012). During development we tuned PBSMT systems using different subsets of the components previously introduced in order to assess their effect on translation qual- ity as measured by the BLEU evaluation metric. Table 4 shows the results, where we start with a baseline trained on in-domain data (in) both for the translation model (TM) and the language model (LM) and we measure the effect of the following: • Adding NPLM, both using 4-grams and 5-grams, which results in absolute im- • Adding OSM (+0.4). • Adding linearly interpolated out-domain data both for the TM and the LM provements of 0.57 and 0.75 BLEU points, respectively. (+0.14). TM LM OSM NPLM BLEU - - in 0.3344 - 4-gram 0.3401 in 5-gram 0.3419 - in 5-gram 0.3459 in y inIout inIout y 5-gram 0.3473 in in in in Table 4 Performance of different configurations of the PBSMT system on the development set. 4.2 NMT System Due to the lack of established domain adaptation techniques for NMT at the time when this system was built, our NMT system was trained solely on in-domain data. Specifically, we trained our NMT system on the concatenation of the parallel in- domain training data and a synthetic corpus obtained by machine translating the Catalan in-domain monolingual training data into English. We use additional parallel data in which the source side is synthetic (machine- translated from the target language), as this has been reported to be a successful way of integrating target-language monolingual data into NMT (Sennrich et al, 2015) (see also footnote 25 in Way's chapter in this volume). The in-domain monolingual training data for Catalan is translated into English by means of a Catalan-to-English PBSMT system built for this purpose. This PBSMT system is based on the PBSMT system described in Section 4.1. Aside from reversing the translation direction, this PBSMT system is trained on the same datasets and has the same components, except 10 Antonio Toral and Andy Way for the following, which are not used: out-of-domain training data (both parallel and monolingual) and NPLM. The reason not to use these components has to do with an efficiency versus translation quality trade-off; this system needs to be fast as it is used to translate over 5 million sentences (i.e. the in-domain monolingual training data for Catalan), and taking the example of NPLM, this is a rather computationally expensive component to run. We limit the source and target vocabularies to the 50,000 most frequent tokens in the respective sides of the training data. Training is then run until convergence, with models being saved every 3 hours.13 Each model is evaluated on the development set using BLEU in order to track performance over training time and find out when the training reaches convergence. Figure 1 shows the results. We can observe that performance increases very quickly in the first iterations, going from 0.0251 BLEU points for model 1 (i.e. after 3 hours of training) to 0.2999 for model 12 (i.e. after 36 hours), after which it grows slowly to reach its maximum (0.3356) for model 53 and then plateaus. Fig. 1 BLEU scores obtained by the NMT models on the development set. Each model is saved every 3 hours. 13 Training is performed on an NVIDIA Tesla K20X GPU. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909105101520253035Model numberBLEU What Level of Quality can Neural Machine Translation Attain on Literary Text? 11 We select the 4 models with the highest BLEU scores. These are, in descend- ing order, 53 (0.3356 points), 76 (0.3333), 74 (0.3322) and 69 (0.3314). We trained these models for 12 hours with the embeddings frozen (i.e. the whole network keeps being trained except the first layer (embeddings) which is fixed). We then evaluate ensembles of these 4 models 'as is' as well as with the additional training for 12 hours with fixed embeddings. Their BLEU scores are 0.3561 (2.05 points absolute higher than the best individual system, a 6.1% relative improvement) and 0.3555 (1.99 points absolute higher than the best individual system, 5.9% relative), respec- tively. In other words, ensembling led to a substantial improvement, but fixing em- beddings – reported to provide further improvements in several experiments in the literature – did not increase performance in our setup. Subsequently, we tried to improve upon this NMT system by implementing the following two functionalities: 1. Using subwords rather than words as translation units. Specifically, we seg- mented the training data into characters and performed 90,000 operations jointly on both the source and target languages (Sennrich et al, 2016b). These opera- tions iteratively join the most frequent pair of segments. This results in a score of 0.3689 (1.28 points absolute higher than the initial NMT ensemble, a 3.6% relative improvement). 2. Producing an n-best list and reranking it with a right-to-left NMT system (Sen- nrich et al, 2016a). We trained a so-called right-to-left system, with the same settings and the only difference being that the target sentences of the training data are reversed at the word level. We then produced an n-best list containing the top-50 translations with the previous model and re-ranked it with the right- to-left model. This leads to a BLEU score of 0.3948 (2.59 points higher than the previous system, a 7% relative improvement), and almost 6 BLEU points better (a 17.6% relative improvement) than the best individual system. Due to the fact that we use the same dataset for development in the PBSMT and NMT paradigms, we are able to compare their results. When doing so, however, one should take into account that any such comparison would be unfair in favour of PBSMT. This is because in the development of PBSMT the system is optimis- ing its log-linear weights to obtain the highest performance on the development set. Conversely, in the development of NMT we use the development set for validation, i.e. the system is not optimised on the development set. Despite the bias towards PBSMT, we observe that the score obtained by the best NMT system (0.3948, en- semble, using subword units and re-ranked with a right-to-left model) is notably higher (4.75 points, a 13.7% relative improvement) than the score achieved by the best PBSMT system (0.3473, all components, see Table 4). 12 5 Evaluation 5.1 Automatic Evaluation Antonio Toral and Andy Way As previously mentioned in Section 3.3.2, we automatically evaluate the MT sys- tems using the BLEU metric. Table 5 shows the BLEU scores obtained for each novel in the test set with both PBSMT and NMT. The results across the different novels show a very high degree of variability, indicating that fiction is far from being a monolithic domain. In fact scores go from a low of 0.1611 (PBSMT for Ulysses) to the highest of 0.3892 (NMT for Harry Potter #7), which more than doubles the first figure. As for the performance obtained by the two paradigms that we compare in this chapter, NMT beats PBSMT by a statistically significant margin for all novels. On average, NMT outperforms PBSMT by 10.67% relative and 3 points absolute. The improvement brought about by NMT compared to PBSMT varies widely depending on the book, going from 3.11% (Auster's Sunset Park) to 14% (Collins' Hunger Games #3). Novel Auster's Sunset Park (2010) Collins' Hunger Games #3 (2010) Golding's Lord of the Flies (1954) Hemingway's The Old Man and the Sea (1952) Highsmith's Ripley Under Water (1991) Hosseini's A Thousand Splendid Suns (2007) Joyce's Ulysses (1922) Kerouac's On the Road (1957) Orwell's 1984 (1949) Rowling's Harry Potter #7 (2007) Salinger's The Catcher in the Rye (1951) Tolkien's The Lord of the Rings #3 (1955) Average PBSMT NMT Relative improvement 3.11% 14.00% 11.61% 10.55% 11.15% 8.56% 11.36% 9.98% 11.01% 9.39% 13.52% 13.84% 10.67% 0.3735 0.3851 0.3322 0.3787 0.2196 0.2451 0.2559 0.2829 0.2485 0.2762 0.3422 0.3715 0.1611 0.1794 0.3248 0.3572 0.2978 0.3306 0.3558 0.3892 0.3255 0.3695 0.2537 0.2888 0.2909 0.3212 Table 5 BLEU scores obtained by PBSMT and NMT for each of the books that make up the test set. NMT outperforms PBSMT by a statistically significant margin (p < 0.01) on all the books. 5.1.1 Analysis We performed a set of additional analyses in order to obtain further insights from the output translations and, especially to try to find the reason why NMT, while outperforming PBSMT for all the novels, does so by rather diverging margins (from a minimum of 3.11% to a maximum of 14%, see Table 5). More specifically, we considered three characteristics of the source-side of each novel in the test set (lexical richness, novelty with respect to the training data, and What Level of Quality can Neural Machine Translation Attain on Literary Text? 13 average sentence length) and studied whether any of these features correlates to some extent with the performance of the PBSMT and NMT systems and/or with the relative improvement of NMT over PBSMT. The motivation to use these three features is as follows: • Lexical richness has been already studied in relation to NMT, and there are indications that this MT paradigm has "an edge especially on lexically rich texts" (Bentivogli et al, 2016). • There is evidence that NMT's performance degrades with sentence length (Toral • Despite, to the best of our knowledge, the lack of empirical evidence, it is still the perceived wisdom that NMT is better at generalising than PBSMT, and so it should perform better than the latter especially on data that is unrelated to the training data. and S´anchez-Cartagena, 2017). Lexical richness We use type-token ratio (TTR) as a proxy to measure lexical richness. The higher the ratio, the less repetitive the text and hence it can be considered lexically more varied, and thus richer. To measure this we calculate the TTR on the source side of each novel. As they have different sizes, we calculate the TTR for each novel on a random subset of sentences that amount to approximately n words, n being 20,000, a slightly lower number to the number of words contained in the smallest novel in our dataset, The Old Man and the Sea with 24,233 words. Sentence length We measure the average sentence length of each novel as the ratio between its total number of tokens and its number of sentences. Both these values were reported in Table 2. Novelty with respect to the training data We use n-gram overlap to measure the novelty of a novel with respect to the training data. Concretely, we consider the unique n-grams (n = 4) in the parallel training data and in each novel, and calculate the overlap as the ratio between the size of the intersection and the number of unique n-grams in the training set. The higher the overlap, the less novelty that the novel presents with respect to the training data. As in the analysis concerning lexical richness, we consider 20,000 words from ran- domly selected sentences for each novel. 14 Results Antonio Toral and Andy Way Table 6 shows the values for each novel and for each of the three features analysed. We can clearly observe an outlier in the data for all the three variables reported. Ulysses has the highest TTR by far at 0.276 and is also the novel with the lowest overlap by a wide margin (0.216). As for sentence length, the value for Sunset Park (32.434) is over 10 points higher than the value for any other novel. TTR avg. sentence Overlap Novel Auster's Sunset Park (2010) 0.368 0.1865 Collins' Hunger Games #3 (2010) 0.1716 0.393 Golding's Lord of the Flies (1954) 0.370 0.1368 Hemingway's The Old Man and the Sea (1952) 0.1041 0.371 Highsmith's Ripley Under Water (1991) 0.404 0.1492 Hosseini's A Thousand Splendid Suns (2007) 0.377 0.1840 0.2761 0.216 Joyce's Ulysses (1922) Kerouac's On the Road (1957) 0.335 0.1765 Orwell's 1984 (1949) 0.343 0.1831 Rowling's Harry Potter #7 (2007) 0.433 0.1665 Salinger's The Catcher in the Rye (1951) 0.448 0.1040 Tolkien's The Lord of the Rings #3 (1955) 0.1436 0.368 length 32.434 14.177 12.442 16.587 14.101 14.765 12.185 17.902 17.325 17.031 13.900 18.497 Table 6 TTR, average sentence length and 4-gram overlap for the source side of the 12 novels that make up the test set. The highest TTR and average sentence length as well as the lowest n-gram overlap values are shown in bold. Table 7 shows the significant correlations between the BLEU scores (for PBSMT, NMT and the relative difference between both, see Table 5) and the three variables analysed (TTR, average sentence length and n-gram overlap). Each of the significant correlations is then plotted, including its regression line and its 95% confidence region, in Figures 2, 3 and 4. BLEU TTR avg. sentence PBSMT - - NMT rel. diff - ρ=-0.4514, p=0.07 length - - Overlap r=0.62, p < 0.05 r=0.66, p < 0.01 - Table 7 Correlations between the BLEU scores for NMT, PBSMT and their relative difference and the other metrics considered (TTR, average sentence length and 4-gram overlap) for the 12 novels that make up the test set. Empty cells mean that no significant correlation was found. 14 A significant parametric Pearson correlation was found (r =−0.78, p < 0.01) but the assumption that both variables come from a bivariate normal distribution was not met, hence the reason why a non-parametric Spearman correlation is shown instead. What Level of Quality can Neural Machine Translation Attain on Literary Text? 15 While Bentivogli et al (2016) found a moderate correlation (r = 0.73) between TTR and the gains by NMT over PBSMT (measured with mTER – multi-reference TER (Snover et al, 2006) – on transcribed speeches), there is no significant correla- tion in our setup. With respect to sentence length (see Figure 2), we observe a negative correla- tion (ρ = −0.45), meaning that the relative improvement of NMT over PBSMT de- creases with sentence length. This corroborates the findings in previous work (Toral and S´anchez-Cartagena, 2017) and appears to be the main reason behind the low relative improvement that NMT achieved for Sunset Park (see Table 5), as the aver- age sentence length for this novel is very long compared to all the other novels in our test set (see Table 6). Fig. 2 Spearman correlation between the relative difference between the BLEU scores of the NMT and PBSMT systems and sentence length. Finally, we found significant positive correlations between the performance of both PBSMT and NMT and n-gram overlap, the Pearson correlation coefficient be- ing r = 0.62 (see Figure 3) and r = 0.66 (see Figure 4), respectively. This matches the intuition that the performance of a statistical MT system should be better the more the test set resembles the training data. That said, we did not find significant correlations between the relative improvement of NMT over PBSMT and overlap. Thus, the perceived wisdom that the more unrelated the data to be translated from the test set the wider the gap between NMT and PBSMT, does not hold for our setup. llllllllllll05102.55.07.510.012.5Rank of the relative difference between the BLEU scores of NMT and PBSMTRank of the sentence length 16 Antonio Toral and Andy Way Fig. 3 Pearson correlation between the the BLEU score of the PBSMT system and 4-gram overlap. Fig. 4 Pearson correlation between the the BLEU score of the NMT system and 4-gram overlap. 5.2 Human Evaluation We also conducted a manual evaluation, in order to gain further insights. A common procedure (e.g. conducted in the annual MT shared task at WMT)15 consists of ranking the translations produced by different MT systems (see also Section 3.4 in Catilho et al. in this volume). Given the source and target sides of the reference (human) translations, and two or more outputs from MT systems, these outputs are ranked according to their quality, e.g. in terms of adequacy and/or fluency. In our experiment, we are not only interested in comparing two MT systems – PBSMT and NMT – to each other, but also with respect to the human reference 15 e.g. http://www.statmt.org/wmt17/translation-task.html llllllllllll0.30.40.200.250.300.35BLEU (PBSMT)Overlap (n=4)llllllllllll0.250.300.350.400.450.200.250.300.35BLEU (NMT)Overlap (n=4) What Level of Quality can Neural Machine Translation Attain on Literary Text? 17 translation. Hence, we conduct the rank-based manual evaluation in a slightly mod- ified setting; we do not provide the target of the reference translation as reference but as one of the translations to be ranked. The evaluator thus is provided with the source-side of the reference and three translations, one being the human translation and the other two the translations produced by the PBSMT and NMT systems. The evaluator of course does not know which is which. Moreover, in order to avoid any bias with respect to MT, they are not told whether the translations are human or automatic. This human evaluation is conducted for three of the books used in the automatic evaluation: Orwell's 1984, Rowling's Harry Potter #7 and Salinger's The Catcher in the Rye. For each of these books, the sentences in 10 randomly selected passages were ranked. Each passage is made of 10 contiguous sentences, the motivation be- ing to provide the annotator with context beyond the sentence level. Therefore, sen- tences 1 to 10 (passage 1) are contiguous in the book, then there is a jump to a second passage contained in sentences 11 to 20, and so forth. All the annotations were carried out by two native Catalan speakers with an ad- vanced level of English. They both have a background in linguistics but no in-depth knowledge of statistical MT (again, to avoid any bias with respect to MT). Com- prehensive instructions were provided to the evaluators in their native language, in order to minimise ambiguity and thus foster high inter-annotator agreement. Here we reproduce the translation into English of the evaluation instructions: Given three translations, the task is to rank them: equivalent quality. translation is better than the second. • Rank a translation A higher (rank 1) than a translation B (rank 2), if the first • Rank two translations A and B equally (rank 1 for both A and B), if both have an • Use the highest rank possible, e.g. if there are three translations A, B and C, and the quality of A and B is equivalent and both are better than C, then they should be ranked as follows: A = rank 1, B = rank 1, C = rank 2. Do NOT use lower rankings, e.g.: A = rank 2, B = rank 2, C = rank 3. Please follow the following guidelines to decide that a translation is better than tion is preserved and, if possible, the translation sounds natural. another: • Above anything else: the meaning of the original is understood, all the informa- • If all translations preserve the meaning to a similar extent, you might compare • If for a given set of translations, you cannot decide how to rank them, you can the number of errors (e.g. lexical, syntax, etc) in each translation. skip that set by pressing the button "flag error". Figure 5 shows a snapshot of the manual evaluation process. In this example the annotator is asked to rank three translations for the second sentence from the first passage of Salinger's The Catcher in the Rye. 18 Antonio Toral and Andy Way Fig. 5 Snapshot from the manual evaluation process. 5.2.1 Inter-annotator Agreement The inter-annotator agreement in terms of Fleiss' Kappa (Fleiss, 1971) is 0.22 for Orwell, 0.18 for Rowling and 0.38 for Salinger. The values for Orwell and Salinger fall in the band of fair agreement [0.21,0.4] (Landis and Koch, 1977) while that for Rowling is at the higher end of slight agreement [0.01,0.2]. For the sake of compar- ison, the average inter-annotator agreement at WMT for the closest language direc- tion to ours (English-to-French) over the last four editions in which that language direction was considered is 0.29, see Table 4 in Bojar et al (2016). 5.2.2 Pairwise Rankings From the sets of annotations (rankings between three translations), we extract all the pairwise rankings, i.e. the rankings for each pair of translations. Given two transla- tions A and B, the pairwise ranking will be A > B if translation A was ranked higher than B, A < B if A was ranked lower than B, and A = B if both were ranked equally. It is worth mentioning that while the PBSMT translations consistently cover the source sentences, this is not always the case for the other two translations. NMT has a tendency towards omission errors (Klubicka et al, 2017). The human trans- lation sometimes does not cover the source sentence fully either. This may be due to a choice of the translator, e.g. to translate the sentence in a way that diverges notably from the source. There are also some cases where the human translation What Level of Quality can Neural Machine Translation Attain on Literary Text? 19 is misaligned16 and so it is unrelated to the source sentence. Most cases in which the human translation is ranked lower than MT (PBSMT or NMT) are due to either of these two reasons. It is clearly unjustifiable to rank the human translation lower than MT in these cases, so we remove these pairwise rankings, i.e. A < B where A is the human translation and B corresponds to the translation produced by either MT system.17 Figures 6, 7 and 8 show the pairwise rankings between each MT system and the human translation (HT) for Orwell's, Rowling's and Salinger's books. In all three books, the percentage of sentences where the annotators perceive the MT translation to be of equivalent quality to the human translation is considerably higher for NMT compared to PBSMT: 16.7% vs 7.5% for Orwell's, 31.8% vs 18.1% for Rowling's and 34.3% vs 19.8% for Salinger's. In other words, if NMT translations were to be used to assist a professional translator (e.g. by means of post-editing), then around one third of the sentences for Rowling's and Salinger's and one sixth for Orwell's would not need any correction. Fig. 6 Pairwise rankings between HT and MT for Orwell's 1984. Having looked at pairwise rankings between MT and human translations, we move our attention now to the pairwise rankings between the two types of MT sys- tems. The results for all three books are depicted in Figure 9. In all the books the trends are similar. The biggest chunk (41.4%, 54.7%) corresponds to cases where NMT translations are ranked higher than PBSMT's (PBSMT<NMT). The second relates to translations by both systems which are ranked equally (27.8%, 39.4%), 16 As mentioned in Section 3.3.1, the source novels and their human translations were sentence- aligned automatically. The empirically set confidence threshold results in most alignments being correct, but some are erroneous. 17 While the majority of HT<MT cases are unjustified, not all of them are. By removing these rankings, the results are slightly biased in favour of HT and thus overly conservative with respect to the potential of MT. NMTPBMT0%10%20%30%40%50%60%70%80%90%100%83.3%92.5%16.7%7.5%HT=MTHT>MTTranslation 20 Antonio Toral and Andy Way Fig. 7 Pairwise rankings between HT and MT for Rowling's Harry Potter #7. Fig. 8 Pairwise rankings between HT and MT for Salinger's The Catcher in the Rye. PBSMT=NMT). Finally, the smallest chunk (less than 20% in all three books) sig- nifies translations for which PBSMT is ranked higher than NMT (PBSMT>NMT). 5.2.3 Overall Human Scores In addition to the pairwise rankings, we derive an overall score for each translation type (HT, NMT and PBSMT) and novel based on the rankings. To this end we use the TrueSkill method adapted to MT evaluation (Sakaguchi et al, 2014) following its usage at WMT15.18 Namely, we run 1,000 iterations of the rankings recorded with Appraise followed by clustering (p < 0.05). 18 https://github.com/mjpost/wmt15 NMTPBMT0%10%20%30%40%50%60%70%80%90%100%68.2%81.9%31.8%18.1%HT=MTHT>MTTranslationNMTPBMT0%10%20%30%40%50%60%70%80%90%100%65.7%80.2%34.3%19.8%HT=MTHT>MTTranslation What Level of Quality can Neural Machine Translation Attain on Literary Text? 21 Fig. 9 Pairwise rankings between PBSMT and NMT. Figure 10 depicts the results. For all the three books considered, all the translation types are put in different clusters, meaning that the differences between every pair of translation types are significant. The ordering of the translation types corroborates that seen in the pairwise analysis (see Section 5.2.2), namely human translations come on top, followed by NMT outputs and finally, in third place, PBSMT outputs. Fig. 10 Overall human evaluation scores with TrueSkill. If we consider PBSMT's score as a baseline, the score given to the human trans- lations as a gold standard, and the distance between the two as the potential room for improvement for MT, we could interpret NMT's score as the progress made in our journey towards better translation quality for novels, departing from PBSMT and Orwell'sRowling'sSalinger's0%10%20%30%40%50%60%70%80%90%100%17.5%17.0%19.2%27.8%37.6%39.4%54.7%45.4%41.4%PBSMT<NMTPBSMT=NMTPBSMT>NMTBookOrwell'sRowling'sSalinger's-4.00-3.00-2.00-1.000.001.002.003.004.005.004.243.413.46-1.39-1.05-1.20-2.78-2.31-2.21HTNMTPBSMTNovelTrueSkill score 22 Antonio Toral and Andy Way targeting human translations as the goal to be reached ultimately. Using this anal- ogy, although there is still a long way to go, with NMT we have covered already a considerable part of the journey: 20%, 22% and 18% for Orwell's, Rowling's and Salinger's books, respectively. 6 Conclusions and Future Work This chapter has assessed the quality attainable for novels by the two most com- mon paradigms to MT at present, NMT and PBSMT. To this end, we built the first in-domain PBSMT and NMT systems for literary text by training them on large amounts of parallel novels. We then automatically evaluated the translation quality of the resulting systems on a set of 12 widely known novels spanning from the 1920s to the present day. The results proved favourable for NMT, which outperformed PB- SMT by a significant margin for all the 12 novels. We then delved deeper into the results by analysing the effect of three features of each novel: its lexical richness, its degree of novelty with respect to the training data, and its average sentence length. Only for the last feature did we find a meaningful correlation against NMT relative improvement over PBSMT, which corroborates the tendency for improvements in NMT over PBSMT to decrease with sentence length. This seems to be the main reason behind NMT achieving a relatively low improvement over PBSMT for one of the novels, but we note that particular novel to be an outlier in terms of sentence length. We have also conducted a human evaluation, where we manually ranked the translations produced by NMT, PBSMT, as well as the human translations for three of the books. Again, NMT outperformed PBSMT. For two out of the three books native speakers perceived NMT translations to be of equivalent quality to those of human translations in around one third of the cases (one sixth for PBSMT). As for future work, we would like to assess the feasibility of using MT to assist with the translation of literary text. To that end, we plan to carry out an experiment in which we integrate MT into the workflow of professional literary translators by means of post-editing and assess its impact in the translation process (e.g. temporal and technical effort) as well as in the translation result (e.g. quality and reading experience of the resulting translation). References Bentivogli L, Bisazza A, Cettolo M, Federico M (2016) Neural versus phrase-based machine translation quality: a case study. In: Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, Texas, pp 257– 267, URL https://aclweb.org/anthology/D16-1025 What Level of Quality can Neural Machine Translation Attain on Literary Text? 23 Besacier L (2014) Traduction automatis´ee d'une oeuvre litt´eraire: une ´etude pi- lote. In: Traitement Automatique du Langage Naturel (TALN), Marseille, France, URL http://hal.inria.fr/hal-01003944 Bird S (2006) Nltk: the natural language toolkit. In: Proceedings of the COL- ING/ACL on Interactive presentation sessions, pp 69–72 Bojar O, Chatterjee R, Federmann C, Graham Y, Haddow B, Huck M, Jimeno Yepes A, Koehn P, Logacheva V, Monz C, Negri M, Neveol A, Neves M, Popel M, Post M, Rubino R, Scarton C, Specia L, Turchi M, Verspoor K, Zampieri M (2016) Findings of the 2016 Conference on Machine Translation. In: Proceedings of the First Conference on Machine Translation, Berlin, Germany, pp 131–198, URL http://www.aclweb.org/anthology/W/W16/W16-2301 Cherry C, Foster G (2012) Batch tuning strategies for statistical machine translation. In: Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp 427–436 Durrani N, Schmid H, Fraser A (2011) A joint sequence translation model with integrated reordering. In: Proceedings of the 49th Annual Meeting of the Associ- ation for Computational Linguistics: Human Language Technologies-Volume 1, pp 1045–1054 Federmann C (2012) Appraise: An open-source toolkit for manual evaluation of ma- chine translation output. The Prague Bulletin of Mathematical Linguistics 98:25– 35 Fleiss JL (1971) Measuring nominal scale agreement among many raters. Psycho- logical Bulletin 76(5):378–382 Forcada ML, Neco RP (1997) Recursive hetero-associative memories for transla- tion, Springer Berlin Heidelberg, Berlin, Heidelberg, pp 453–462. DOI 10.1007/ BFb0032504, URL https://doi.org/10.1007/BFb0032504 Genzel D, Uszkoreit J, Och F (2010) "Poetic" Statistical Machine Translation: Rhyme and Meter. In: Proceedings of the 2010 Conference on Empirical Meth- ods in Natural Language Processing, EMNLP '10, pp 158–166, URL http: //dl.acm.org/citation.cfm?id=1870658.1870674 Greene E, Bodrumlu T, Knight K (2010) Automatic analysis of rhythmic poetry with applications to generation and translation. In: Proceedings of the 2010 conference on empirical methods in natural language processing, pp 524–533 Hardmeier C (2014) Discourse in statistical machine translation Heafield K (2011) Kenlm: Faster and smaller language model queries. In: Proceed- ings of the Sixth Workshop on Statistical Machine Translation, pp 187–197 Jones R, Irvine A (2013) The (un)faithful machine translator. In: Proceedings of the 7th Workshop on Language Technology for Cultural Heritage, Social Sciences, and Humanities, pp 96–101 Junczys-Dowmunt M, Dwojak T, Hoang H (2016) Is neural machine translation ready for deployment? a case study on 30 translation directions. In: Arxiv, URL https://arxiv.org/abs/1610.01108 24 Antonio Toral and Andy Way Klubicka F, Toral A, S´anchez-Cartagena VM (2017) Fine-Grained Human Evalua- tion of Neural Versus Phrase-Based Machine Translation. The Prague Bulletin of Mathematical Linguistics (108):121–132 Koehn P (2004) Statistical significance tests for machine translation evaluation. In: Proceedings of the Conference on Empirical Methods in Natural Language Pro- cessing, Barcelona, Spain, vol 4, pp 388–395 Koehn P, Hoang H, Birch A, Callison-Burch C, Federico M, Bertoldi N, Cowan B, Shen W, Moran C, Zens R, Dyer C, Bojar O, Constantin A, Herbst E (2007) Moses: Open source toolkit for statistical machine translation. In: Proceedings of the 45th Annual Meeting of the ACL on Interactive Poster and Demonstration Sessions, Prague, Czech Republic, pp 177–180 Landis RJ, Koch GG (1977) The measurement of observer agreement for categorical data. Biometrics 33(1):159 – 174 Li L, Sporleder C (2010) Using gaussian mixture models to detect figurative lan- guage in context. In: Human Language Technologies: The 2010 Annual Con- ference of the North American Chapter of the Association for Computational Linguistics, HLT '10, pp 297–300, URL http://dl.acm.org/citation. cfm?id=1857999.1858038 Ljubesi´c N, Toral A (2014) caWaC - a Web Corpus of Catalan and its Application to Language Modeling and Machine Translation. In: Proceedings of the Ninth In- ternational Conference on Language Resources and Evaluation (LREC'14), Eu- ropean Language Resources Association (ELRA), Reykjavik, Iceland Luong MT, Manning CD (2015) Stanford neural machine translation systems for spoken language domain. In: International Workshop on Spoken Language Trans- lation Padr´o L, Stanilovsky E (2012) Freeling 3.0: Towards wider multilinguality. In: LREC2012 Papineni K, Roukos S, Ward T, Zhu WJ (2002) Bleu: A method for auto- matic evaluation of machine translation. In: Proceedings of the 40th An- nual Meeting on Association for Computational Linguistics, ACL '02, pp 311–318, DOI 10.3115/1073083.1073135, URL http://dx.doi.org/10. 3115/1073083.1073135 Pecina P, Toral A, Papavassiliou V, Prokopidis P, Tamchyna A, Way A, van Genabith J (2014) Domain adaptation of statistical machine translation with domain-focused web crawling. Language Resources and Evaluation 49(1), DOI 10.1007/s10579-014-9282-3 Reyes A (2013) Linguistic-based patterns for figurative language processing: The case of humor recognition and irony detection. Procesamiento del Lenguaje Natu- ral 50:107–109, URL http://journal.sepln.org/sepln/ojs/ojs/ index.php/pln/article/view/4666 Sakaguchi K, Post M, Van Durme B (2014) Efficient Elicitation of Annotations for Human Evaluation of Machine Translation. In: Proceedings of WMT, pp 1–11 S´anchez-Cartagena VM, Toral A (2016) Abu-matran at wmt 2016 translation task: Deep learning, morphological segmentation and tuning on character se- quences. In: Proceedings of the First Conference on Machine Translation, Berlin, What Level of Quality can Neural Machine Translation Attain on Literary Text? 25 Germany, pp 362–370, URL http://www.aclweb.org/anthology/W/ W16/W16-2322 Sennrich R (2012) Perplexity minimization for translation model domain adap- tation in statistical machine translation. In: Proceedings of the 13th Confer- ence of the European Chapter of the Association for Computational Linguistics, EACL '12, pp 539–549, URL http://dl.acm.org/citation.cfm?id= 2380816.2380881 Sennrich R, Haddow B, Birch A (2015) Improving Neural Machine Translation Models with Monolingual Data. arXiv preprint arXiv:151106709 Sennrich R, Haddow B, Birch A (2016a) Edinburgh Neural Machine Translation Systems for WMT 16. In: Proceedings of the First Conference on Machine Trans- lation, Berlin, Germany, pp 371–376, URL http://www.aclweb.org/ anthology/W/W16/W16-2323 Sennrich R, Haddow B, Birch A (2016b) Neural machine translation of rare words with subword units. In: Proceedings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 1: Long Papers), Berlin, Germany, pp 1715–1725, URL http://www.aclweb.org/anthology/P16-1162 Sennrich R, Firat O, Cho K, Birch A, Haddow B, Hitschler J, Junczys-Dowmunt M, L"aubli S, Miceli Barone AV, Mokry J, Nadejde M (2017) Nematus: a Toolkit for Neural Machine Translation. In: Proceedings of the Demonstrations at the 15th Conference of the European Chapter of the Association for Computational Linguistics, Valencia, Spain Shutova E, Teufel S, Korhonen A (2013) Statistical metaphor processing. Comput Linguist 39(2):301–353 Snover M, Dorr B, Schwartz R, Micciulla L, Makhoul J (2006) A study of trans- lation edit rate with targeted human annotation. In: AMTA 2006: Proceedings of the 7th Conference of the Association for Machine Translation in the Ameri- cas, "Visions for the Future of Machine Translation", Cambridge, Massachusetts, USA, pp 223–231 Stolcke A, et al (2002) Srilm-an extensible language modeling toolkit. In: Inter- speech, vol 2002, p 2002 Toral A, S´anchez-Cartagena VM (2017) A multifaceted evaluation of neural ver- sus phrase-based machine translation for 9 language directions. In: Proceedings of the 15th Conference of the European Chapter of the Association for Com- putational Linguistics: Volume 1, Long Papers, pp 1063–1073, URL http: //www.aclweb.org/anthology/E17-1100 Toral A, Way A (2015a) Machine-assisted translation of literary text: A case study. Translation Spaces 4:241–268 Toral A, Way A (2015b) Translating Literary Text between Related Languages us- ing SMT. In: Proceedings of the Fourth Workshop on Computational Linguis- tics for Literature, Denver, Colorado, USA, pp 123–132, URL http://www. aclweb.org/anthology/W15-0714 Varga D, Hala´acsy P, Kornai A, Nagy V, N´emeth L, Tr´on V (2005) Parallel corpora for medium density languages. In: Proceedings of the RANLP 2005 Conference, pp 590–596 26 Antonio Toral and Andy Way Vaswani A, Zhao Y, Fossum V, Chiang D (2013) Decoding with large-scale neural language models improves translation. In: EMNLP, Citeseer, pp 1387–1392 Voigt R, Jurafsky D (2012) Proceedings of the NAACL-HLT 2012 Workshop on Computational Linguistics for Literature, chap Towards a Literary Ma- chine Translation: The Role of Referential Cohesion, pp 18–25. URL http: //aclweb.org/anthology/W12-2503 Acknowledgements Carme Armentano and ´Alvaro Bell´on ranked the translations used for the human evaluation. The research leading to these results has received funding from the European Association for Machine Translation through its 2015 sponsorship of activities programme (project PiPeNovel). The second author is supported by the ADAPT Centre for Digital Content Technology, funded under the SFI Research Centres Programme (Grant 13/RC/2106).We would like to thank the Center for Information Technology of the University of Groningen and the Irish Centre for High-End Computing (http://www.ichec.ie) for providing computational infrastructure.
1902.08850
3
1902
2019-05-06T05:19:39
Vector of Locally-Aggregated Word Embeddings (VLAWE): A Novel Document-level Representation
[ "cs.CL" ]
In this paper, we propose a novel representation for text documents based on aggregating word embedding vectors into document embeddings. Our approach is inspired by the Vector of Locally-Aggregated Descriptors used for image representation, and it works as follows. First, the word embeddings gathered from a collection of documents are clustered by k-means in order to learn a codebook of semnatically-related word embeddings. Each word embedding is then associated to its nearest cluster centroid (codeword). The Vector of Locally-Aggregated Word Embeddings (VLAWE) representation of a document is then computed by accumulating the differences between each codeword vector and each word vector (from the document) associated to the respective codeword. We plug the VLAWE representation, which is learned in an unsupervised manner, into a classifier and show that it is useful for a diverse set of text classification tasks. We compare our approach with a broad range of recent state-of-the-art methods, demonstrating the effectiveness of our approach. Furthermore, we obtain a considerable improvement on the Movie Review data set, reporting an accuracy of 93.3%, which represents an absolute gain of 10% over the state-of-the-art approach. Our code is available at https://github.com/raduionescu/vlawe-boswe/.
cs.CL
cs
Vector of Locally-Aggregated Word Embeddings (VLAWE): A Novel Document-level Representation Radu Tudor Ionescu and Andrei M. Butnaru University of Bucharest Department of Computer Science 14 Academiei, Bucharest, Romania [email protected] 9 1 0 2 y a M 6 ] L C . s c [ 3 v 0 5 8 8 0 . 2 0 9 1 : v i X r a [email protected] Abstract In this paper, we propose a novel representa- tion for text documents based on aggregating word embedding vectors into document em- beddings. Our approach is inspired by the Vec- tor of Locally-Aggregated Descriptors used for image representation, and it works as fol- lows. First, the word embeddings gathered from a collection of documents are clustered by k-means in order to learn a codebook of semnatically-related word embeddings. Each word embedding is then associated to its near- est cluster centroid (codeword). The Vec- tor of Locally-Aggregated Word Embeddings (VLAWE) representation of a document is then computed by accumulating the differ- ences between each codeword vector and each word vector (from the document) associated to the respective codeword. We plug the VLAWE representation, which is learned in an unsuper- vised manner, into a classifier and show that it is useful for a diverse set of text classifi- cation tasks. We compare our approach with a broad range of recent state-of-the-art meth- ods, demonstrating the effectiveness of our ap- proach. Furthermore, we obtain a considerable improvement on the Movie Review data set, reporting an accuracy of 93.3%, which repre- sents an absolute gain of 10% over the state- of-the-art approach. Our code is available at https://github.com/raduionescu/vlawe-boswe/. Introduction 1 In recent years, word embeddings (Bengio et al., 2003; Collobert and Weston, 2008; Mikolov et al., 2013; Pennington et al., 2014) have had a huge impact in natural language processing (NLP) and related fields, being used in many tasks includ- ing sentiment analysis (Dos Santos and Gatti, 2014; Fu et al., 2018), information retrieval (Clin- chant and Perronnin, 2013; Ye et al., 2016) and word sense disambiguation (Bhingardive et al., 2015; Butnaru et al., 2017; Chen et al., 2014; Ia- cobacci et al., 2016), among many others. Start- ing from word embeddings, researchers proposed various ways of aggregating word embedding vec- tors to obtain efficient sentence-level or document- level representations (Butnaru and Ionescu, 2017; Cheng et al., 2018; Clinchant and Perronnin, 2013; Conneau et al., 2017; Cozma et al., 2018; Fu et al., 2018; Hill et al., 2016; Kiros et al., 2015; Kusner et al., 2015; Le and Mikolov, 2014; Shen et al., 2018; Torki, 2018; Zhao et al., 2015; Zhou et al., 2016, 2018). Although the mean (or sum) of word vectors is commonly adopted because of its simplicity (Mitchell and Lapata, 2010), it seems that more complex approaches usually yield better performance (Cheng et al., 2018; Conneau et al., 2017; Cozma et al., 2018; Fu et al., 2018; Hill et al., 2016; Kiros et al., 2015; Torki, 2018; Zhao et al., 2015; Zhou et al., 2016, 2018). To this end, we propose a simple yet effective approach for aggregating word embeddings into document embeddings. Our approach is inspired by the Vec- tor of Locally-Aggregated Descriptors (VLAD) (J´egou et al., 2010, 2012) used in computer vision to efficiently represent images for various image classification and retrieval tasks. To our knowl- edge, we are the first to adapt and use VLAD in the text domain. Our document-level representation is con- structed as follows. First, we apply a pre-trained word embedding model, such as GloVe (Penning- ton et al., 2014), on all the words from a set of training documents in order to obtain a set of train- ing word vectors. The word vectors are clus- tered by k-means in order to learn a codebook of semnatically-related word embeddings. Each word embedding is then associated to its near- est cluster centroid (codeword). The Vector of Locally-Aggregated Word Embeddings (VLAWE) representation of a text document is then com- puted by accumulating the differences between each codeword vector and each word vector that is both present in the document and associated to the respective codeword. Since our approach considers cluster centroids as reference for build- ing the representation, it can easily accommodate new words, not seen during k-means training, sim- ply by associating them to the nearest cluster cen- troids. Thus, VLAWE is robust to vocabulary dis- tribution gaps between training and test, which can appear when the training set is particularly smaller or from a different domain. Certainly, the robust- ness holds as long as the word embeddings are pre- trained on a very large set of documents, e.g. the entire Wikipedia. We plug the VLAWE representation, which is learned in an unsupervised manner, into a classi- fier, namely Support Vector Machines (SVM), and show that it is useful for a diverse set of text clas- sification tasks. We consider five benchmark data sets: Reuters-21578 (Lewis, 1997), RT-2k (Pang and Lee, 2004), MR (Pang and Lee, 2005), TREC (Li and Roth, 2002) and Subj (Pang and Lee, 2004). We compare VLAWE with recent state- of-the-art methods (Butnaru and Ionescu, 2017; Cheng et al., 2018; Fu et al., 2018; Hill et al., 2016; Iyyer et al., 2015; Kim, 2014; Kiros et al., 2015; Le and Mikolov, 2014; Liu et al., 2017; Shen et al., 2018; Torki, 2018; Xue and Zhou, 2009; Zhao et al., 2015; Zhou et al., 2016, 2018), demonstrat- ing the effectiveness of our approach. Further- more, we obtain a considerable improvement on the Movie Review (MR) data set, surpassing the state-of-the-art approach of Cheng et al. (2018) by almost 10%. The rest of the paper is organized as follows. We present related works on learning document- level representations in Section 2. We describe the Vector of Locally-Aggregated Word Embeddings in Section 3. We present experiments and results on various text classification tasks in Section 4. Fi- nally, we draw our conclusion in Section 5. 2 Related Work There are various works (Butnaru and Ionescu, 2017; Cheng et al., 2018; Conneau et al., 2017; Fu et al., 2018; Hill et al., 2016; Iyyer et al., 2015; Kim, 2014; Kiros et al., 2015; Kusner et al., 2015; Le and Mikolov, 2014; Clinchant and Perronnin, 2013; Shen et al., 2018; Torki, 2018; Zhao et al., 2015; Zhou et al., 2018) that propose to build ef- fective sentence-level or document-level represen- tations based on word embeddings. While most of these approaches are based on deep learning (Cheng et al., 2018; Conneau et al., 2017; Hill et al., 2016; Iyyer et al., 2015; Kim, 2014; Kiros et al., 2015; Le and Mikolov, 2014; Zhao et al., 2015; Zhou et al., 2018), there have been some ap- proaches that are inspired by computer vision re- search, namely by the bag-of-visual-words (But- naru and Ionescu, 2017) and by Fisher Vectors (Clinchant and Perronnin, 2013). The relationship between the bag-of-visual-words, Fisher Vectors and VLAD is discussed in (J´egou et al., 2012). The discussion can be transferred to describe the relantionship of our work and the closely-related works of Butnaru and Ionescu (2017) and Clin- chant and Perronnin (2013). 3 Method The Vector of Locally-Aggregated Descriptors (VLAD) (J´egou et al., 2010, 2012) was introduced in computer vision to efficiently represent images for various image classification and retrieval tasks. We propose to adapt the VLAD representation in order to represent text documents instead of im- ages. Our adaptation consists of replacing the Scale-Invariant Feature Transform (SIFT) image descriptors (Lowe, 2004) useful for recognizing object patterns in images with word embeddings (Mikolov et al., 2013; Pennington et al., 2014) useful for recognizing semantic patterns in text documents. We coin the term Vector of Locally- Aggregated Word Embeddings (VLAWE) for the resulting document representation. The VLAWE representation is derived as fol- lows. First, each word in the collection of training documents is represented as a word vector using a pre-trained word embeddings model. The result is a set X = {x1, x2, ..., xn} of n word vectors. As for the VLAD model, the next step is to learn a codebook {µ1, µ2, ..., µk} of representative meta- word vectors (codewords) using k-means. Each codeword µi is the centroid of the cluster Ci ⊂ X: (cid:88) xt∈Ci µi = 1 Ci xt,∀i ∈ {1, 2, ..., k}, (1) where Ci is the number of word vectors assigned to cluster Ci and k is the number of clusters. Since word embeddings carry semantic informa- tion by projecting semantically-related words in the same region of the embedding space, it means that the resulting clusters contain semantically- related words. The formed centroids are stored in a randomized forest of k-d trees to reduce search cost, as described in (Philbin et al., 2007; Ionescu et al., 2013; Ionescu and Popescu, 2014, 2015a). Each word embedding xt is associated to a sin- gle cluster Ci, such that the Euclidean distance between xt and the corresponding codeword µi is minimum, for all i ∈ {1, 2, ..., k}. For each doc- ument D and each codeword µi, the differences xt − µi of the vectors xt ∈ Ci ∩ D and the code- word µi are accumulated into column vectors: xt − µi, vi,D = xt∈Ci∩D (2) where D ⊂ X is the set of word embeddings in a given text document. The final VLAWE em- bedding for a given document D is obtained by stacking together the d-dimensional residual vec- tors vi,D, where d is equal to the dimension of the word embeddings: (cid:88)  . v1,D v2,D ... vk,D φD = (3) Therefore, the VLAWE document embedding is has k · d components. The VLAWE vector φD undergoes two normal- ization steps. First, a power normalization is per- formed by applying the following operator inde- pendently on each component (element): f (z) = sign(z) · zα, (4) where 0 ≤ α ≤ 1 and z is the absolute value of z. Since words in natural language follow the Zipf's law (Powers, 1998), it seems natural to apply the power normalization in order to re- duce the influence of highly frequent words, e.g. common words or stopwords, which can corrupt the representation. As J´egou et al. (2012), we empirically observed that this step consistently improves the quality of the representation. The power normalized document embeddings are then L2-normalized. After obtaining the normalized VLAWE representations, we employ a classifica- tion method to learn a discriminative model for each specific text classification task. 4 Experiments 4.1 Data Sets We exhibit the performance of VLAWE on five public data sets: Reuters-21578 (Lewis, 1997), RT-2k (Pang and Lee, 2004), MR (Pang and Lee, 2005), TREC (Li and Roth, 2002) and Subj (Pang and Lee, 2004). The Reuters-21578 data set (Lewis, 1997) con- tains articles collected from Reuters newswire. Following Joachims (1998) and Yang and Liu (1999), we select the categories (topics) that have at least one document in the training set and one in the test set, leading to a total of 90 categories. We use the ModeApte evaluation (Xue and Zhou, 2009), in which unlabeled documents are elimi- nated, leaving a total of 10787 documents. The collection is already divided into 7768 documents for training and 3019 documents for testing. The RT-2k data set (Pang and Lee, 2004) con- sists of 2000 movie reviews taken from the IMDB movie review archives. There are 1000 positive re- views rated with four or five stars, and 1000 nega- tive reviews rated with one or two stars. The task is to discriminate between positive and negative reviews. The Movie Review (MR) data set (Pang and Lee, 2005) consists of 5331 positive and 5331 neg- ative sentences. Each sentence is selected from one movie review. The task is to discriminate be- tween positive and negative sentiment. TREC (Li and Roth, 2002) is a question type classification data set, where questions are divided into 6 classes. The collection is already divided into 5452 questions for training and 500 questions for testing. The Subjectivity (Subj) (Pang and Lee, 2004) data set contains 5000 objective and 5000 subjec- tive sentences. The task is to classify a sentence as being either subjective or objective. 4.2 Evaluation and Implementation Details In the experiments, we used the pre-trained word embeddings computed with the GloVe toolkit pro- vided by Pennington et al. (2014). The pre-trained GloVe model contains 300-dimensional vectors for 2.2 million words and phrases. Most of the steps required for building the VLAWE represen- tation, such as the k-means clustering and the ran- domized forest of k-d trees, are implemented using the VLFeat library (Vedaldi and Fulkerson, 2008). We set the number of clusters (size of the code- book) to k = 10, leading to a VLAWE represen- tation of k · d = 10 · 300 = 3000 components. Similar to J´egou et al. (2012), we set α = 0.5 for the power normalization step in Equation (4), which consistently leads to near-optimal results on all data sets. In the learning stage, we employ the Method Average of word embeddings (baseline) BOW (baseline) TF + FA + CP + SVM (Xue and Zhou, 2009) Paragraph vectors (Le and Mikolov, 2014) CNN (Kim, 2014) DAN (Iyyer et al., 2015) Combine-skip (Kiros et al., 2015) Combine-skip + NB (Kiros et al., 2015) AdaSent (Zhao et al., 2015) SAE + embs. (Hill et al., 2016) SDAE + embs. (Hill et al., 2016) FastSent + AE (Hill et al., 2016) BLSTM (Zhou et al., 2016) BLSTM-Att (Zhou et al., 2016) BLSTM-2DCNN (Zhou et al., 2016) DC-TreeLSTM (Liu et al., 2017) BOSWE (Butnaru and Ionescu, 2017) TreeNet (Cheng et al., 2018) TreeNet-GloVe (Cheng et al., 2018) BOMV (Fu et al., 2018) SWEM-average (Shen et al., 2018) SWEM-concat (Shen et al., 2018) COV + Mean (Torki, 2018) COV + BOW (Torki, 2018) COV + Mean + BOW (Torki, 2018) DARLM (Zhou et al., 2018) VLAWE (ours) Reuters-21578 RT-2k MR TREC Subj 89.5 89.3 77.4 77.1 80.0 89.3 84.7 84.1 - - 83.5 - - - - - - - - - - - - 74.8 81.5 80.1 76.5 80.4 83.1 73.2 74.6 71.8 80.0 81.0 82.3 81.7 - 79.8 83.6 - 77.6 78.2 80.2 80.7 81.1 83.2 93.3 - 91.8 93.6 - 92.2 - 92.4 80.4 78.4 80.4 93.0 93.8 96.1 93.8 - 91.6 96.1 - 92.2 91.8 90.3 91.8 91.6 96.0 94.2 - 90.5 93.4 - 93.6 93.6 95.5 89.8 90.8 88.8 92.1 93.5 94.0 93.7 - 92.0 95.9 90.9 92.5 93.0 93.1 93.3 93.2 94.1 95.0 85.3 86.5 87.0 - - - - - - - - - - - - - 87.2 89.7 - - - - - - - - - - - 90.2 - - - - - - 89.3 94.1 Table 1: Performance results (in %) of our approach (VLAWE) versus several state-of-the-art methods (Butnaru and Ionescu, 2017; Cheng et al., 2018; Fu et al., 2018; Hill et al., 2016; Iyyer et al., 2015; Kim, 2014; Kiros et al., 2015; Le and Mikolov, 2014; Liu et al., 2017; Shen et al., 2018; Torki, 2018; Xue and Zhou, 2009; Zhao et al., 2015; Zhou et al., 2016, 2018) on the Reuters-21578, RT-2k, MR, TREC and Subj data sets. The top three results on each data set are highlighted in red, green and blue, respectively. Best viewed in color. Support Vector Machines (SVM) implementation provided by LibSVM (Chang and Lin, 2011). We set the SVM regularization parameter to C = 1 in all our experiments. In the SVM, we use the linear kernel. For optimal results, the VLAWE representation is combined with the BOSWE rep- resentation (Butnaru and Ionescu, 2017), which is based on the PQ kernel (Ionescu and Popescu, 2013, 2015b). We follow the same evaluation procedure as Kiros et al. (2015) and Hill et al. (2016), using 10- fold cross-validation when a train and test split is not pre-defined for a given data set. As evaluation metrics, we employ the micro-averaged F1 mea- sure for the Reuters-21578 data set and the stan- dard classification accuracy for the RT-2k, the MR, the TREC and the Subj data sets, in order to fairly compare with the related art. 4.3 Results We compare VLAWE with several state-of-the- art methods (Butnaru and Ionescu, 2017; Cheng et al., 2018; Fu et al., 2018; Hill et al., 2016; Iyyer et al., 2015; Kim, 2014; Kiros et al., 2015; Le and Mikolov, 2014; Liu et al., 2017; Shen et al., 2018; Torki, 2018; Xue and Zhou, 2009; Zhao et al., 2015; Zhou et al., 2016, 2018) as well as two base- line methods, namely the average of word embed- dings and the standard bag-of-words (BOW). The corresponding results are presented in Table 1. First, we notice that our approach outperforms both baselines on all data sets, unlike other related methods (Le and Mikolov, 2014; Hill et al., 2016). In most cases, our improvements over the base- lines are higher than 5%. On the Reuters-21578 Method VLAWE (k = 2) VALWE (PCA) VLAWE (full, k = 10) MR 93.0 93.2 93.3 Table 2: Performance results (in %) of the full VLAWE representation (with k = 10) versus two compact ver- sions of VLAWE, obtained either by setting k = 2 or by applying PCA. data set, we surpass the closely-related approach of Butnaru and Ionescu (2017) by around 2%. On the RT-2k data set, we surpass the related works of Fu et al. (2018) and Butnaru and Ionescu (2017) by around 4%. To our knowledge, our accuracy of 94.1% on RT-2k (Pang and Lee, 2004) surpasses all previous results reported in literature. On the MR data set, we surpass most related works by more than 10%. To our knowledge, the best ac- curacy on MR reported in previous literature is 83.6%, and it is obtained by Cheng et al. (2018). We surpass the accuracy of Cheng et al. (2018) by almost 10%, reaching an accuracy of 93.3% using VLAWE. On the TREC data set, we reach the third best performance, after methods such as (Cheng et al., 2018; Zhou et al., 2016, 2018). Our perfor- mance on TREC is about 2% lower than the state- of-the-art accuracy of 96.1%. On the Subj data set, we obtain an accuracy of 95.0%. There are two state-of-the-art methods (Cheng et al., 2018; Zhao et al., 2015) reporting better performance on Subj. Compared to the best one of them (Cheng et al., 2018), our accuracy is 1% lower. Overall, we consider that our results are noteworthy. 4.4 Discussion The k-means clustering algorithm and, on some data sets, the cross-validation procedure can in- duce accuracy variations due to the random choices involved. We have conducted experiments to determine how large are the accuracy variations. We observed that the accuracy can decrease by up to 1%, which does not bring any significant differ- ences to the results reported in Table 1. Even for a small number of clusters, e.g. k = 10, the VLAWE document representation can grow up to thousands of features, as the num- ber of features is k · d, where d = 300 is the dimensionality of commonly used word embed- dings. However, there are several document-level representations that usually have a dimensionality much smaller than k · d. Therefore, it is desir- able to obtain a more compact VLAWE represen- Figure 1: Accuracy on MR for different numbers of k-means clusters. tation. We hereby propose two approaches that lead to more compact representations. The first one is simply based on reducing the number of clusters. By setting k = 2 for instance, we obtain a 600-dimensional representation. The second one is based on applying Principal Component Anal- ysis (PCA), to reduce the dimension of the fea- ture vectors. Using PCA, we propose to reduce the size of the VLAWE representation to 300 com- ponents. In Table 2, the resulting compact repre- sentations are compared against the full VLAWE representation on the MR data set. Although the compact VLAWE representations provide slightly lower results compared to the VLAWE representa- tion based on 3000 components, we note that the differences are insignificant. Furthermore, both compact VLAWE representations are far above the state-of-the-art method (Cheng et al., 2018). In Figure 1, we illustrate the performance varia- tion on MR, when using different values for k. We notice that the accuracy tends to increase slightly, as we increase the number of clusters from 2 to 30. Overall, the VLAWE representation seems to be robust to the choice of k, always surpassing the state-of-the-art approach (Cheng et al., 2018). 5 Conclusion We proposed a novel representation for text docu- ments which is based on aggregating word embed- dings using k-means and on computing the resid- uals between each word embedding allocated to a given cluster and the corresponding cluster cen- troid. Our experiments on five benchmark data sets prove that our approach yields competitive re- sults with respect to the state-of-the-art methods. Acknowledgments This research is supported by University of Bucharest, Faculty of Mathematics and Computer Science, through the 2019 Mobility Fund. References Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Christian Janvin. 2003. A Neural Probabilistic Lan- Journal of Machine Learning Re- guage Model. search, 3:1137 -- 1155. Sudha Bhingardive, Dhirendra Singh, Rudramurthy V, Hanumant Harichandra Redkar, and Pushpak Bhattacharyya. 2015. Unsupervised Most Frequent Sense Detection using Word Embeddings. In Pro- ceedings of NAACL, pages 1238 -- 1243. Andrei Butnaru and Radu Tudor Ionescu. 2017. From Image to Text Classification: A Novel Approach based on Clustering Word Embeddings. In Proceed- ings of KES, pages 1784 -- 1793. Andrei Butnaru, Radu Tudor Ionescu, and Florentina Hristea. 2017. ShotgunWSD: An unsupervised al- gorithm for global word sense disambiguation in- In Proceedings of spired by DNA sequencing. EACL, pages 916 -- 926. Chih-Chung Chang and Chih-Jen Lin. 2011. LibSVM: ACM A Library for Support Vector Machines. Transactions on Intelligent Systems and Technol- ogy, 2:27:1 -- 27:27. Software available at http:// www.csie.ntu.edu.tw/cjlin/libsvm. Xinxiong Chen, Zhiyuan Liu, and Maosong Sun. 2014. A Unified Model for Word Sense Representation and Disambiguation. In Proceedings of EMNLP, pages 1025 -- 1035. Zhou Cheng, Chun Yuan, Jiancheng Li, and Haiqin Yang. 2018. TreeNet: Learning Sentence Represen- tations with Unconstrained Tree Structure. In Pro- ceedings of IJCAI, pages 4005 -- 4011. St´ephane Clinchant and Florent Perronnin. 2013. Ag- gregating continuous word embeddings for informa- In Proceedings of CVSC Workshop, tion retrieval. pages 100 -- 109. Ronan Collobert and Jason Weston. 2008. A Uni- fied Architecture for Natural Language Processing: Deep Neural Networks with Multitask Learning. In Proceedings of ICML, pages 160 -- 167. Alexis Conneau, Douwe Kiela, Holger Schwenk, Loıc Barrault, and Antoine Bordes. 2017. Supervised Learning of Universal Sentence Representations from Natural Language Inference Data. In Proceed- ings of EMNLP, pages 670 -- 680. Madalina Cozma, Andrei Butnaru, and Radu Tudor Ionescu. 2018. Automated essay scoring with string In Proceedings of kernels and word embeddings. ACL, pages 503 -- 509. Mingsheng Fu, Hong Qu, Li Huang, and Li Lu. 2018. Bag of meta-words: A novel method to represent document for the sentiment classification. Expert Systems with Applications, 113:33 -- 43. Felix Hill, Kyunghyun Cho, and Anna Korhonen. 2016. Learning Distributed Representations of Sentences In Proceedings of NAACL, from Unlabelled Data. pages 1367 -- 1377. Ignacio Iacobacci, Mohammad Taher Pilehvar, and Roberto Navigli. 2016. Embeddings for Word Sense Disambiguation: An Evaluation Study. In Proceed- ings of ACL, pages 897 -- 907. Radu Tudor Ionescu and Marius Popescu. 2013. Ker- nels for Visual Words Histograms. In Proceedings of ICIAP, pages 81 -- 90. Radu Tudor Ionescu and Marius Popescu. 2014. Ob- jectness to improve the bag of visual words model. In Proceedings of ICIP, pages 3238 -- 3242. Radu Tudor Ionescu and Marius Popescu. 2015a. Have a SNAK. Encoding Spatial Information with the In Proceedings of Spatial Non-alignment Kernel. ICIAP, pages 97 -- 108. Radu Tudor Ionescu and Marius Popescu. 2015b. PQ kernel: a rank correlation kernel for visual word his- tograms. Pattern Recognition Letters, 55:51 -- 57. Radu Tudor Ionescu, Marius Popescu, and Cristian Grozea. 2013. Local Learning to Improve Bag of Visual Words Model for Facial Expression Recogni- tion. In Proceedings of WREPL. Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daum´e III. 2015. Deep Unordered Compo- sition Rivals Syntactic Methods for Text Classifica- tion. In Proceedings of ACL, pages 1681 -- 1691. Herv´e J´egou, Matthijs Douze, Cordelia Schmid, and Patrick P´erez. 2010. Aggregating local descriptors In Proceed- into a compact image representation. ings of CVPR, pages 3304 -- 3311. Herv´e J´egou, Florent Perronnin, Matthijs Douze, Jorge S´anchez, Patrick Perez, and Cordelia Schmid. 2012. Aggregating local image descriptors into compact codes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(9):1704 -- 1716. Thorsten Joachims. 1998. Text Categorization with Su- port Vector Machines: Learning with Many Rele- vant Features. In Proceedings of ECML, pages 137 -- 142, London, UK, UK. Springer-Verlag. Yoon Kim. 2014. Convolutional Neural Networks for Sentence Classification. In Proceedings of EMNLP, pages 1746 -- 1751. C´ıcero Nogueira Dos Santos and Maira Gatti. 2014. Deep Convolutional Neural Networks for Sentiment In Proceedings of COL- Analysis of Short Texts. ING, pages 69 -- 78. Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Skip-Thought Vectors. In Proceedings of NIPS, pages 3294 -- 3302. Marwan Torki. 2018. A Document Descriptor using In Proceedings of Covariance of Word Vectors. ACL, pages 527 -- 532. Andrea Vedaldi and B. Fulkerson. 2008. VLFeat: An Open and Portable Library of Computer Vision Al- gorithms. http://www.vlfeat.org/. Xiao-Bing Xue and Zhi-Hua Zhou. 2009. Distri- IEEE butional features for text categorization. Transactions on Knowledge and Data Engineering, 21(3):428 -- 442. Yiming Yang and Xin Liu. 1999. A re-examination of text categorization methods. In Proceedings of SI- GIR, pages 42 -- 49. Xin Ye, Hui Shen, Xiao Ma, Razvan Bunescu, and Chang Liu. 2016. From word embeddings to docu- ment similarities for improved information retrieval In Proceedings of ICSE, in software engineering. pages 404 -- 415. Han Zhao, Zhengdong Lu, and Pascal Poupart. 2015. Self-Adaptive Hierarchical Sentence Model. In Pro- ceedings of IJCAI, pages 4069 -- 4076. Peng Zhou, Zhenyu Qi, Suncong Zheng, Jiaming Xu, Hongyun Bao, and Bo Xu. 2016. Text Classification Improved by Integrating Bidirectional LSTM with In Proceedings of Two-dimensional Max Pooling. COLING, pages 3485 -- 3495. Qianrong Zhou, Xiaojie Wang, and Xuan Dong. 2018. Differentiated attentive representation learning for In Proceedings of IJCAI, sentence classification. pages 4630 -- 4636. Matt Kusner, Yu Sun, Nicholas Kolkin, and Kilian Weinberger. 2015. From word embeddings to doc- In Proceedings of ICML, pages ument distances. 957 -- 966. Quoc Le and Tomas Mikolov. 2014. Distributed Rep- resentations of Sentences and Documents. In Pro- ceedings of ICML, pages 1188 -- 1196. David Lewis. 1997. The Reuters-21578 text catego- rization test collection. http://www.daviddlewis.co m/resources/testcollections/reuters21578/. Xin Li and Dan Roth. 2002. Learning question classi- fiers. In Proceedings of COLING, pages 1 -- 7. Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. 2017. Dynamic compositional neural networks over tree In Proceedings of IJCAI, pages 4054 -- structure. 4060. David G. Lowe. 2004. Distinctive Image Features from Scale-Invariant Keypoints. International Journal of Computer Vision, 60(2):91 -- 110. Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. 2013. Distributed Rep- resentations of Words and Phrases and their Com- positionality. In Proceedings of NIPS, pages 3111 -- 3119. Jeff Mitchell and Mirella Lapata. 2010. Composition in distributional models of semantics. Cognitive Sci- ence, 34(8):1388 -- 1429. Bo Pang and Lillian Lee. 2004. A Sentimental Educa- tion: Sentiment Analysis Using Subjectivity Sum- In Proceed- marization Based on Minimum Cuts. ings of ACL, pages 271 -- 278. Bo Pang and Lillian Lee. 2005. Seeing Stars: Exploit- ing Class Relationships For Sentiment Categoriza- tion With Respect To Rating Scales. In Proceedings of ACL, pages 115 -- 124. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. GloVe: Global Vectors for In Proceedings of EMNLP, Word Representation. pages 1532 -- 1543. James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. 2007. Object re- trieval with large vocabularies and fast spatial matching. In Proceedings of CVPR, pages 1 -- 8. David Powers. 1998. Applications and explanations of Zipf's law. In Proceedings of NeMLaP/CoNLL, pages 151 -- 160. Dinghan Shen, Guoyin Wang, Wenlin Wang, Mar- tin Renqiang Min, Qinliang Su, Yizhe Zhang, Chun- yuan Li, Ricardo Henao, and Lawrence Carin. 2018. Baseline Needs More Love: On Simple Word- Embedding-Based Models and Associated Pooling In Proceedings of ACL, pages 440 -- Mechanisms. 450.
1609.04904
2
1609
2016-12-02T17:18:42
Long-Term Trends in the Public Perception of Artificial Intelligence
[ "cs.CL", "cs.AI", "cs.CY" ]
Analyses of text corpora over time can reveal trends in beliefs, interest, and sentiment about a topic. We focus on views expressed about artificial intelligence (AI) in the New York Times over a 30-year period. General interest, awareness, and discussion about AI has waxed and waned since the field was founded in 1956. We present a set of measures that captures levels of engagement, measures of pessimism and optimism, the prevalence of specific hopes and concerns, and topics that are linked to discussions about AI over decades. We find that discussion of AI has increased sharply since 2009, and that these discussions have been consistently more optimistic than pessimistic. However, when we examine specific concerns, we find that worries of loss of control of AI, ethical concerns for AI, and the negative impact of AI on work have grown in recent years. We also find that hopes for AI in healthcare and education have increased over time.
cs.CL
cs
Long-Term Trends in the Public Perception of Artificial Intelligence Ethan Fast and Eric Horvitz [email protected], [email protected] 6 1 0 2 c e D 2 ] L C . s c [ 2 v 4 0 9 4 0 . 9 0 6 1 : v i X r a Abstract Analyses of text corpora over time can reveal trends in be- liefs, interest, and sentiment about a topic. We focus on views expressed about artificial intelligence (AI) in the New York Times over a 30-year period. General interest, awareness, and discussion about AI has waxed and waned since the field was founded in 1956. We present a set of measures that captures levels of engagement, measures of pessimism and optimism, the prevalence of specific hopes and concerns, and topics that are linked to discussions about AI over decades. We find that discussion of AI has increased sharply since 2009, and that these discussions have been consistently more optimistic than pessimistic. However, when we examine specific concerns, we find that worries of loss of control of AI, ethical concerns for AI, and the negative impact of AI on work have grown in recent years. We also find that hopes for AI in healthcare and education have increased over time. Introduction Artificial intelligence will spur innovation and create oppor- tunities, both for individuals and entrepreneurial companies, just as the Internet has led to new businesses like Google and new forms of communication like blogs and social network- ing. Smart machines, experts predict, will someday tutor stu- dents, assist surgeons and safely drive cars. Computers Learn to Listen, and Some Talk Back. NYT, 2010 In the wake of recent technological advances in computer vi- sion, speech recognition and robotics, scientists say they are increasingly concerned that artificial intelligence technolo- gies may permanently displace human workers, roboticize warfare and make Orwellian surveillance techniques easier to develop, among other disastrous effects. Study to Examine Effects of Artificial Intelligence. NYT, 2014 These two excerpts from articles in the New York Times lay out competing visions for the future of artificial intel- ligence (AI) in our society. The first excerpt is optimistic about the future of AI-the field will "spur innovation," cre- ating machines that tutor students or assist surgeons-while the second is pessimistic, raising concerns about displaced workers and dystopian surveillance technologies. But which vision is more common in the public imagination, and how have these visions evolved over time? Copyright c(cid:13) 2017, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Understanding public concerns about AI is important, as these concerns can translate into regulatory activity with po- tentially serious repercussions (Stone, P. et al. 2016). For example, some have recently suggested that the government should regulate AI development to prevent existential threats to humanity (Guardian 2014). Others have argued that racial profiling is implicit in some machine learning algorithms, in violation of current law (ProPublica 2016). More broadly, if public expectations diverge too far from what is possible, we may court the smashed hopes that often follow from intense enthusiasm and high expectations. AI presents a difficult case for studies of topic sentiment over time because the term is not precisely defined. Lay peo- ple and experts alike have varied understandings of what "ar- tificial intelligence" means (Stone, P. et al. 2016). Even in the narrowest, engineering-centric definitions, AI refers to a broad constellation of computing technologies. We present a characterization of impressions expressed about AI in the news over 30 years. First, we define a set of indicators that capture levels of engagement, general senti- ment, and hopes and concerns about AI. We then apply and study these indicators across 30 years of articles from the New York Times. As a proxy for public opinion and engage- ment, no other corpus extends so far into the past to capture how a general audience thinks about AI. Moving forward, we can apply these indicators to present day articles in an ongoing effort to track public perception. Our study relies on a combination of crowdsourcing and natural language processing. For each article under analysis, we extract all mentions of artificial intelligence and use paid crowdsourcing to annotate these mentions with measures of relevance, their levels of pessimism or optimism about AI, and the presence of specific hopes and concerns, such as "losing control of AI" or "AI will improve healthcare." These annotations form the basis of the indicators and allow us to bootstrap a classifier that can automatically extract im- pressions about AI, with applications to tracking trends in new articles as they are generated. To study how public perception of AI has changed over time, we analyze the set of indicators for articles published in the New York Times between January 1986 and June 2016. We address four research questions: R1: How prominent is AI in the public discussion today, as compared to the past? R2: Have news articles become generally more optimistic or more pessimistic about AI over time? R3: What ideas are most associated with AI over time? R4: What specific ideas were the public concerned about in the past, which are no longer concerns today? Likewise, what new ideas have arisen as concerns? When we examine the impression indicators across histor- ical data, we find that AI has generally taken on a stronger role in public discussion over time-with a few notable blips, such as the so-called AI winter in 1987. Further, we find that the mood of discussion has generally remained more optimistic over time, although this trend is not com- mon across all concerns (e.g., AI's impact on work). Finally, we discover that some ideas, such as "AI for healthcare" or "losing control of AI," are more common today than in the past. Other ideas, for example, that "AI is not making enough progress" or that "AI will have a positive impact on work," were more common in the past than they are today. Indicators of Impressions about AI We capture the intensity of engagement on AI in the news as well as the prevalence of a diverse set of hopes and concerns about the future of AI. We took inspiration from the Asilo- mar Study of 2008-09 (Horvitz and Selman 2009) and the One Hundred Year Study on Artificial Intelligence (Stanford University 2014) to create measures that capture a long-term perspective for how AI impacts society. General Measures We have included the following general measures: Engagement. This measure serves as a proxy for public interest and engagement around AI, capturing how much AI is discussed in the news over time. Optimism vs. Pessimism. This measure captures the atti- tude of a discussion-the degree to which it implies a sense of optimism or pessimism about the future of AI. This at- titude can stem from technological progress, such as opti- mistic reporting on new breakthroughs in deep learning. But it can also be influenced by the impact of new technologies on society: for example, the time-saving benefits of a self- driving car (a form of optimism); or the dangers of surveil- lance as data is collected and mined to track our leanings, lo- cations, and daily habits (a form of pessimism). We include such attitudinal leanings as an indicator to track these high- level trends. Notably, traditional sentiment analysis does not capture optimism versus pessimism. The remainder of our indicators capture common hopes and concerns about the future of AI. Hopes for Artificial Intelligence We have included the following hopes for AI as indicators: Impact on work (positive): AI makes human work easier or frees us from needing to work at all, e.g., by managing our schedules, automating chores via robots. Education: AI improves how students learn, e.g., through automatic tutoring or grading, or providing other kinds of personalized analytics. Transportation: AI enables new forms of transportation, e.g., self-driving cars, or advanced space travel. Healthcare: AI enhances the health and well-being of people, e.g., by assisting with diagnosis, drug discovery, or enabling personalized medicine. Decision making: AI or expert systems help us make bet- ter decisions, e.g., when to take a meeting, or case-based reasoning for business executives. Entertainment: AI brings us joy through entertainment, e.g., though smarter enemies in video games. Singularity (positive): A potential singularity will bring positive benefits to humanity, e.g., immortality. Merging of human and AI (positive): Humans merge with AI in a positive way, e.g., robotic limbs for the disabled, positive discussions about potential rise of transhumanism. Concerns for Artificial Intelligence We have also considered the following concerns for AI: Loss of control: Humans lose control of powerful AI sys- tems, e.g., Skynet or "Ex Machina" scenarios. Impact on work (negative): AI displaces human jobs, e.g., large-scale loss of jobs by blue collar workers. Military applications: AI kills people or leads to instabil- ities and warfare through military applications, e.g., robotic soldiers, killer drones. Absence of Appropriate Ethics: AI lacks ethical reason- ing, leading to negative outcomes, e.g., loss of human life. Lack of progress: The field of AI is advancing more slowly than expected, e.g., unmet expectations like those that led to an AI Winter. Singularity (negative): The singularity harms humanity, e.g., humans are replaced or killed. Merging of human and AI (negative): Humans merge with AI in a negative way, e.g., cyborg soldiers. Data: Thirty Years of News Articles We conduct our analysis over the full set of articles pub- lished by the New York Times between January 1986 and May 2016-more than 3 million articles in total. We have created this dataset by querying the New York Times public API for metadata (e.g., title of article, section of paper, current URL) associated with articles published on each individual day within the scope of our analysis. For each article, we then scrape the full text from its URL using the BeautifulSoup python package. Next, we annotate articles on AI. Unfortunately, crowd- sourcing annotations for full news articles is a complex task, requiring a large time expenditure for workers. For this rea- son we segment our data into paragraphs. In news articles, paragraphs tend to be self-contained enough that workers can annotate them accurately without reading the rest of the article. This makes them a good middle ground between full documents and individual sentences. For example: Artificial intelligence "has great potential to benefit humanity in many ways." An association with weaponry, though, could set off a backlash that curtails its advancement. While the above paragraph clearly discusses AI for mili- tary applications, annotating the same text at the sentence or document level might not produce that annotation. For ex- ample, sentence level annotations would not connect "its" with AI, and document level annotations would too often re- sult in workers missing the relevant passage, but paragraph level annotations easily capture this relationship. It is expensive to crowdsource annotations the tens of mil- lions of paragraphs in the dataset, so we filter these para- graphs to the set that contain "artificial intelligence", "AI", or "robot". (We include "robot" to increase coverage-we are not concerned with false positives at this stage, as we will later filter for relevance.) In total, we retrieve more than 8000 paragraphs that mention AI over a thirty year period. Crowdsourcing to Annotate Indicators Crowdsourcing provides an efficient way to gather annota- tions for our dataset of AI-related paragraphs. In this section, we present the details of the approach. Task Setup We used Amazon Mechanical Turk (AMT) to collect anno- tations for the more than 8000 AI-related paragraphs in our dataset. We assigned each paragraph to a task with multi- ple components. First, we collected annotations for attitude about the future of AI (from pessimistic to optimistic) on a 5-point Likert scale. We then collected low level annotations for all of the specific hopes and concerns developed. We re- quested binary labels that indicate whether the hope or con- cern is present in the paragraph (e.g., AI will have a negative impact on work). Finally, to ensure that unrelated paragraphs do not bias our results, we collected high-level annotations for AI relevance (from strongly unrelated to strongly related) on a 5-point Likert scale. We assigned each AMT task to three independent work- ers in pursuit of reliable labels (Sheng, Provost, and Ipeiro- tis 2008). We provided examples to better ground the task (Doroudi et al. 2016), and recruited Masters workers to en- sure quality results. We paid $0.15 per task in line with guidelines for ethical research (Salehi, Irani, and Bernstein 2015), for a total cost of $3825. In Supplementary Material, we include a template for the task we used. In general, workers show high rates of agreement over la- bels for AI relevance and mood. Across paragraphs, 97% of workers agreed that they were either at least somewhat re- lated to AI or else unrelated. 70% of workers agreed when distinguishing between optimistic and pessimistic articles. When interpreting ratings for AI relevance and attitude, we take the average across workers. Interpreting annotations for hopes and concerns One decision we must make is how to interpret the crowd annotations for hopes and concerns. Should we require that all three workers mark a paragraph with a hope or concern to include it in our data? Or trust the majority vote of two workers? Or require only one worker's vote? Requiring a larger number of votes will reduce the rate of false positives (i.e., labeling a paragraph with a hope or concern it does not exhibit), but may increase the rate of false negatives. Figure 1: Articles that discuss AI over time, as a percentage of the total number of articles published per year. The green line plots optimistic articles and the yellow line plots pes- simistic articles. AI discussion has exploded since 2009, but levels of pessimism and optimism have remained balanced. To determine the best approach, we established a ground truth dataset for one example concern, military applications for AI. We examined each paragraph associated with this concern by at least one worker and determined whether it in fact expressed that concern. This allowed us to calculate precision and a proxy for recall1 across voting schemes. We find a trade-off between precision and recall (Table 1). Requiring two or more votes results in precision of 100%, but recall of 59%. Alternatively, only requiring one worker vote results in precision of 80% and recall of 100%. In light of these numbers and the fact that many of our hopes and concerns are covered sparsely in the dataset (for example, we see only 231 mentions of "loss of control of AI" across the thirty year corpus), we require only one worker vote to label a paragraph with a given hope or concern. # worker votes precision recall 1 0.81 1.00 2 1.00 0.59 3 1.00 0.18 Table 1: How voting schemes impact a paragraph's associ- ation with military applications in terms of precision and a proxy for recall on ground truth data. Trends in the Public Perception of AI Using our crowdsourced annotations, we now analyze trends in public impressions of AI over 30 years of news articles. We conduct this analysis through four research questions. R1: How prominent is discussion of AI? A natural starting point for understanding the public percep- tion of AI is to examine how frequently it is discussed over time, and what events influence this discussion. 1This number will be higher than true recall, but describes how many true positives we miss in the subset of ground truth data. We capture this idea through an engagement measure. To compute this, we first filter the data to include only para- graphs with an average AI relevance rating of more than 3.0, as determined by our crowdsourcing pipeline. We then ag- gregate these paragraphs by the news article they appear in, and further aggregate articles by their year of publication. This leaves us with data that count how many articles that mention AI are published every year from 1986 to 2016. Finally, we normalize these counts by the total volume of articles published each year. We present a graph of AI engagement in Figure 1. Most strikingly, we observe a dramatic rise in articles that men- tion AI beginning in late 2009. While the cause of this rise is unclear, it occurs following a renaissance in the use of neural nets ("deep learning") in natural language and per- ceptual applications, and after a front page story discussed the Asilomar meeting (Horvitz and Selman 2009). We also observe a fall in AI discussion that corresponds with the start of the 1987 AI winter-reaching its lowest level in 1995. R2: Have impressions reported in the news become more optimistic or pessimistic about AI? In addition to engagement, we studied indicators for levels of pessimism and optimism in the coverage of AI. How have these levels changed over time? While it is easy to imagine a public celebration of AI technology as it becomes more common, it is also possible to imagine greater levels of con- cern, as people worry about changes they cannot control. To track public sentiment over time, we draw on the dataset of AI-related news articles, aggregated by year, that we created for R1. We divide each year into counts of opti- mistic and pessimistic articles, as determined by the attitude rating in our crowdsourcing pipeline (considering an article optimistic if it has an average rating greater than 3, and pes- simistic if it has an average rating of less than three). We present the resulting trends in Figure 1. In general, AI has had consistently more optimistic than pessimistic cov- erage over time, roughly 2-3 times more over the 30 year period. Since 2009, both optimistic and pessimistic cover- age have exploded along with general interest in AI. R3: What kinds of ideas are associated with AI, and how have they changed? The field of AI has changed enormously since 1986. What kinds of ideas did people associate with AI in the past, and how have these ideas changed in the present? To find out, we investigate the keywords most associ- ated with AI-related articles from different time periods. We gather these keywords-for example, "space" or "world pol- itics" or "driverless vehicles"-from the New York Times API. We then group all New York Times articles into six five-year intervals between 1986 and 2016, and compute the mutual information (MI) between keyword counts and AI articles within each time period. For example, the keyword "space" might appear 80 times across all articles and 25 times in association with AI-related articles between 1986 and 1990, producing high MI with AI for that time period. This gives us a measure of the keywords most associated with AI articles over time. We then look across time periods and record themes in how these keywords change. We present a sample of the keywords most strongly asso- ciated with AI for each time period in Figure 2. Each key- word in the sample is among the 50 most related for that period and applies to at least two AI articles in the corpus. Some keywords (e.g., "robot") are common across all peri- ods, and we did not include these in the sample. Other key- words (e.g., "computer games") remain strongly related to AI after the first time period in which they appear. The change in AI-associated keywords across time is re- vealing. From the concept of space weapons in 1986: Real-time parallel processing may be the computational key to the creation of artificial intelligence, and conceivably to such functions as the control of President Reagan's Strategic Defensive Initiative, or Star Wars, program. To chess in 1997: Even before the world chess champion Garry Kasparov faced the computer Deep Blue yesterday, pundits were calling the rematch another milestone in the inexorable advance of arti- ficial intelligence. To search engines in 2006: Accoona is a search engine that uses a heavy dose of artificial intelligence to find results that Google may miss. To driverless vehicles in 2016: United States vehicle safety regulators have said the artificial intelligence system piloting a self-driving Google car could be considered the driver under federal law. We also observe how the association of AI with individual keywords changes across time. For example, the association between AI and science fiction, while present across all pe- riods, peaks in the early 1990s. R4: How have public hopes and concerns about AI changed over time? Beyond keywords, we studied indicators for fine-grained set of hopes and concerns related to AI. Here we examine how these ideas have evolved over time. To this end, we examine all paragraphs tagged with AI hopes and concerns. We aggregate each of these paragraphs by article, and then by year. We consider an article as ex- pressing a given hope or concern if it contains at least one paragraph that the crowd labeled with that concept. This gives us data that count the total number of times each AI hope and concern is expressed per article per year. We nor- malize these data by the total number of AI-related articles published per year, to arrive at a yearly percentage of AI- related articles that discuss each hope and concern. We present the resulting trends in Figure 3. While some data are sparse, we observe several clear upward trends. The fear of loss of control, for example, has become far more common in recent years-more than triple what it was as a percentage of AI articles in the 1980s (Figure 3M). For example, in one article from 2009: Impressed and alarmed by advances in artificial intelligence, a group of computer scientists is debating whether there Figure 2: New York Times keywords associated with articles that mention AI over time. For example, chess emerges most strongly in the late 1990s, after Deep Blue beats Kasparov. Figure 3: Hopes and concerns from 1986 to 2016. In recent years, we see an increase in concern that humanity will lose of control of AI, and hope for the beneficial impact of AI on healthcare. The y-axis measures the percentage of AI articles that mention a specific hope or concern. should be limits on research that might lead to loss of hu- man control over computer-based systems that carry a grow- ing share of society's workload, from waging war to chatting with customers on the phone. Ethical concerns for AI have also become more common, driven in part by similar existential worries (Figure 3L). For example, in an article from 2015: Two main problems with artificial intelligence lead people like Mr. Musk and Mr. Hawking to worry. The first, more near-future fear, is that we are starting to create machines that can make decisions like humans, but these machines don't have morality and likely never will. These trends suggest an increase in public belief that we may soon be capable of building dangerous AI systems. From a more positive standpoint, AI hopes for healthcare have also trended upwards (Figure 3G). One strong theme is AI systems that care for patients. From 2003: For patients with more advanced cases, the researchers held out the possibility of systems that use artificial intelligence techniques to determine whether a person has remembered to drink fluids during the day. Another driver of this trend is systems that can diagnose pa- tients, or bioinformatics to cure disease. From 2013: After Watson beat the best human Jeopardy champions in 2011, its artificial intelligence technology was directed to- ward new challenges, like assisting doctors in making diag- noses in a research project at the Cleveland Clinic. In contrast, concerns over lack of progress have decreased over time, despite a recent uptick (Figure 3P). This concern reached its high in 1988, at the start of the AI winter: The artificial intelligence industry in general has been going through a retrenchment, with setbacks stemming from its fail- ure to live up to its promises of making machines that can recognize objects or reason like a human. Intriguingly, many articles labeled with this concern in re- cent years draw reference to the past-a kind of meta- discussion about the lack of progress concern itself. Among the remainder of the trends, a positive view of the impact of AI on human work has become less common, while a negative view has increased sharply in recent years Figure 4: We validated the increasing concern in loss of con- trol on Reddit data. The y-axis measures the percentage of AI-related comments that mention loss of control of AI. (Figure 3E-F). AI for education has grown over time (Figure 3D), as has a positive view of merging with AI (Figure 3I) and the role of AI in fiction (Figure 3N). News Articles from 1956 to 1986 The New York Times provides full text for articles published after 1986, but article abstracts (short descriptions of arti- cle content) are available over a much longer time period. To extend our results, we collected a dataset of all abstracts published between 1956 (the year of the first AI workshop at Dartmouth) and 1986. Articles that mention AI are less common over this ear- lier period, with only 40 abstracts that reference AI (the first appears in 1977) and 247 that mention robots. These data are too sparse to extend our earlier analyses to 1956, but we have manually annotated each abstract with topic keywords to observe themes over time. In the 1950s, robots are most associated with mili- tary applications and especially missiles, e.g., "the guided missile-the almost human robot of the skies." The 1960s and 70s strongly emphasize space, as in "a ten-pound robot was shot into orbit today." Interest in AI picks up consider- ably in the early 1980s, where we see the first article that worries AI will negatively impact human jobs, the first re- ported death via robot, "a factory worker killed by a robot arm," and the first mention of AI in healthcare, "a robot to prepare meals and perform other chores for quadriplegics." External validity Do the trends we have discovered in the New York Times generalize to the public at large? While this question is dif- ficult to answer directly, we have replicated one of our pri- mary findings on 5 years of public posts from Reddit, a pop- ular online community with a diverse set of users. Concretely, we train a classifier to predict the presence of loss of control in paragraphs about AI using our annotated data from the New York Times. We then apply this classi- fier to posts made by Reddit users. We use a logistic regres- sion model based on TF-IDF features and threshold the pos- itive class probability at 0.9. In validation, we observe pre- cision of 0.8 on a sample of 100 Reddit posts annotated with ground truth. Finally, we apply this classifier to every post that mentioned "artificial intelligence" from 2010 to 2015. We present the resulting trend in Figure 4, which mirrors Figure 3M over the same time period. Broadly, this replica- tion suggests that attitudes among Reddit users shift in line with what we see in the New York Times, providing some evidence for the external validity of our findings. Related Work Others have discussed the impact of artificial intelligence on society and the range of future outcomes (Dietterich and Horvitz 2015). These discussions are in part driven by a need to address public concerns about AI-our work is the first to quantify such concerns through direct analysis. The set of in- dicators we have introduced will be useful in framing future discussions, such as those ongoing in the One Hundred Year Study of Artificial Intelligence (Stanford University 2014). Public opinion polls have similarly measured topics rele- vant to AI. While such polls are recent (and not conducted over time), they support our findings, showing greater levels of optimism than pessimism about AI, but increasing exis- tential fear and worry about jobs (BSA 2015; 60 Minutes 2016). Future polls might allow us to directly measure pub- lic opinion on the set of measures we have studied. Beyond artificial intelligence, other work has mined cul- tural perspectives from text corpora over long time periods. For example, by analyzing 200 years of data from Google Books, it is possible to quantify the adoption of new tech- nologies or changes in psychological attitudes through lin- guistic patterns (Michel et al. 2011; Greenfield 2013). Using music, others have quantified changes in artistic style over a 40 year period (Serr`a et al. 2012). We use crowdsourced an- notations to extend the limits of what is possible under these kinds of quantitative analyses. News and social media offer a powerful reflection of pub- lic attitudes over time. For example, by analyzing such data, it is possible to predict cultural events such as revolutions (Radinsky and Horvitz 2013; Leetaru 2011), or examine public opinion on same-sex marriage (Zhang and Counts 2015). Here we use such data to discover and validate simi- lar trends in the public perception of artificial intelligence. Finally, crowdsourcing is a powerful tool for enabling new kinds of quantitative analyses. For example, it is pos- sible to crowdsource lexicons of words to answer novel re- search questions (Fast, Chen, and Bernstein 2016), or lever- age crowds to bootstrap classifiers that can then be applied to much larger corpora (Danescu-Niculescu-Mizil et al. 2013; Fast and Horvitz 2016). Here we use crowds to identify themes in articles that would be difficult to analyze under fully automated approaches. Conclusion We present a set of indicators that capture levels of engage- ment, general sentiment, and hopes and concerns for the future of artificial intelligence over time. We then validate these impression indicators by studying trends in 30 years of articles from the New York Times. We find that discussion of AI has increased sharply since 2009 and has been con- sistently more optimistic than pessimistic. However, many specific concerns, such as the fear of loss of control of AI, have been increasing in recent years. [Serr`a et al. 2012] Serr`a, J.; Corral, ´A.; Bogun´a, M.; Haro, M.; and Arcos, J. L. 2012. Measuring the evolution of con- temporary western popular music. Nature Scientific reports. [Sheng, Provost, and Ipeirotis 2008] Sheng, V. S.; Provost, F.; and Ipeirotis, P. G. 2008. Get another label? Improving data quality and data mining using multiple, noisy labelers. Proceedings of the 14th ACM SIGKDD international con- ference on Knowledge discovery and data mining 614–622. [Stanford University 2014] Stanford University. 2014. One hundred year study on artificial intelligence. [Stone, P. et al. 2016] Stone, P. et al. 2016. Artificial intelli- gence and life in 2030. One Hundred Year Study on Artificial Intelligence: Report of the 2015-2016 Study Panel. [Zhang and Counts 2015] Zhang, A. X., and Counts, S. 2015. Modeling ideology and predicting policy change with In Proceedings social media: Case of same-sex marriage. of the 33rd Annual ACM Conference on Human Factors in Computing Systems, 2603–2612. ACM. References [60 Minutes 2016] 60 Minutes. 2016. 60 minutes poll: Arti- ficial intelligence. [BSA 2015] BSA. 2015. One in three believe that the rise of artificial intelligence is a threat to humanity. [Danescu-Niculescu-Mizil et al. 2013] Danescu-Niculescu- Mizil, C.; Sudhof, M.; Jurafsky, D.; Leskovec, J.; and 2013. A computational approach to polite- Potts, C. arXiv preprint ness with application to social factors. arXiv:1306.6078. [Dietterich and Horvitz 2015] Dietterich, T. G., and Horvitz, E. J. 2015. Rise of concerns about AI: reflections and direc- tions. Communications of the ACM 58(10):38–40. [Doroudi et al. 2016] Doroudi, S.; Kamar, E.; Brunskill, E.; and Horvitz, E. 2016. Toward a learning science for complex crowdsourcing tasks. In Proceedings of the 2016 CHI Con- ference on Human Factors in Computing Systems, 2623– 2634. ACM. [Fast and Horvitz 2016] Fast, E., and Horvitz, E. 2016. Iden- tifying dogmatism in social media: Signals and models. In Proceedings of EMNLP 2016. [Fast, Chen, and Bernstein 2016] Fast, E.; Chen, B.; and Bernstein, M. S. 2016. Empath: Understanding topic signals in large-scale text. In Proceedings of the 2016 CHI Confer- ence on Human Factors in Computing Systems, 4647–4657. ACM. [Greenfield 2013] Greenfield, P. M. 2013. The changing psy- chology of culture from 1800 through 2000. Psychological science 24(9):1722–1731. [Guardian 2014] Guardian, T. 2014. Elon Musk: Artificial intelligence is our biggest existential threat. [Horvitz and Selman 2009] Horvitz, E., and Selman, B. 2009. Interim report from the panel chairs, AAAI presi- dential panel on long-term AI futures. Association for the Advancement of Artificial Intelligence, August 2009. [Leetaru 2011] Leetaru, K. 2011. Culturomics 2.0: Fore- casting large-scale human behavior using global news media tone in time and space. First Monday 16(9). [Michel et al. 2011] Michel, J.-B.; Shen, Y. K.; Aiden, A. P.; Veres, A.; Gray, M. K.; Pickett, J. P.; Hoiberg, D.; Clancy, D.; Norvig, P.; Orwant, J.; et al. 2011. Quantitative anal- ysis of culture using millions of digitized books. Science 331(6014):176–182. [ProPublica 2016] ProPublica. 2016. Machine bias in crimi- nal sentencing. [Radinsky and Horvitz 2013] Radinsky, K., and Horvitz, E. In Pro- 2013. Mining the web to predict future events. ceedings of the sixth ACM international conference on Web search and data mining, 255–264. ACM. [Salehi, Irani, and Bernstein 2015] Salehi, N.; Irani, L. C.; and Bernstein, M. S. 2015. We are Dynamo: Overcoming stalling and friction in collective action for crowd workers. Proceedings of the 33rd Annual ACM Conference on Human Factors in Computing Systems 1621–1630.
1811.04897
1
1811
2018-11-12T18:33:21
Multi-encoder multi-resolution framework for end-to-end speech recognition
[ "cs.CL" ]
Attention-based methods and Connectionist Temporal Classification (CTC) network have been promising research directions for end-to-end Automatic Speech Recognition (ASR). The joint CTC/Attention model has achieved great success by utilizing both architectures during multi-task training and joint decoding. In this work, we present a novel Multi-Encoder Multi-Resolution (MEMR) framework based on the joint CTC/Attention model. Two heterogeneous encoders with different architectures, temporal resolutions and separate CTC networks work in parallel to extract complimentary acoustic information. A hierarchical attention mechanism is then used to combine the encoder-level information. To demonstrate the effectiveness of the proposed model, experiments are conducted on Wall Street Journal (WSJ) and CHiME-4, resulting in relative Word Error Rate (WER) reduction of 18.0-32.1%. Moreover, the proposed MEMR model achieves 3.6% WER in the WSJ eval92 test set, which is the best WER reported for an end-to-end system on this benchmark.
cs.CL
cs
MULTI-ENCODER MULTI-RESOLUTION FRAMEWORK FOR END-TO-END SPEECH RECOGNITION Ruizhi Li1, Xiaofei Wang1, Sri Harish Mallidi2, Takaaki Hori3, Shinji Watanabe1, Hynek Hermansky1 1The Johns Hopkins University, 2Amazon, 3Mitsubishi Electric Research Laboratories (MERL) {ruizhili, xiaofeiwang, shinjiw, hynek}@jhu.edu, [email protected], [email protected] 8 1 0 2 v o N 2 1 ] L C . s c [ 1 v 7 9 8 4 0 . 1 1 8 1 : v i X r a ABSTRACT Attention-based methods and Connectionist Temporal Classification (CTC) network have been promising research directions for end-to- end Automatic Speech Recognition (ASR). The joint CTC/Attention model has achieved great success by utilizing both architectures dur- ing multi-task training and joint decoding. In this work, we present a novel Multi-Encoder Multi-Resolution (MEMR) framework based on the joint CTC/Attention model. Two heterogeneous encoders with different architectures, temporal resolutions and separate CTC networks work in parallel to extract complimentary acoustic infor- mation. A hierarchical attention mechanism is then used to com- bine the encoder-level information. To demonstrate the effectiveness of the proposed model, experiments are conducted on Wall Street Journal (WSJ) and CHiME-4, resulting in relative Word Error Rate (WER) reduction of 18.0− 32.1%. Moreover, the proposed MEMR model achieves 3.6% WER in the WSJ eval92 test set, which is the best WER reported for an end-to-end system on this benchmark. Index Terms -- End-to-End Speech Recognition, Hierarchi- cal Attention Network, Encoder-Decoder, Connectionist Temporal Classification, Multi-Encoder Multi-Resolution 1. INTRODUCTION Recent advancements in deep neural networks enabled several prac- tical applications of automatic speech recognition (ASR) technol- ogy. The main paradigm for an ASR system is the so-called hybrid approach, which involves training a DNN to predict context depen- dent phoneme states (or senones) from the acoustic features. Dur- ing inference the predicted senone distributions are provided as in- puts to decoder, which combines with lexicon and language model to estimate the word sequence. Despite the impressive accuracy of the hybrid system, it requires hand-crafted pronunciation dictio- nary based on linguistic assumptions, extra training steps to derive context-dependent phonetic models, and text preprocessing such as tokenization for languages without explicit word boundaries. Conse- quently, it is quite difficult for non-experts to develop ASR systems for new applications, especially for new languages. End-to-End speech recognition approaches are designed to di- rectly output word or character sequences from the input audio sig- nal. This model subsumes several disjoint components in the hybrid ASR model (acoustic model, pronunciation model, language model) into a single neural network. As a result, all the components of an end-to-end model can be trained jointly to optimize a single objec- tive. Two dominant end-to-end architectures for ASR are Connec- tionist Temporal Classification (CTC) [1, 2, 3] and attention-based encoder decoder [4, 5] models. While CTC efficiently addresses sequential problem (speech vectors to word sequence mapping) by avoiding the alignment pre-construction step using dynamic pro- gramming, it assumes conditional independence of label sequence given the input. Attention model does not assume conditional in- dependence of label sequence resulting in a more flexible model. However, attention-based methods encounter difficulty in satisfying the speech-label monotonic property. To alleviate this issues, a joint CTC/Attention framework was proposed in[6, 7, 8]. The joint model was shown to provide the state-of-the-art end-to-end results in sev- eral benchmark datasets [8]. In end-to-end ASR approaches, the encoder acts as an acoustic model providing higher-level features for decoding. Bi-directional Long Short-Term Memory (BLSTM) has been widely used due to its ability to model temporal sequences and their long-term depen- dencies as the encoder architecture; Deep convolutional Neural Net- work (CNN) was introduced to model spectral local correlations and reduce spectral variations in end-to-end framework [7, 9]. The en- coder architecture combining CNN with recurrent layers, was sug- gested to address the limitation of LSTM. While temporal subsam- pling in RNN and max-pooling in CNN aim to reduce the compu- tational complexity and enhance the robustness, it is likely that sub- sampling technique results in loss of temporal resolution. In this work, we propose a Multi-Encoder Multi-Resolution (MEMR) model within the joint CTC/Attention framework. This is strongly motivated by the success of multi-stream paradigm in Hybrid ASR [10, 11, 12] mimicking human speech processing cog- nitive system. Two parallel encoders with heterogeneous structures, RNN-based and CNN-RNN-based, are mutually complementary in characterizing the speech signal. Several studies have shown that attention-based model benefits from having multiple attention mechanisms [13, 14, 15, 16, 17, 18]. Inspired by the advances in Hierarchical Attention Network (HAN) in document classification [16], multi-modal video description [17] and machine translation [18], we adapt HAN into our MEMR model. The encoder that carries the most discriminate information for the prediction can dynamically receive a stronger weight. Each encoder is associated with a CTC network to guide the frame-wise alignment process for individual encoder. This paper is organized as follows: section 2 explains the joint CTC/Attention model. The description of the proposed MEMR framework is in section 3. Experiments with results and several analyses are presented in section 4. Finally, in section 5 the conclu- sion is derived. 2. JOINT CTC/ATTENTION MECHANISM In this section, we review the joint CTC/attention architecture, which takes advantage of both CTC and attention-based end-to-end ASR approaches during training and decoding. 2.1. Connectionist Temporal Classification (CTC) Following Bayes decision theory, CTC enforces a monotonic map- ping from a T -length speech feature sequence, X = {xt ∈ RDt = 1, 2, ..., T}, to an L-length letter sequence, C = {cl ∈ Ul = 1, 2, ..., L}. Here xt is a D-dimensional acoustic vector at frame t, and cl is at position l a letter from U, a set of distinct letters. frame-wise latent variable sequences, Z = {zt ∈ U(cid:83) blankt = The CTC network introduces a many-to-one function from 1, 2, ..., T}, to letter predictions of shorter lengths. Note that the additional "blank" symbol is used to handle the merging of repeat- ing letters. With several conditional independence assumptions, the posterior distribution, p(CX), is represented as follows: p(ztX) (cid:44) pctc(CX), (1) p(CX) ≈(cid:88) (cid:89) Z t where p(ztX) is a frame-wise posterior distribution, and we also define the CTC objective function pctc(CX). CTC preserves the benefits that it avoids the HMM/GMM construction step and prepa- ration of pronunciation dictionary. 2.2. Attention-based Encoder-Decoder During inference, the joint CTC/Attention model performs a label-synchronous beam search. The most probable letter sequence C given the speech input X is computed according to C = arg max C∈U∗{λ log pctc(CX) + (1 − λ) log patt(CX) + γ log plm(C)} (4) where external RNN-LM probability log plm(C) is added with a scaling factor γ. 3. PROPOSED MEMR FRAMWORK The overall architecture is shown in Fig. 1. Two types of encoders with different temporal resolutions are presented in parallel to cap- ture acoustic information in various ways, followed by an atten- tion fusion mechanism together with per-encoder CTC. An external RNN-LM is also involved during the inference step. We will de- scribe the details of each component in the following sections. As one of the most commonly used sequence modeling techniques, the attention-based framework selectively encodes an audio se- quence of variable length into a fixed dimension vector represen- tation, which is then consumed by the decoder to produce a dis- tribution over the outputs. We can directly estimate the posterior distribution p(CX) using the chain rule: L(cid:97) p(CX) = p(clc1, ..., cl−1, X) (cid:44) patt(CX), (2) l=1 where patt(CX) is defined as the attention-based objective func- tion. Typically, a BLSTM-based encoder transforms the speech vec- tors X into frame-wise hidden vector ht If the encoder subsam- ples the input by a factor s, there will be T /s time steps in H = {h1, ..., hT /s}. The letter-wise context vector rl is formed as a weighted summation of frame-wise hidden vectors H using content- based attention mechanism. In comparison to CTC, not requiring conditional independence assumptions is one of the advantages of using the attention-based model. However, the attention is too flexible to satisfy monotonic alignment constraint in speech recognition tasks. 2.3. Joint CTC/Attention The joint CTC/Attention architecture benefits from both CTC and attention-based models since the attention-based encoder-decoder is trained together with CTC within the Multi-Task Learning (MTL) framework. The encoder is shared across CTC and attention-based encoders. And the objective function to be maximized is a loga- rithmic linear combination of the CTC and attention objectives, i.e., pctc(CX) and p att(CX): † att(CX), LM T L = λ log pctc(CX) + (1 − λ) log p † (3) where λ is a tunable scalar satisfying 0 ≤ λ ≤ 1. p att(CX) is an † approximated letter-wise objective where the probability of a predic- tion is conditioned on previous true labels. Fig. 1: The Multi-Encoder Multi-Resolution Architecture. 3.1. Multi-Encoder with Multi-Resolution We propose a Multi-Encoder Multi-Resolution (MEMR) architec- ture that has two encoders, RNN-based and CNN-RNN-based. Both encoders take the same input features in parallel operating on differ- ent temporal resolutions, aiming to capture complimentary informa- tion in the speech. Encoder1Encoder2Attention1Attention2Stream AttentionDecoderCTC1CTC2RNNLM……c1c2clcL−1cLCH1CH2BeamformingArray1Array2x11h11,h12,...,h1T/4h21,h22,...,h2T/4r2lrlr1l…x12x2T…x21x22x1TEncoder1 BLSTMEncoder2 VGGBLSTMAttention1Attention2Stream AttentionDecoderCTC1CTC2RNNLM……x1h11,h12,...,h1Th21,h22,...,h2T/4r2lrlr1l…x2xTcL−1cLclc1c2 The RNN-based encoder is designed to model temporal se- quences with their long-range dependencies. In MEMR, the BLSTM encoder has only BLSTM layers that extract the frame-wise hidden vector h1 t without subsampling in any layer: t = Encoder1(X) (cid:44) BLSTMt(X) h1 (5) with different temporal resolutions and network architectures, per- encoder CTC can further align speech with labels in a monotonic order and customize the sequence modeling of individual streams. During training and decoding steps, we follow Eq. (3) and (4) with a change of the CTC objective log pctc(CX) in the following way: where the BLSTM decoder is labeled as index 1. The combination of CNN and RNN allows the convolutional feature extractor applied on the input to reveal local correlations in both time and frequency dimensions. The RNN block on top of CNN makes it easier to learn temporal structure from the CNN output, to avoid modeling direct speech features with more underlying varia- tions. The pooling layer is essential in CNN to reduce the spatial size of the representation to control over-fitting. In MEMR, we use the initial layers of the VGG net architecture [19] followed by BLSTM layers as VGGBLSTM decoder labeled as index 2: t = Encoder2(X) (cid:44) VGGBLSTMt(X). h2 (6) The configuration of convolutional layers in VGGBLSTM encoder is the same as in [7]. 3.2. Hierarchical Attention Since the encoders in MEMR describe the speech signal differently by catching acoustic knowledge in their own ways, encoder-level fusion is suitable to boost the network's ability to retrieve the rele- vant information. We adapt Hierarchical Attention Network (HAN) in [16] for information fusion. The decoder with HAN is trained to selectively attend to appropriate encoder, based on the context of each prediction in the sentence as well as the higher-level acoustic features from both encoders, to achieve a better prediction. The letter-wise context vectors, r1 l and r2 l , from individual en- coders are computed as follows: (cid:88)T r1 l = (cid:88)T /4 t=1 lth1 a1 t , r2 l = t=1 lth2 a2 t , (7) where the attention weights are obtained using a scontent-based at- tention mechanism. Note that since Encoder2 performs downsam- pling by 4, the summation is till T /4 in Eq. (7). The fusion context vector rl is obtained as a convex combination l and r2 l as illustrated in the following: of r1 rl = βl1r1 l + βl2r2 l , (8) βli = ContentAttention(ql−1, ri (9) The stream-level attention weights βl1 and βl2 are estimated accord- ing to the previous decoder state, ql−1, and context vectors, r1 l and r2 l , from individual encoders as described in Eq. (9). The fusion context vector is then fed into the decoder to predict the next letter. l), i = 1, 2. 3.3. Per-encoder CTC In the CTC/Attention model with a single encoder, the CTC objec- tive serves as an auxiliary task to speed up the procedure of realiz- ing monotonic alignment and providing a sequence-level objective. In the MEMR framework, we introduce per-encoder CTC where a separate CTC mechanism is active for each encoder stream during training and decoding. Sharing one set of CTC among encoders is a soft constraint that limits the potential of diverse encoders to re- veal complimentary information. In the case that both encoders are log pctc(CX) = 1 2 λ(log pctc1 (CX) + log pctc2 (CX)), (10) where joint CTC loss is the average of per-encoder CTCs. 4. EXPERIMENTS 4.1. Experimental Setup We demonstrate our proposed MEMR model using two datasets: WSJ1 [20] (81 hours) and CHiME-4 [21] (18 hours). In WSJ1, we used the standard configuration: "si284" for training, "dev93" for validation, and "eval92" for test. The CHiME-4 dataset is a noisy speech corpus recorded or simulated using a tablet equipped with 6 microphones in four noisy environments: a cafe, a street junction, public transport, and a pedestrian area. For training, we used both "tr05 real" and "tr05 simu" with additional WSJ1 corpora to support end-to-end training. "dt05 multi isolated 1ch track" is used for val- idation. We evaluated the real recordings with 1, 2, 6-channel in the evaluation set. The BEAMFORMIT method was applied to multi- channel evaluation. In all experiments, 80-dimensional mel-scale filterbank coefficients with additional 3-dimensional pitch features served as the input features. The Encoder1 contains four BLSTM layers, in which each layer has 320 cells in both directions followed by a 320-unit linear pro- jection layer. The Encoder2 combines the convolution layers with RNN-based network that has the same architecture as Encoder1. A content-based attention mechanism with 320 attention units is used in encoder-level and frame-level attention mechanisms. The decoder is a one-layer unidirectional LSTM with 300 cells. We use 50 dis- tinct labels including 26 English letters and other special tokens, i.e., punctuations and sos/eos. We incorporated the look-ahead word-level RNN-LM [25] of 1-layer LSTM with 1000 cells and 65K vocabulary, that is, 65K- dimensional output in Softmax layer. In addition to the original speech transcription, the WSJ text data with 37M words from 1.6M sentences was supplied as training data. RNN-LM was trained sep- arately using Stochastic Gradient Descent (SGD) with learning rate = 0.5 for 60 epochs. The MEMR model is implemented using Pytorch backend on ESPnet. Training procedure is operated using the AdaDelta algo- rithm with gradient clipping on single GPUs, "GTX 1080ti". The mini-batch size is set to be 15. We also apply a unigram label smoothing technique to avoid over-confidence predictions. The beam width is set to 30 for WSJ1 and 20 for CHiME-4 in decod- ing. For model jointly trained with CTC and attention objectives, λ = 0.2 is used for training, and λ = 0.3 for decoding. RNN-LM scaling factor γ is 1.0 for all experiments with the exception of using γ = 0.1 in decoding attention-only models. 4.2. Results The overall experimental results on WSJ1 and CHiME-4 are shown in Table 1. Compared to joint CTC/Attetion single-encoder mod- els, the proposed MEMR model with per-encoder CTC and HAN achieves relative improvements of 9.6% (28.4% → 26.4%) in Table 1: Comparison among single-encoder end-to-end models with BLSTM or VGGBSLTM as the encoder, the MEMR model and prior end-to-end models. (WER: WSJ1, CHiME-4) Table 2: Comparison between the MEMR model and VGGBSLTM single-encoder model with similar network size. (WER: WSJ1, CHiME-4) Model BLSTM (Single-Encoder) CTC ATT CTC+ATT VGGBLSTM (Single-Encoder) CTC ATT CTC+ATT BLSTM+VGGBLSTM (MEMR) CTC ATT CTC(shared)+ATT CTC(shared)+ATT+HAN CTC(per-enc)+ATT CTC(per-enc)+ATT+HAN Previous Studies RNN-CTC [2] Eesen [3] Temporal LS + Cov. [22] E2E+regularization[23] Scatt+pre-emp[24] Joint e2e+look-ahead LM[25] RCNN+BLSTM+CLDNN [26] EE-LF-MMI [27] CHiME-4 et05 real 1ch WSJ1 eval92 62.7 50.2 29.2 50.6 42.2 29.6 49.1 44.3 26.8 26.9 26.6 26.4 - - - - - - - - 36.4 20.8 4.6 19.1 17.2 5.6 15.2 18.9 4.4 4.3 4.1 3.6 8.2 7.4 6.7 6.3 5.7 5.1 4.3 4.1 CHiME-4 and 21.7% in WSJ1 (4.6% → 3.6%) in terms of WER. We compare the MEMR model with other end-to-end ap- proaches, and it outperforms all of the systems from previous studies. We design experiments with fixed encoder-level attention βl1 = βl2 = 0.5. And the MEMR model with HAN outper- forms the ones without parameterized stream attention. Moreover, per-encoder CTC constantly enhances the performance with or without HAN. Specially in WSJ1, the model shows notable decrease (4.3% → 3.6%) in WER with per-encoder CTC. Our results further confirms the effectiveness of joint CTC/Attention architecture in comparison to models with either CTC or attention network. For fair comparison, we increase the number of BLSTM layers from 4 to 8 in Encoder2 to train a single-encoder model. In Table 2, the MEMR system outperforms the single-encoder model by a significant margin with similar amount of parameters, 21.9M v.s. 21.3M. In CHiME-4, we evaluate the model using real test data from 1, 2, 6-channel resulting in an average of 19% relative improvement from all three setups. In WSJ1, we reach 3.6% WER in eval92 in our MEMR framework with relatively 32.1% improvement. The results in Table 3 shows the contribution of multiple reso- lution. The WER goes up when increasing subsampling factor s1 closer to s2 = 4 in both datasets. In other words, the fusion works better when two encoders are more heterogeneous which supports our hypothesis. As shown in Table 4, We analyze the average stream- level attention weight for Encoder2 when we gradually decrease the number of LSTM layers while keeping Encoder1 with the original Data CHiME-4 et05 real 1ch et05 real 2ch et05 real 6ch WSJ1 eval92 Single-Encoder (21.9M) Proposed Model (21.3M) 32.2 26.8 21.7 5.3 26.4 (18.0%) 21.9 (18.3%) 17.2 (20.8%) 3.6 (32.1%) Table 3: Effect of Multi-Resolution Configuration (s1, s2), where s1 and s2 are the subsampling factors for Encoder1 and Encoder2, respectively. (WER: WSJ1, CHiME-4) Data CHiME-4 et05 real 1ch WSJ1 eval92 (4,4) (2,4) (1,4) 29.1 27.0 26.4 4.5 4.2 3.6 configuration. It aims to show that HAN is able to attend to the appropriate encoder seeking for the right knowledge. As suggested in the table, more attention goes to Encoder1 from Encoder2 as we intentionally make Encoder2 weaker. Table 4: Analysis of Hierarchical Attention mechanism when when fixing Encoder1 and changing the number of LSTM layers in Encoder2. (WER: CHiME-4) # LSTM Layers Average Stream Attention in VGGBLSTM for VGGBLSTM WER % 0 1 2 3 4 0.27 0.52 0.75 0.82 0.81 30.6 29.8 28.9 27.8 26.4 5. CONCLUSION In this work, we present our MEMR framework to build an end- to-end ASR system. Higher-level frame-wise acoustic features are carried out from RNN-based and CNN-RNN-based encoders with subsampling only in convolutional layers. Stream fusion selectively attends to each encoder via a content-based attention. We also inves- tigated that assigning a CTC network to individual encoder further enhance the heterogeneous configuration of encoders. The MEMR model outperforms various single-encoder models, reaching the state-of-the-art performance on WSJ among end-to-end systems. 6. REFERENCES [1] Alex Graves, Santiago Fern´andez, Faustino Gomez, and Jurgen Schmidhuber, la- belling unsegmented sequence data with recurrent neural net- in International Conference on Machine learning works," (ICML), 2006, pp. 369 -- 376. "Connectionist temporal classification: [2] Alex Graves and Navdeep Jaitly, "Towards end-to-end speech recognition with recurrent neural networks," in International Conference on Machine Learning (ICML), 2014, pp. 1764 -- 1772. [3] Yajie Miao, Mohammad Gowayyed, and Florian Metze, "EESEN: End-to-end speech recognition using deep RNN models and WFST-based decoding," in IEEE Workshop on Au- tomatic Speech Recognition and Understanding (ASRU), 2015, pp. 167 -- 174. [4] William Chan, Navdeep Jaitly, Quoc V Le, and Oriol Vinyals, "Listen, attend and spell: A neural network for large vocab- in IEEE Interna- ulary conversational speech recognition," tional Conference on Acoustics, Speech and Signal Processing (ICASSP), 2015. [5] Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio, "Attention-based mod- els for speech recognition," in Advances in Neural Information Processing Systems (NIPS), 2015, pp. 577 -- 585. [6] Suyoun Kim, Takaaki Hori, and Shinji Watanabe, "Joint CTC- attention based end-to-end speech recognition using multi- task learning," in IEEE International Conference on Acous- tics, Speech and Signal Processing (ICASSP), 2017, pp. 4835 -- 4839. [7] Takaaki Hori, Shinji Watanabe, Yu Zhang, and William Chan, "Advances in joint CTC-attention based end-to-end speech recognition with a deep CNN encoder and RNN-LM," in IN- TERSPEECH, 2017. [8] Shinji Watanabe, Takaaki Hori, Suyoun Kim, John R Hershey, and Tomoki Hayashi, "Hybrid ctc/attention architecture for end-to-end speech recognition," IEEE Journal of Selected Top- ics in Signal Processing, vol. 11, no. 8, pp. 1240 -- 1253, 2017. "Very deep convolutional networks for end-to-end speech recognition," in IEEE International Conference on Acoustics, Speech and Sig- nal Processing, 2017. [9] Yu Zhang, William Chan, and Navdeep Jaitly, [10] Sri Harish Reddy Mallidi et al., A Practical and Efficient Multistream Framework for Noise Robust Speech Recognition, Ph.D. thesis, Johns Hopkins University, 2018. [11] Hynek Hermansky, "Multistream recognition of speech: Deal- ing with unknown unknowns," Proceedings of the IEEE, vol. 101, no. 5, pp. 1076 -- 1088, 2013. [12] Sri Harish Mallidi and Hynek Hermansky, "Novel neural net- work based fusion for multistream asr," in Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on. IEEE, 2016, pp. 5680 -- 5684. [13] Tomoki Hayashi, Shinji Watanabe, Tomoki Toda, and Kazuya Takeda, "Multi-head decoder for end-to-end speech recogni- tion," in Proc. Interspeech 2018, 2018, pp. 801 -- 805. [14] Chung-Cheng Chiu, Tara N Sainath, Yonghui Wu, Rohit Prab- havalkar, Patrick Nguyen, Zhifeng Chen, Anjuli Kannan, Ron J Weiss, Kanishka Rao, Ekaterina Gonina, et al., "State-of-the- art speech recognition with sequence-to-sequence models," in 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2018, pp. 4774 -- 4778. [15] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszko- reit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin, "Attention is all you need," in Advances in Neural Information Processing Systems, 2017, pp. 5998 -- 6008. [16] Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy, "Hierarchical attention networks for document classification," in Proceedings of the 2016 Con- ference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2016, pp. 1480 -- 1489. [17] Chiori Hori, Takaaki Hori, Teng-Yok Lee, Ziming Zhang, Bret Harsham, John R Hershey, Tim K Marks, and Kazuhiko Sumi, "Attention-based multimodal fusion for video description," in Computer Vision (ICCV), 2017 IEEE International Conference on. IEEE, 2017, pp. 4203 -- 4212. [18] Jindrich Libovick`y and Jindrich Helcl, "Attention strategies for multi-source sequence-to-sequence learning," in Proceedings of the 55th Annual Meeting of the Association for Computa- tional Linguistics (Volume 2: Short Papers), 2017, vol. 2, pp. 196 -- 202. [19] Karen Simonyan and Andrew Zisserman, "Very deep convo- lutional networks for large-scale image recognition," arXiv preprint arXiv:1409.1556, 2014. [20] Linguistic Data Consortium, "CSR-II (wsj1) complete," Lin- guistic Data Consortium, Philadelphia, vol. LDC94S13A, 1994. [21] Emmanuel Vincent, S Watanabe, Jon Barker, and Ricard Marxer, "The 4th chime speech separation and recognition challenge," 2016. [22] Jan Chorowski and Navdeep Jaitly, "Towards better decoding and language model integration in sequence to sequence mod- els," arXiv preprint arXiv:1612.02695, 2016. [23] Yingbo Zhou, Caiming Xiong, and Richard Socher, "Improved regularization techniques for end-to-end speech recognition," arXiv preprint arXiv:1712.07108, 2017. [24] Neil Zeghidour, Nicolas Usunier, Gabriel Synnaeve, Ronan "End-to-end speech arXiv preprint Collobert, and Emmanuel Dupoux, recognition from the raw waveform," arXiv:1806.07098, 2018. [25] Takaaki Hori, Jaejin Cho, and Shinji Watanabe, "End-to-end speech recognition with word-based RNN language models," arXiv preprint arXiv:1808.02608, 2018. [26] Yisen Wang, Xuejiao Deng, Songbai Pu, and Zhiheng Huang, "Residual convolutional ctc networks for automatic speech recognition," arXiv preprint arXiv:1702.07793, 2017. [27] Hossein Hadian, Hossein Sameti, Daniel Povey, and Sanjeev Khudanpur, "End-to-end speech recognition using lattice-free mmi," Proc. Interspeech 2018, pp. 12 -- 16, 2018.
1607.07788
1
1607
2016-02-05T17:59:55
How scientific literature has been evolving over the time? A novel statistical approach using tracking verbal-based methods
[ "cs.CL", "cs.DL" ]
This paper provides a global vision of the scientific publications related with the Systemic Lupus Erythematosus (SLE), taking as starting point abstracts of articles. Through the time, abstracts have been evolving towards higher complexity on used terminology, which makes necessary the use of sophisticated statistical methods and answering questions including: how vocabulary is evolving through the time? Which ones are most influential articles? And which one are the articles that introduced new terms and vocabulary? To answer these, we analyze a dataset composed by 506 abstracts and downloaded from 115 different journals and cover a 18 year-period.
cs.CL
cs
JSM 2014 - Section on Statistical Learning and Data Mining How scientific literature has been evolving over the time? A novel statistical approach using tracking verbal-based methods. Daría Micaela Hernándeza,b, Mónica Bécue-Bertautb, Igor Barahonab. a Centro Mexicano de Estudios Económicos y Sociales Napoleón 54, Col. Moderna 3500, México D.F. (México) b Universitat Politècnica de Catalunya Department of Statistics and Operational Research, Jordi Girona 1-3, 08034 Barcelona (Spain) Abstract This paper provides a global vision of the scientific publications related with the Systemic Lupus Erythematosus (SLE), taking as starting point abstracts of articles. Through the time, abstracts have been evolving towards higher complexity on used terminology, which makes necessary the use of sophisticated statistical methods and answering questions including: how vocabulary is evolving through the time? Which ones are most influential articles? And which one are the articles that introduced new terms and vocabulary? To answer these, we analyze a dataset composed by 506 abstracts and downloaded from 115 different journals and cover a 18 year-period. Keywords: Textual statistics; Correspondence analysis; Multiple factor analysis for contingency tables; Systemic Lupus Erythematosus; Characteristics words; Pioneer papers. 1. Introduction New advances on science are developed on what was previously discovered. These are the foundations for introducing new progress and knowledge. At this respect, researchers have to establish differences among what is known and what is still to investigate. In this paper, a collection of abstracts is considered as what is known and thereby the starting point. This collection was created by downloading each paper (or abstract) individually from scientific databases. Later, by applying several statistical methods, it was possible to handle this large dataset and extract relevant information from it. Multidimensional methods as correspondence analysis and factorial analysis are applied for obtaining intriguing conclusions. This paper provides a global vision of the scientific publications related with the Systemic Lupus Erythematosus (SLE), taking as starting point article abstracts. Through the time, abstracts have been evolving towards higher complexity on used terminology, which makes necessary the use of sophisticated statistical methods and answering questions including: how vocabulary is evolving through the time? Which ones are most influential articles? And which one are the articles that introduced new terms and vocabulary? To answer these, we analyze a dataset composed by 506 abstracts and downloaded from 115 different journals and cover a 18 year-period. 2185 JSM 2014 - Section on Statistical Learning and Data Mining Moreover, it is illustrated how two types of multivariate analysis for integrating the year of publication of each abstract, and finding out changes on topics and vocabulary, are applied. The analysis presented on further pages allowed us to identify trends and changes in the vocabulary through the passing of the years, which later are presented on didactic and easy-to-understand visual representations. On next section materials and methods are presented. The obtained results on section 3 are discussed. Finally conclusions and further lines of research on section 4 are provided. 2. Materials and methods 2.1. Data collection. We focus our attention on Systemic Lupus Erythematosus, known as SLE or simply "Lupus". Systemic Lupus Erythematosus (SLE) is a disease on which the immune system attacks cells and tissue of the body, resulting in inflammation and damage. There is not cure for SLE and its course is unpredictable. On figure 1, the most common manifestations of SLE are displayed and more information related with its symptoms on http://www.lupusuk.org.uk/ can be found. Figure 1. Most common manifestations of SLE As documented below, the literature available on SLE has dramatically increased over the past 20 years. The criteria for selecting the abstracts included on the study are based on guidelines provided by the specialized SLE research group of the Hospital Clinic at Barcelona, Spain. Basically, abstracts must show two features in order to be included on this research: first, the name "SLE" should be on the title and each abstract should refer to clinical trials. Only English written documents were considered. Implementing these criteria in our search engines produced 506 abstracts which were published between January 1994 and December 2012. All documents were downloaded from MEDLINE As additional measures of standardization, all the included abstracts should observe title, authors, journal name and year of publication. In this way, the total number of abstracts represents our object of study, and therefore we apply several statistical methods, including correspondence analysis and multiple factor analysis for contingency, on it. On Figure 2A the collected abstracts are classified by year of publication. Figure 2B shows the same abstracts classified by the journal of publication. Note that the year with the biggest number of publications is 2007, equal to 42 articles. Only eight journals have published more than 10 articles concerning this topic. Five journals, Arthritis and Rheumatism, Lupus, The Journal of Rheumatology, Rheumatology Oxford, England and Annals of the Rheumatic Diseases, concentrate the 60 % of the articles. 2186 JSM 2014 - Section on Statistical Learning and Data Mining Figure 2A. Number of articles per year Figure 2B. Number of articles per journal 2.2 Features of the dataset. The final corpus includes 118,094 tokens that correspond to 6,834 different words. This is an average length of 233 tokens. No lemmatization was carried out and the words were taking preserving their graphical form. Words with an occurrence of less than 5 abstracts and frequency lower than 10 times, were removed. Prepositions, conjunctions, personal pronouns and demonstratives were also removed. Figure 2 displays the structure of the corpus. It has 506 rows and 1120 columns. The rows are related to the abstracts while the columns to the words. Figure 3. Matrix abstracts × word. 2.3. Aims of the statistical analysis of the bibliography Content-based bibliographic studies is a discipline that attempts to detect main topics in a research domain. By making use of associations or distinctions, researchers might track changes, advances and novelties on big textual datasets. Under this perspective, counting words for topic identification makes sense because it is inferred that documents using the same words are closely related on topic and field (Benzécri, 1981). At this respect, correspondence analysis (CA) techniques (Benzécri, 1973, 1981; Lebart, L., Salem, A., & Berry, 1998; Murtagh, 2005) have proved to be a suitable tool for seeking similarities among documents by identifying words co-occurrences. The above makes the CA a useful tool to be applied on text mining (Bansard et al., 2007; Kerbaol, Bansard, & Coatrieux, 2006; Kerbaol & Bansard, 2000; Morin & Rennes, 2006; Rouillier, Bansard, & Kerbaol, 2002; Šilić, Morin, Chauchat, & DalbeloBašić, 2012). 2187 AbstractsWords 12....506ncol(Y)=1120nrow(Y)=506fijfij: Word frequencyj in theabstractinrow(X)=506ncol(X)=21) R12)R212)R12Journal.....199419952012Year..... JSM 2014 - Section on Statistical Learning and Data Mining When doing textual mining, it is identified that progress on science takes place by establishing a link among pioneer words of the first publications, which later are complemented or enriched by further authors. This progress is expressed on how the vocabulary evolves over the time, and how the introduced words are adopted on further research. To track the evolution, a time-oriented viewpoint is adopted, but the word co-occurrence approach is maintained. Multiple factor analysis for contingency tables (MFACT; (Bécue-Bertaut & Pagès, 2004, 2008) are applied on these purposes. Maps of words and abstracts, which takes into account both chronology and co-occurrences, are utilized for disclosing the evolutions on vocabulary by the passing of the years. In other words, by taking advantage of the features of MFACT for comparing chronology and vocabulary on the abstracts, novelties are spotted. MFACT is also a powerful tool for identifying abrupt changes on vocabulary or periods characterized by a flat use of words. 2.4. Correspondence analysis From a content point of view, correspondence analysis (CA) is an essential statistical method for performing text mining (Benzécri, 1981; Lebart, 1998; Murtagh, 2005). At first, the corpus has to be encoded into a lexical table, on which rows are the abstracts while words are the columns. The weights for row-abstracts and column-words are automatically handled on the CA analysis. The proportionality among the margins of the lexical table, the length of abstracts and word counts are also managed during the analysis. In similar way, rows and columns spaces, which are given by the chi-square distances, are used for computing the principal axes on each chart. As result, abstracts are mapped closer when they use a similar vocabulary, and words are mapped closer when they are more frequently present on the same abstract. This demonstrates the suitability of CA for retrieving synonym-relationships without introducing external information on the dataset. That is to say, abstracts whose content is closer on meaning, but expressed on different words, are plotted closer together. Additionally, CA allows us to plot elements of the corpus on a particular way, on which hidden relations among words and abstracts are uncovered. Consequently, it identifies similarities and differences between abstracts in terms of vocabulary or content (Lebart, L., Salem, A., & Berry, 1998). Basically three types of useful information is obtained from the CA.  Similarities among abstracts based on their verbal content.  Similarities among words based on their distribution.  Associations among words, based on their context.  Mutual associations among abstracts and words through a simultaneous representation of rows and columns, respectively. Regarding with its interpretation, CA seeks, axis by axis, the "metakeys" and "metadocs" which better characterize similarities among abstracts based on their verbal content. For example, on a given axis, a "metakey+"/"metakey" is defined by the set of words which most contribute the inertia and simultaneously, is projected on the positive/negative part of the axis (Kerbaol et al., 2006). Therefore, two "metakeys" or two "metadocs" characterize each axis depending on the word/abstract configuration. The highest contributory word/abstracts are projected at only one axis. With this, it is evident that words belonging to the same metakey are frequently used on the same abstracts and, consequently, they relate to the same topic. It is to say that one particular word is used on two or more different contexts. Note that a different context is associated with different meaning. For instance, the word "manifestations" may be referred to the declarations that somebody makes about a particular topic. In contrast, the same word might be used as synonym of "symptoms" observed on the patient. Likewise, the words included on high number of metakeys, known as high dimensional words, provide an important weight to differentiate topics on the corpus. A "metadoc" and a "metakey" which are characterized on the same axis, are quantitatively related through CA. The abstracts that belong to the same "metadoc" use words associated with the same "matekey". In this 2188 JSM 2014 - Section on Statistical Learning and Data Mining way, abstracts related with the same topic, are rapidly clustered by identifying their associated metakeys. 2.5. Multiple factor analysis for contingency tables According with Escofier & Pagès (2008), the Multiple Factor Analysis (MFA) offers the possibilities for introducing the chronology as active on the analysis and further mapping the abstracts based on their vocabulary. It is similar to CA, but also adding publication year. 2.5.1. Principles The MFACT (Bécue-Bertaut, Álvarez-Esteban, & Pagès, 2008; Bécue-Bertaut & Pagès, 2004), is an extension of the MFA. It is able to multiple tables by juxtaposing several quantitative, categorical and frequency columns. In order to apply MFACT on this research, data is structured on the following way. The abstracts are described by both the vocabulary and the chronology. MFACT gives an active role to both vocabulary and chronology, but balances their influence in the global analysis. If a relationship does exist between chronology and vocabulary, then the given axis will be highly correlated with them. On Bécue-Bertaut et al., (2008) a detailed explanation of how MFACT are applied on text mining is provided. 2.5.2. Types of results In the case of the particular structure described above, MFACT offers the following:  Global results on the active rows and columns: eigenvalues, representations of the row-abstracts and column-words. In this global representation, the distance between two abstracts corresponds to the weighted sum of the distances induced by both the vocabulary (as in CA performed on the lexical table) and the standardized chronology (classical Euclidean distance).  Partial results on the active rows and columns: superimposed representations of the abstracts from either the chronology or the vocabulary viewpoint, easing the discovery of those abstracts that are more advanced in the use of vocabulary (here, called pioneer works because their vocabulary is used in advanced way). Illustrative columns can be introduced and displayed on the principal graphs. Year-in-categories and journal, both considered as categorical illustrative variables, are of interest. Year- in-categories is built from the quantitative variable publication year, with the different years as the categories of this variable. Each category (year or journal) is displayed, as illustrative, at the centroid of the abstracts published during that year or journal, either on the global or partial (chronology or vocabulary) representations.  The category-years from only the vocabulary viewpoint. The trajectory of the years is the trace of the vocabulary evolution and its rhythm, with possible steps forwards or backwards. This trajectory detects gaps in vocabulary renewal and leads to the discovery of abrupt changes and identifies lexically homogeneous periods in the corpus. 2.5.3. Validation A test based on permutations assesses the significance of the first global eigenvalue that accounts for the link between chronology and vocabulary. The null hypothesis is the exchangeability of the publication year with respect to the abstracts or, equivalently, the non-existence of a chronological 2189 JSM 2014 - Section on Statistical Learning and Data Mining dimension in the vocabulary variability. Thus, the rows of the column-year are randomly permuted, for every permutation a MFACT is performed, leading to an empirical distribution of the first eigenvalue under the null hypothesis. A large, number of replications allows to obtain the p-value associated with the observed value of the first eigenvalue (one-tail test). 2.6. Lexical characteristics of periods As mentioned above, a chronological partition of the corpus is obtained by cutting the trajectory of the years from the vocabulary viewpoint (vocabulary partial representation) where large gaps between consecutive years represents substantial changes in the vocabulary. The lexical characterization of the periods facilitates the understanding of the introduced novelties. To characterize these periods, it is possible to identify the following features (Lebart, L., Salem, A., & Berry, 1998):  The characteristic words of each period or words whose frequency in a period is significantly greater than what randomness would indicate. This observation provides evidence about the content of the abstracts of the period.  The characteristic increments or words whose frequency significantly increases in a period compared to the previous periods. The increments denote topics that newly appear in the corpus or sharply increase their presence.  The chronological characteristic words, which are the words assigned to the period or groups of consecutive periods that they best characterize. These words qualify the former information by showing that changes are not abrupt. 2.6.1. Characteristic words With the aim of identify highly frequent (versus highly infrequent) words in parts of the corpus, such as those formed by grouping abstracts on a yearly basis or by journals, the test described hereafter is performed. The following notation is used: – n.., the grand total, that is, the total number of occurrences in the whole corpus; – n.j, the number of occurrences in part j; – ni.., the total count of word i in the whole corpus; – nij the count of word i in part j. The count nij of word i in part j is compared to the other counts that are obtained with all the possible samples composed of n.j occurrences randomly extracted from the whole corpus without replacement (which is the null hypothesis). If the word i is relatively more frequent in part j than in the whole sample, that is, if nij/n.j>ni./n.. (less frequent in part j than in the whole sample), the p- value of the test is computed through (1) (through (2)). 1) 2) 2190 jijnnxjjiijinnxnnnxnp.........,ijnxjjiijinnxnnnxnp1....,.... JSM 2014 - Section on Statistical Learning and Data Mining 2.6.2. Characteristic increments As a chronological corpus is manipulated, words whose usage significantly increases in a given period (characteristic increments) are considered as relevant information. The same test is performed for every couple (word, period), truncating the corpus at the end of the period under study. 2.6.3. Chronological characteristic words Certain words better characterize a group of consecutive periods than a single period. Therefore, each word is successively tested as a possible characteristic word of each period (first level), of each group of two consecutive periods (second level), of each group of three consecutive periods (third level) and so on. A p-value is associated with each test. At the end of the process, each word is assigned as a chronological characteristic word to the period or group of periods that it best characterizes, i.e., to the group of periods associated with the lowest p-value (under the condition that this p-value is under 0.05). Results are detailed discussed on the following section. 3. Results 3.1. Glossary of frequent words Based on the glossary of the principal topics, SLE is classified in six groups: etiology, epidemiology, symptoms, prognosis, diagnostics and treatment. Note that one word might be presented in more than one topic. Figure 4. Topics from the glossary of words 3.2. CA on the abstracts×words table The CA is performed on the table of order 506 abstracts and 1120 words. It provides the metakeys and metadocs associated with the principal axes. The first two axes, with eigenvalues equal to 0.30 and 0.27, correspond to the axes on which a high number of words and abstracts contribute. Note that they account for a minor part of the global inertia (together, 2.72%). This low percentage, typical 2191 Diagnostic and Prognostic AetiologyDrugs and/or TreatmentEpidemiologybrainrenalbiopsyantiphospholipidmethotrexatewomenpulmonarynervousprognosisdsdnacytotoxicracethrombocytopeniahypertensionprognosticdnadietaryethnicchesturinaryresonance hormonalcyclophosphamidecohortarticularcholesterolmagneticatidnaprednisoneafricanvasculitiscardiovasculardiseaselipoproteindoseageblindcarciacillnesshormoneantibodiesmalejointglomerulonephritisbilaggenotypedrughispanicdefectchronicaprilcellintravenoushrqlosymptomssystolicplamaB-Cellhydroxychloroquineethnicitynephropatharthritisvascularestrogenanticardiolipincaucasianabnormalitiesdepletionrheumatologyantibodytherapeuticgenderlunginflammationbloodalleleimmunosuppressivechildrencutaneousneuropsychiatricbmdpathogenesiscorticosteroidmultiethnicplateletbonecalciumsnpschloroquineethnicallypressuredamagesledaigeneazathioprinepopulation toxicityrheumdiedpolymorphismantigenspersonurinecoronaryevaluation geneticimmunoregularorshumanmanifestationsthrombosisinfectiongenotipedrituximabpatientanaemiaatherosclerosischronicpolymerasebelimumabcandidatemortalityhaplotypeblysadultpredictivepharmacokineticscase-controlSymptoms JSM 2014 - Section on Statistical Learning and Data Mining when dealing with large spare matrices but highly significant with respect to the hypothesis of independence between words and abstracts, is frequently associated with a satisfactory structure of the data, as discussed by Lebart et al. (1998). Figure 5. Representation of the most contributory words and abstracts on the first CA principal plane On Figure 5 are shown the metakeys and metadocs which characterize the first principal plane. These metakeys and metadocs gather words and abstracts whose contribution is over 6 times the mean contribution of their respective set on any of the first two axes. The first axis contrasts a set of words (or metakeys) related to Bone Metabolism (BMD, praesterone, calcium, DHEA, therapy, MGDAY, prednisone, spine and lumbar) and Genetic Tendency (allele, gene, polymorphism, genotypes, SNPS, and haplotype). Additionally, these two metakeys are, in turn, opposed on the second axis (Lymphocytes B- aethiopatogeny and therapeutic applications and Life's Quality, Disease Activity and Chronic Damage). These oppositions are also found in the metadocs, or sets of contributory abstracts. A summary of the information conveyed by these and the following axes (up to 50) is provided by the list of the high dimensional words, ranked from the number of dimensions on which they contribute (information not reproduced here). Although a reference is made to main first factorial plane, there are many more topics related to this issue such as treatments, quality of life, chronic damage, clinic consequences, epidemiology and new drugs. See table 1 2192 JSM 2014 - Section on Statistical Learning and Data Mining Table 1. Representation of the metakeys (the most contributory words) and metadocs (the most contributory abstracts) on the 10 firsts CA axes. 2193 TopicsMetakeysMetadocsBone Metabolism BMD,TREATMENT,PLACEBO,MONTHS,PRASTERONE,CALCIUM,DHEA,THERAPY,MGDAY,DOSE,PREDNISONE,WEEKS,SPINE,lumbar,efficacy,randomized,safety,received,month,cholesterol,mgkg,hip,reduction,cyclophosphamide,bone,response,taking,trial,density,baseline,effective,doubleblind,improvement, adverse, mineral, treated, dietary, daily, effects19004038, 18634158, 15801015, 15529389 Genetic Tendency ASSOCIATION,ALLELE,GENE,POLYMORPHISM,ASSOCIATED,POLYMORPHISMS,RISK,SUSCEPTIBILITY,CONTROLS,GENOTYPES,SNPS,GENES,GENETIC,SLE,HAPLOTYPE,EXPRESSION,COHORT,GENOTYPED,CASECONTROL,april,genotype,factors,variants,independent,odds,found,functional,promoter,alleles,fcgammariia,japanese,diagnosis,healthy,population,associations,linkage,presence,damage, ethnicity, confidence, vascular, seizures, hla, cerebrovascular.20498198, 19019891, 17569747, 17307753, 17393452, 17028114, 17092253Lymphocytes B- aethiopatogeny and therapeutic applicationsCELLS,CELL,EXPRESSION,LYMPHOCYTES,DEPLETION,GENE,RITUXIMAB,BLOOD,BETA,ACTIVATION,polymorphisms,susceptibility,peripheral,normal,fcgammariia,dna,autoreactive,controls,polymorphism,proliferation,genotypes,haplotype,healthy,naive,serum,allele,autoimmune,immune,antibodies,genes,lymphocyte,snps,association,anticd,antibody,april, mab, promoter, vitro, flow. 17469136, 17312177, 15529346, 12571855Quality of life, chronic damageDAMAGE,HEALTH,DISEASE,PHYSICAL,SDI,ACTIVITY,SOCIAL,MENTAL,FATIGUE,SCORES,QUALITY,LIFE,FACTORS,PSYCHOSOCIAL,STATUS,PSYCHOLOGICAL,accrual,duration,costs,outcomes,variables,hrqol,mcs,index,insurance,score,canada,international,college,outcome,sliccacr,visits,overall,collaborating,age,diagnosis,selfreported,socioeconomic,race,american,impact,pcs,ethnicity,clinicsamerican,texas,helplessness,slamr,bilag,domains,multivariable, care, african, support, hispanics, analyses. 19327231, 17551377, 16880189, 16905579, 15757968, 11414264, 9034988, 9008599 clinic consequencesSPECT,PERFUSION,DEFECT,BRAIN,MRI,NPSLE,ABNORMALITIES,DIFFUSE,IMAGING,CEREBRAL,PATIENTS,CEREBROVASCULAR,MORTALITY,SYNDROME,CNS,MAGNETIC,RESONANCE,CARDIAC,PULMONARY,INVOLVEMENT,manifestations,diagnostic,positive,psychosis,myocardial,neuropsychiatric,survival,persistent,abnormal,causes,detected,nervous,death,cyclophosphamide,underwent,symptomatic, deaths, useful, central, sensitive, lung, anticoagulant.16342090, 15950567, 14659847, 1160073, 10823333, 9049450, 7980671, 7562753Epidemiology and geneticCALCIUM,BMD,SPINE,GENE,POLYMORPHISM,ALLELE,POLYMORPHISMS,PRASTERONE,SNPS,HAPLOTYPE,APRIL,genotypes,dhea,hip,susceptibility,lumbar,association,expression,density,mineral,genes,premenopausal,placebo,fcgammariia, casecontrol, functional, bone, promoter, cholesterol.19004038, 17307753, 19004038, 20964867, 1915112, 18634158 16342090, 16320346, 15801015, 15529389, 7562753Cardiovascular RiskCALCIUM,BMD,SPECT,SPINE,LUMBAR,PERFUSION,HIP,BONE,PRASTERONE,PREMENOPAUSAL,DEFECT,MINERAL,TAKING,DENSITY,RISK,brain,mri,loss,cardiac,imaging,cholesterol,glucocorticoids,women,pulmonary,abnormalities,hrt,postmenopausal,sle,dhea,diffuse,myocardial,increases, receiving, controls, coronary, significant, artery, dietary..18372357,15797975, 15593203 JSM 2014 - Section on Statistical Learning and Data Mining 3.3. Chronological evolution 3.3.1. MFACT: global analysis on the first plane MFACT is performed on the multiple table by juxtaposing the abstracts×words table (with dimensions 506 ×1120) and the abstracts×year column (with dimensions 506×1), leading to map the abstracts according to both their vocabulary and chronology. The first eigenvalue of MFACT is equal to 1.34. This value is far from randomness, as evidenced by the permutation test (p-value = 0.000 computed from 1000 replications) and is a medium value; in this case, the maximum is equal to 2 (Escofier, B., & Pagès, 1992). The first axis on which the words contribute 33.4% and the year contributes 66.6% of the inertia is a dispersion direction, present in both sets of columns. Words and chronology, that differs from the first principal axis obtained in the separate analysis of the words (that is, in CA). With regard to the words, MFACT conserves a small proportion of the total inertia on the first axes as CA applied to short texts. However, because the first MFACT axis retains a proportion of inertia of the word cloud relatively close to the proportion of inertia explained by the first CA axis. This can be considered as a relevant dispersion direction for the cloud. Regarding to chronology, the high correlation of the MFACT first axis with publication year (corr = 0.94) suggests that this axis accounts for the variability of the vocabulary related to time. Figure 6. Global representation of an excerpt of the words with representation of years_in _categories (illustrative) on the first MFACT principal plane. 2194 SYMPTOMSAETIOLOGYHORMONAL ASPECTSGENETIC ASPECTSGLUCOCORTICOIDSANDIMMUNOREGULATORYGLUCOCORTICOIDSANDIMMUNOSUPPESSIVE JSM 2014 - Section on Statistical Learning and Data Mining Figure 6 shows the global representation of the words and abstracts on the first principal plane. In this figure, the abstracts are differentiated by three time periods (1994–2000; 2001–2006; 2007– 2012). These time divisions are justified in Section 2.5.2. This first axis opposes words related to etiology from two different points of view: genetic aspects and hormonal aspects (on the positive side) and symptoms and drugs (on the negative side). From the quantitative variable year, the categorical variable ''year_in_categories'' is created. The categories-years (or group of years) are projected as illustrative on the first axis at the centroid of the abstracts published during this period, from the global point of view. The most relevant words are also represented on this axis from their coordinates. This representation allows for the replacement of vocabulary renewal into time flow. As expected, the categories-years lie on the first axis in their natural order, although they are separated by different length intervals. 3.4. Segmentation homogeneous periods The segmentation suggested on figure 7 and commented on in the former section is retained. The periods 1994–2000, 2001–2006 and 2007–2012 are described by their lexical features, enabling the characterization of the evolution of the vocabulary. The results are consistent with those illustrated on figure 6. Changes in lexicon are due mainly to clinic symptoms, their etiology and the presence of new developed medications. Figure 7. Lexical chronological characteristics and significant lexical increments. 2195 JSM 2014 - Section on Statistical Learning and Data Mining Figure 6 shows how the studies in medical sciences related to SLE have diversified from 1994 to 2012. In the 1994–2000 period, the main issue was "symptomatoly" and the treatments were almost exclusively based on "anti-malaric" (chloroquine and hydrochloroquine) and "antiinflammatory" (methotrexate and cyclophosphamide) drugs. Both 2001 and 2002 introduced many new words without remarkable changes until 2006, when novelties in genetic and etiology were introduced, as well as the use of glucocorticoids (prednisone) and immune-supressive (azathropine and prasterone) as partial treatment. In the 2007–2012 period, research focused on genetic and hormonal aspects. Some biological therapies have been used (rituximab and belimumab) in this period of time. The words introduced in 2007 showed an increasing interest for the researchers. This year some cohort and case-control were performed and new issues about etiology were also studied. Although topics of interest prior to 2001 remain in the following years, there is a more noticeable homogeneity in the vocabulary observed from 2001–2012 than from 1994–2006, as it is shown by the greater number of chronologically characteristic words relative to 2001–2012 in comparison to 1994–2006. This observation is reinforced by the strong similarity between the lexical increments observed in 2001–2006 and 2007–2012. For instance, Belimumab appears from 2001–2006 (2 citations) and its usage increases from 2007–2012 (55). The words gene(s) are used 4 times from 1994 to 2000, 42 times from 2001 to 2006 and 70 times from 2007 to 2012; The words women, in some cases named female(s), are used 55 times from 1994 to 2000, 93 times from 2001 to 2006 and 127 times from 2007 to 2012, Nowadays, most research has been focused on hormones and their action on bone metabolism, especially on post-menopausal women. Last advance has been related to a new medication (Belimumab) who has an immune-suppressor and immune-regulator activity on B- lymphocytes. It seems that future research will be focused on drugs with similar activity. The methodology becomes more complex and requires more sophisticated statistical methods, frequently imported from other fields 3.4. Pioneer abstracts. The superimposed representation of the partial points-abstracts from either the chronology or vocabulary viewpoint allows for spotting the abstracts with a vocabulary ahead of their date. However, the set of words contributes to only 33.4% of the inertia of the first axis, whereas the column-year contributes 66.6%. This unequal contribution of both sets of columns to the first axis inertia makes the partial points ''chronology'' placed on average farther from the centroid on the first axis than the partial points ''vocabulary''. This is particularly clears the oldest dated abstracts due to their low numbers in the same year. These abstracts tend to mechanically present a partial point ''vocabulary'' ahead of the partial point ''chronology''. On the contrary, this effect, notably less marked, works on the opposite direction in the case of the recent abstracts, which allows for interpreting partial points ''vocabulary'' ahead of partial points ''chronology'' as corresponding to abstracts using an innovative vocabulary. These abstracts contain words with a high coordinate on the first axis of MFACT and use these words at an early stage (See figure 8). 2196 JSM 2014 - Section on Statistical Learning and Data Mining Figure 8. Representation pioneers abstracts on the first MFACT principal plane from 2006 to 2010. Table 2 gives the title, first author, journal and year of the most ahead-of-its-date abstracts in 2008, 2009 and 2010, although all should be consulted. Examining their content facilitates the understanding of the research advances. The ahead-of-date abstracts often correspond to innovations. A gap in the number of ahead-of-date abstracts (1 in 2010, 2 in 2009, 8 in 2008,) corresponds to a gap in the trajectory of the years from the viewpoint of vocabulary (See figure 8). The ahead-of-date abstracts often correspond to innovations. The most recent abstracts cannot be selected from this criterion (no pioneer work has been identified on 2011 and 2012), and recent innovative articles may have been missed. Nevertheless, it is possible to look for recent abstracts (published either in 2011 or 2012) that favored advanced vocabulary. They are detectable because they present a high partial coordinate on the first axis from the vocabulary viewpoint. Table 2: Excerpt of the ahead-of –date abstracts from 2008, 2009 and 2010 (Hartkamp et al., 2010; Sánchez-Guerrero J et al., 2008; Yeap SS et al., 2008) 2197 NºTitleFirst authorJournalYear95Effects of dehydroepiandrosterone on fatigue and well-being in women with quiescent systemic lupus erythematosus: a randomised controlled trial.Hartkamp AAnnals of the rheumatic diseases2010101A phase II, randomized, double-blind, placebo-controlled, dose-ranging study of belimumab in patients with active systemic lupus erythematosus.Wallace DJArthritis and rheumatism2009131A comparison of calcium, calcitriol, and alendronate in corticosteroid-treated premenopausal patients with systemic lupus erythematosus.Yeap SSThe Journal of rheumatology2008141Effects of prasterone on bone mineral density in women with active systemic lupus erythematosus receiving chronic glucocorticoid therapy.Sanchez-Guerrero JThe Journal of rheumatology2008 JSM 2014 - Section on Statistical Learning and Data Mining 4. Discussion In this study were investigated the approaches regarding with the study of a words-table, which is a special 2-way contingency table. Specifically, in this words-table each cell is found our unit of analysis: word, keyword or lemma. The main purpose in this analysis is to obtain pertinent information from the bibliographic databases by doing text mining. The correspondence analysis demonstrated to be a suitable statistical technique to process this sort of data for discovering significant groups of words. The multi factor analysis with contingency tables (MFACT) was also suitable for discovering trends through the passing of the years and documents pioneers. At the end this research provided evidence of the flexibility of these methods, which can be used as strategic tools for following impact and trends in practically any scientific bibliography, regardless of its topic. 5. References Bansard, Cameron, G., Clark, D., Mulligen, V., Beltrame, F., E, D. H. B., … Coatrieux, J. L. (2007). MEDICAL INFORMATICS AND BIOINFORMATICS : A BIBLIOMETRIC STUDY. IEEE Transactions on Information Technology in Biomedicine, 11(3). Bécue-Bertaut, M., Álvarez-Esteban, R., & Pagès, J. (2008). Rating of products through scores and free-text assertions: Comparing and combining both. Food Quality and Preference, 19(1), 122–134. doi:10.1016/j.foodqual.2007.07.006 Bécue-Bertaut, M., & Pagès, J. (2004). A principal axes method for comparing contingency tables: MFACT. Computational Statistics & Data Analysis, 45(3), 481– 503. doi:10.1016/S0167-9473(03)00003-3 Bécue-Bertaut, M., & Pagès, J. (2008). Multiple factor analysis and clustering of a mixture of quantitative, categorical and frequency data. Computational Statistics & Data Analysis, 52(6), 3255–3268. doi:10.1016/j.csda.2007.09.023 Benzécri, J. P. (1973). Analyse des données. Analyse des correspondances (Vol. 2). (P. Dunod., Ed.). Benzécri, J. P. (1981). Pratique de l'analyse des données. Linguistique & lexicologie (Vol. 3).(P. Dunod., Ed.). Escofier, B., & Pagès, J. (2008). Analyses factorielles simples et multiples. (P. Dunod., Ed.) (4th ed.). Feinerer, I. (2014). Introduction to the tm Package Text Mining in R, 1–8. Retrieved from http://cran.r-project.org/web/packages/tm/vignettes/tm.pdf 2198 JSM 2014 - Section on Statistical Learning and Data Mining Feinerer, I., Hornik, K., & Meyer, D. (2008). Journal of Statistical Software. Journal of Statistical Software, 25(5), 1–54. Retrieved from http://www.jstatsoft.org Husson, A. F., Josse, J., Le, S., Mazet, J., & Husson, M. F. (2013). Package " FactoMineR ." Retrieved from http://cran.r- project.org/web/packages/FactoMineR/FactoMineR.pdf Kerbaol, M., & Bansard, J. (2000). Sélection de la bibliographie des maladies rares par la technique du Vocabulaire Commun Minimum. Journées Internationales D' Analyse Statistique Des Données Textuelles, 1–8. Kerbaol, M., Bansard, J., & Coatrieux, J. L. (2006). An analysis of IEEE publications. IEEE Engineering in Medicine and Biology Magazine, 25(April), 6–9. Kostov, B., Bécue-bertaut, M., & Husson, F. (2013). Multiple Factor Analysis for Contingency Tables in the FactoMineR Package. The R Journal, 5, 29–38. Retrieved from http://journal.r-project.org/archive/2013-1/RJ-2013-1.pdf Lê, S., Josse, J., & Husson, F. (2008). FactoMineR: An R package for multivariate analysis. Journal of Statistical Software, 25(1). Lebart, L. (1998). Classification problems in text analysis and information retrieval. Lebart, L., Salem, A., & Berry, L. (1998). Exploring textual data. (D. Kluwer, Ed.). Morin, A., & Rennes, U. De. (2006). Intensive use of factorial correspondence analysis for text mining: application with statistical education publications. Statistics Educational Research Journal ( SERJ ), (1990), 1–6. Murtagh, F. (2005). Correspondence analysis and data coding with Java and R. (Boca Raton: Chapman & Hall., Ed.). National Center for Biotechnology Information. (2012). Pubmed. Retrieved from http://www.ncbi.nlm.nih.gov/pubmed/ R Development Core Team. (2012). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. Rouillier, J., Bansard, J., & Kerbaol, M. (2002). Application de l´analyse statistique des données textuelles à une revue bibliographique de la littérature médicale. In Journées internationales d' Analyse statistique des Données Textuelles (pp. 665–676). Šilić, A., Morin, A., Chauchat, J.-H., & Dalbelo Bašić, B. (2012). Visualization of temporal text collections based on Correspondence Analysis. Expert Systems with Applications, 39(15), 12143–12157. doi:10.1016/j.eswa.2012.04.040 2199
1706.02427
1
1706
2017-06-08T02:03:32
Content-Based Table Retrieval for Web Queries
[ "cs.CL" ]
Understanding the connections between unstructured text and semi-structured table is an important yet neglected problem in natural language processing. In this work, we focus on content-based table retrieval. Given a query, the task is to find the most relevant table from a collection of tables. Further progress towards improving this area requires powerful models of semantic matching and richer training and evaluation resources. To remedy this, we present a ranking based approach, and implement both carefully designed features and neural network architectures to measure the relevance between a query and the content of a table. Furthermore, we release an open-domain dataset that includes 21,113 web queries for 273,816 tables. We conduct comprehensive experiments on both real world and synthetic datasets. Results verify the effectiveness of our approach and present the challenges for this task.
cs.CL
cs
Content-Based Table Retrieval for Web Queries Zhao Yan†∗, Duyu Tang‡ , Nan Duan‡ , Junwei Bao+∗ , ‡Microsoft Research, Beijing, China †Beihang University Yuanhua Lv§ , Ming Zhou‡ , Zhoujun Li† +Harbin Institute of Technology §Microsoft AI and Research, Sunnyvale CA, USA †{yanzhao, lizj}@buaa.edu.cn [email protected] ‡§{dutang, nanduan, yuanhual, mingzhou}@microsoft.com 7 1 0 2 n u J 8 ] L C . s c [ 1 v 7 2 4 2 0 . 6 0 7 1 : v i X r a Abstract Understanding the connections between unstructured text and semi-structured table is an important yet neglected problem in natural language processing. In this work, we focus on content-based table retrieval. Given a query, the task is to find the most relevant table from a collection of tables. Further progress towards improving this area requires powerful models of semantic matching and richer training and evalua- tion resources. To remedy this, we present a ranking based approach, and implement both carefully designed features and neu- ral network architectures to measure the relevance between a query and the con- tent of a table. Furthermore, we release an open-domain dataset that includes 21,113 web queries for 273,816 tables. We con- duct comprehensive experiments on both real world and synthetic datasets. Results verify the effectiveness of our approach and present the challenges for this task. Introduction 1 Table1 is a special and valuable information that could be found almost everywhere from the Inter- net. We target at the task of content-based table retrieval in this work. Given a query, the task is to find the most relevant table from a collection of tables. Table retrieval is of great importance for both natural language processing and information retrieval. On one hand, it could improve existing information retrieval systems. The well-organized information from table, such as product compari- son from different aspects and flights between two ∗ Contribution during internship at Microsoft Research. 1https://en.wikipedia.org/wiki/Table_ (information) specific cities, could be used to directly respond to web queries. On the other hand, the retrieved table could be used as the input for question answering (Pasupat and Liang, 2015). Unlike existing studies in database community (Cafarella et al., 2008; Balakrishnan et al., 2015) that utilize surrounding text of a table or pager- ank score of a web page, we focus on making a thorough exploration of table content in this work. We believe that content-based table retrieval has the following challenges. The first challenge is how to effectively represent a table, which is semi-structured and includes many aspects such as headers, cells and caption. The second chal- lenge is how to build a robust model that mea- sures the relevance between an unstructured nat- ural language query and a semi-structured table. Table retrieval could be viewed as a multi-modal task because the query and the table are of differ- ent forms. Moreover, to the best of our knowl- edge, there is no publicly available dataset for ta- ble retrieval. Further progress towards improving this area requires richer training and evaluation re- sources. To address the aforementioned challenges, we develop a ranking based approach. We separate the approach into two cascaded steps to trade-off between accuracy and efficiency. In the first step, it finds a small set (e.g. 50 or 100) of candidate tables using a basic similarity measurement. In the second step, more sophisticated features are used to measure the relevance between the query and each candidate table. We implement two types of features, including manually designed features inspired by expert knowledge and neural network models jointly learned from data. Both strategies take into account the relevance between query and table at different levels of granularity. We also in- troduce a new dataset WebQueryTable for table re- trieval. It includes 21,113 web queries from search log, and 273,816 web tables from Wikipedia. We conduct comprehensive experiments on two datasets, a real world dataset introduced by us, and a synthetic dataset WikiTableQuestions (Pasupat and Liang, 2015) which has been widely used for table-based question answering. Results in vari- ous conditions show that neural network models perform comparably with carefully designed fea- tures, and combining them both could obtain fur- ther improvement. We study the influence of each aspect of table for table retrieval, and show what depth of table understanding is required to do well on this task. Results show the difference between question and web query, and present future chal- lenges for this task. This paper has the following contributions. We develop both feature-based and neural network based approaches, and conduct thorough experi- ments on real world and synthetic datasets. We release an open-domain dataset for table retrieval. 2 Task Definition We formulate the task of table retrieval in this sec- tion. Given a query q and a collection of tables T = {t1, ..., tN}, the goal of table search is to find a table ti that is most relevant to q. Figure 1: A example of query-table pair. Typically, a query q is a natural language ex- pression that consists of a list of words, such as "major cities of netherlands". A table t is a set of data elements arranged by vertical columns and horizontal rows. Formally, we define a table as a triple t = {headers, cells, caption} that con- sists of three aspects. A table could have multiple headers, each of which indicates the property of a column and could be used to identify a column. A table could have multiple cells, each of which is a unit where a row and a column intersects. A table could have a caption, which is typically an explanatory text about the table. Figure 1 gives an example to illustrate different aspects of a table. It is helpful to note that tables from the web are not always "regular". We regard a table as a "reg- ular" table if it contains header, cell and caption, and the number of cells in each row is equal to the number of header cells. In this work, we make a comprehensive study of table retrieval on reg- ular tables, and would like to release benchmark datasets of good quality. It is trivial to implement heuristic rules so as to convert the irregular tables to regular one, so we leave it to the future work. 3 Approach Overview In this section, we give an overview of the pro- posed approach. To build a system with high ef- ficiency, we separate the task into two cascaded modules, including candidate table retrieval and table ranking. Candidate table retrieval aims to find a small set of tables, such as 50 or 100. These candidate tables will be further used in the table ranking step, which uses more sophisticated fea- tures to measure the relevance between a query and a table. In the following subsections, we will give the work-flow of candidate table retrieval and table ranking. The detailed feature representation will be described in the next section. 3.1 Candidate Table Retrieval Candidate table retrieval aims to get a small can- didate table set from the whole table set of large scale, which is hundreds of thousands in our ex- periment. In order to guarantee the efficiency of the searching process, we calculate the similar- ity between table and query with Okapi BM25 (Robertson et al., 1995), which is computation- ally efficient and has been successfully used in in- formation retrieval. Specifically, we represent a query as bag-of-words, and represent table with plain text composed by the words from caption and headers. Given a query q = x1, x2, ..., xn, a table t and the whole table set T , the BM25 score of query q and table t is calculated as follows. n(cid:88) i=1 BM 25(q, t) = idf (xi) tf (xi, t) · (k1 + 1) tf (xi, T ) + k1(1 − b + b t avgtl ) where tf (xi, t) is the term frequency of word xi in t, idf (xi) is its inverse document frequency, avgtl is the average sequence length in the whole table set T , and k1 and b are hyper-parameters. NamePopulationAmsterdam , North Holland741,636Rotterdam , South Holland598,199The Hague , South Holland474,292Utrecht , Utrecht290,529Biggest Cities Netherlands -GeoNamesmajor cities of netherlandsQueryHeadersCellsCaption N(cid:88) 3.2 Table Ranking The goal of table ranking is to rank a short list of candidate tables by measuring the relevance be- tween a query and a table. We develop a feature- based approach and a neural network approach, both of them effectively take into account the structure of table. The details about the features will be described in next section. We use each fea- ture to calculate a relevance score, representing the similarity between a query and a table from some perspective. Afterwards, we use LambdaMART (Burges, 2010), a successful algorithm for solv- ing real world ranking problem, to get the final ranking score of each table.2 The basic idea of LambdaMART is that it constructs a forest of de- cision trees, and its output is a linear combination of the results of decision trees. Each binary branch in a decision tree specifies a threshold to apply to a single feature, and each leaf node is real value. Specifically, for a forest of N trees, the relevance score of a query-table pair is calculated as follow, s(q, t) = witri(q, t) i=1 where wi is the weight associated with the i-th regression tree, and tri(·) is the value of a leaf node obtained by evaluating i-th tree with features [f1(q, t), ..., fK(q, t)]. The values of wi and the parameters in tri(·) are learned with gradient de- scent during training. 4 Matching between Query and Table Measuring the relevance between a query and a table is of great importance for table retrieval. In this section, we present carefully designed features and neural network architectures for matching be- tween a query and a table. 4.1 Matching with Designed Features We carefully design a set of features to match query and table from word-level, phrase-level and sentence-level, respectively. The input of a fea- ture function are two strings, one query string q and one aspect string ta. We separately apply each of the following features to each aspect of a table, resulting in a list of feature scores. As described in Section 2, a table has three aspects, including 2We also implemented a ranker with linear regression, however, its performance was obviously worse than Lamb- daMART in our experiment. headers, cells and caption. We represent each as- pect as word sequence in this part. (1) Word Level. We design two word matching features fwmt and fmwq. The intuition is that a query is similar to an aspect of table if they have a large amount of word overlap. fwmt and fwmq are calculated based on number of words shared by q and ta. They are also normalized with the length of q and ta, calculated as follows, (cid:80) (cid:80) w∈ta (cid:80) (cid:80) w∈ta idf (w(cid:48)) δ(w, q) · idf (w) w(cid:48)∈ta δ(w, q) · idf (w) w(cid:48)∈q idf (w(cid:48)) fwmt(ta, q) = fwmq(ta, q) = where idf (w) denotes the inverse document fre- quency of word w in ta. δ(yj, q) is an indicator function which is equal to 1 if yj occurs in q, and 0 otherwise. Larger values of fwmt(·) and fwmq(·) correspond to larger amount of word overlap be- tween ta and q. (2) Phrase Level. We design a paraphrase- based feature fpp to deal with the case that a query and a table use different expressions to describe the same meaning. In order to learn a strong and domain-independent para- phrase model, we leverage existing statistical machine translation (SMT) phrase tables. A phrase table is defined as a quadruple, namely P T = {(cid:104)srci, trgi, p(trgisrci), p(srcitrgi)(cid:105)}, where srci (or trgi) denotes a phrase, in source (or target) language, p(trgisrci) (or p(srcitrgi)) denotes the translation probability from srgi (or trgi) to trgi (or srci). We use an existing SMT approach (Koehn et al., 2003) to extract a phrase table P T from a bilingual corpus. Afterwards, we use P T to calculate the relevance between a query and a table in paraphrase level. The intu- ition is that, two source phrases that are aligned to the same target phrase tend to be paraphrased. The phrase level score is calculated as follows, where N is the maximum n-gram order, which is set as 3, and srcat j,n are the phrase in ta and q starts from the i-th and j-th word with the length of n, and i ∈ {1, ...,ta − n + 1} and j ∈ {1, ...,q − n + 1}. (cid:80) N(cid:88) (cid:88) i,n and srcq ta − N + 1 i,j score(srctq p(tgtksrcx) · p(srcytgtk) score(srcx; srcy) = i,n, srcq j,n) fpp(ta, q) = 1 N n=1 P T (3) Sentence Level. We design features to match a query with a table at the sentence level. We use CDSSM (Shen et al., 2014), which has been successfully applied in text retrieval. The ba- sic computational component of CDSSM is sub- word, which makes it very suitable for dealing the misspelling queries in web search. The model composes sentence vector from sub-word embed- ding via convolutional neural network. We use the same model architecture to get query vector and table aspect vector, and calculate their relevance with cosine function. fs1(ta, q) = cosine(cdssm(ta), cdssm(q)) We train model parameters on WikiAnswers dataset (Fader et al., 2013), which contains almost 12M question-similar question pairs. In addition, since vector average is an intuitive way to com- pute sentence vector and does not induce addi- tional parameters, we calculate another relevance score by representing a query and a table aspect with element-wise vector average. We use a pub- licly available word embedding which is released by Mikolov et al. (2013). fs2(ta, q) = cosine(vec avg(ta), vec avg(q)) 4.2 Matching with Neural Networks We present neural network models for matching a query with a table. As a table includes different aspects such as headers, cells and caption, we de- velop different strategies to measure the relevance between a query and a table from different per- spectives. In this subsection, we first describe the model to compute query representation, and then present the method that measures the relevance be- tween a query and each aspect. A desirable query representation should be sen- sitive to word order as reversing or shuffling the words in a query might result in totally different intention. For example, "list of flights london to berlin" and "list of flights berlin to london" have different intentions. We use recurrent neural net- work (RNN) to map a query of variable length to a fixed-length vector. To avoid the problem of gradi- ent vanishing, we use gated recurrent unit (GRU) (Cho et al., 2014) as the basic computation unit, which adaptively forgets the history and remem- bers the input, and has proven to be effective in sequence modeling (Chung et al., 2014). It re- cursively transforming current word vector eq t with the output vector of the previous step ht−1. i + Uzhi−1) i + Urhi−1) zi = σ(Wzeq ri = σ(Wreq (cid:101)hi = tanh(Wheq hi = zi (cid:12)(cid:101)hi + (1 − zi) (cid:12) hi−1 i + Uh(ri (cid:12) hi−1)) where zi and ri are update and reset gates of GRU. We use a bi-directional RNN to get the meaning of a query from both directions, and use the concate- nation of two last hidden states as the final query representation vq = [ ←− h n]. −→ h n, A table has different types of information, in- cluding headers, cells and caption. We develop different mechanisms to match the relevance be- tween a query and each aspect of a table. An important property of a table is that randomly exchanging two rows or tow columns will not change the meaning of a table (Vinyals et al., 2015). Therefore, a matching model should en- sure that exchanging rows or columns will result in the same output. We first describe the method to deal with headers. To satisfy these conditions, we represent each header as an embedding vector, and regard a set of header embeddings as exter- nal memory Mh ∈ Rk×d, where d is the dimen- sion of word embedding, and k is the number of header cells. Given a query vector vq, the model first assigns a probability αi to each memory cell mi, which is a header embedding in this case. Afterwards, a query-specific header vector is ob- (cid:80)k tained through weighted average (Bahdanau et al., calculated as below and(cid:80) 2015; Sukhbaatar et al., 2015), namely vheader = i=1 αimi, where αi ∈ [0, 1] is the weight of mi i αi = 1. (cid:80)k αi = exp(tanh(W [mi; vq] + b)) j=1 exp(tanh(W [mj; vq] + b)) Similar techniques have been successfully applied in table-based question answering (Yin et al., 2015b; Neelakantan et al., 2015). Afterwards, we feed the concatenation of vq and vheader to a lin- ear layer followed by a sof tmax function whose output length is 2. We regard the output of the first category as the relevance between query and header. We use N N1() to denote this model. fnn(header, q) = N N1(Mh, vq) Since headers and cells have similar character- istics, we use a similar way to measure the rele- vance between a query and table cells. Specifi- cally, we derive three memories Mcel, Mrow and Mcol from table cells in order to match from cell level, row level and column level. Each memory cell in Mcel represents the embedding of a table cell. Each cell in Mrow represent the vector a row, which is computed with weighted average over the embeddings of cells in the same row. We derive the column memory Mcol in an analogous way. We use the same module N N1() to calculate the relevance scores for these three memories. fnn(cell, q) = N N1(Mcel, vq) fnn(column, q) = N N1(Mcol, vq) fnn(row, q) = N N1(Mrow, vq) Since a table caption is typically a descriptive word sequence. We model it with bi-directional GRU-RNN, the same strategy we have used for modeling the query. We concatenate the caption vector vcap with vq, and feed the results to a linear layer followed by sof tmax. fnn(caption, q) = N N2(vcap, vq) We separately train the parameters for each as- pect with back-propagation. We use negative log- likelihood as the loss function.3 loss = − 1 D log(fnn(ta, q)) (cid:88) (ta,q)∈D 5 Experiment We describe the experimental setting and analyze the results in this section. 5.1 Dataset and Setting To the best of our knowledge, there is no publicly available dataset for table retrieval. We introduce WebQueryTable, an open-domain dataset con- sisting of query-table pairs. We use search logs from a commercial search engine to get a list of queries that could be potentially answered by web tables. Each query in query logs is paired with a list of web pages, ordered by the number of user clicks for the query. We select the tables occurred in the top ranked web page, and ask annotators to label whether a table is relevant to a query or not. In this way, we get 21,113 query-table pairs. In the real scenario of table retrieval, a system is required to find a table from a huge collection of tables. 3We also implemented a ranking based loss function a, q)), but it performed worse max(0, 1− fnn(ta, q) + fnn(t∗ than the negative log-likelihood in our experiment. Therefore, in order to enlarge the search space of our dataset, we extract 252,703 web tables from Wikipedia and regard them as searchable tables as well. Data statistics are given in Table 1. WQT dataset WTQ dataset 273,816 # of tables Avg # of columns Max # of columns Min # of columns Avg # of rows Max # of rows Min # of rows # of questions Avg # of questions 4.55 52 1 9.15 1,517 2 21,113 4.61 2,108 6.38 25 3 28.50 754 5 22,033 11.25 Table 1: Statistics of WebQueryTable (WQT) dataset and WikiTableQuestions (WTQ) dataset. We sampled 200 examples to analyze the dis- tribution of the query types in our dataset. We ob- serve that 69.5% queries are asking about "a list of XXX", such as "list of countries and capitals" and "major cities in netherlands", and about 24.5% queries are asking about an attribute of an object, such as "density of liquid water temperature". We randomly separate the dataset as training, valida- tion, test with a 70:10:20 split. We also conduct a synthetic experiment for ta- ble retrieval on WikiTableQuestions (Pasupat and Liang, 2015), which is a widely used dataset for table-based question answering. It contains 2,108 HTML tables extracted from Wikipedia. Work- ers from Amazon Mechanical Turk are asked to write several relevant questions for each table. Since each query is written for a specific table, we believe that each pair of query-table can also be used as an instance for table retrieval. The difference between WikiTableQuestions and We- bQueryTable is that the questions in WikiTable- Questions mainly focus on the local regions, such as cells or columns, of a table while the queries in WebQueryTable mainly focus on the global content of a table. The number of table index in WikiTableQuestions is 2,108, which is smaller than the number of table index in WebQueryTable. We randomly split the 22,033 question-table pairs into training (70%), development (10%) and test (20%). In the candidate table retrieval phase, we encode a table as bag-of-words to guarantee the efficiency of the approach. Specifically, on WebQueryTable dataset we represent a table with caption and head- ers. On WikiTableQuestions dataset we represent a table with caption, headers and cells. The re- calls of the candidate table retrieval step on Wik- iTableQuestions and WebQueryTable datasets are 56.91% and 69.57%, respectively. The perfor- mance of table ranking is evaluated with Mean Av- erage Precision (MAP) and Precision@1 (P@1) (Manning et al., 2008). When evaluating the per- formance on table ranking, we filter out the fol- lowing special cases that only one candidate table is returned or the correct answer is not contained in the retrieved tables in the first step. Hyper pa- rameters are tuned on the validation set. 5.2 Results on WebQueryTable Table 2 shows the performance of different ap- proaches on the WebQueryTable dataset. Setting BM25 Feature NeuralNet Feature + NeuralNet MAP 58.23 61.02 61.94 67.18 P@1 47.12 47.79 49.02 54.15 Table 2: Results on the WebQueryTable dataset. We compare between different features for ta- ble ranking. An intuitive baseline is to repre- sent a table as bag-of-words, represent a query with bag-of-words, and calculate their similarity with cosine similarity. Therefore, we use the BM25 score which is calculated in the candidate table retrieval step. This baseline is abbreviated as BM25. We also report the results of using designed features (Feature) described in Section 4.1 and neural networks (NeuralNet) described in Section 4.2. Results from Table 2 show that the neural networks perform comparably with the designed features, and obtain better performance than the BM25 baseline. This results reflect the necessary of taking into account the table struc- ture for table retrieval. Furthermore, we can find that combining designed features and neural net- works could achieve further improvement, which indicates the complementation between them. We further investigate the effects of headers, cells and caption for table retrieval on WebQuery- Table. We first use each aspect separately and then increasingly combine different aspects. Re- sults are given in Table 3. We can find that in general the performance of an aspect in designed features is consistent with its performance in neu- ral networks. Caption is the most effective aspect on WebQueryTable. This is reasonable as we find that majority of the queries are asking about a list of objects, such as "polish rivers", "world top 5 mountains" and "list of american cruise lines". These intentions are more likely to be matched in the caption of a table. Combining more aspects could get better results. Using cells, headers and caption simultaneously gets the best results. Setting Header (H) Cell (Cel) Caption (Cap) H + Cel H + Cel + Cap MAP 22.39 28.85 57.12 31.99 61.02 Feature P@1 MAP 26.03 9.76 27.47 14.95 56.83 60.16 30.73 17.08 47.79 61.94 NeuralNet P@1 13.35 12.92 48.48 16.25 49.02 Table 3: Performance on WebQueryTable dataset with different aspects. Moreover, we investigate whether using a higher threshold could obtain a better precision. Therefore, we increasingly use a set of thresholds, and calculate the corresponding precision and re- call in different conditions. An instance is consid- ered to be correct if the top ranked table is correct and its ranking score is greater than the threshold. Results of our NeuralNet approach on WebQuery- Table are given in 2. We can see that using larger threshold results in lower recall and higher preci- sion. The results are consistent with our intuition. Figure 2: PR Curve on WebQueryTable. We conduct case study on our NeuralNet ap- proach and find that the performance is sensitive to the length of queries. Therefore, we split the test set to several groups according to the length of queries. Results are given in Figure 4. We can find that the performance of the approach de- creases with the increase of query length. When the query length changes from 6 to 7, the per- formance of P@1 decreases rapidly from 58.12% 00.10.20.30.40.50.60.70.80.9100.10.20.30.40.50.60.70.80.91valueThresholdPrecisionRecall Figure 3: Results generated by NeuralNet on WebQueryTable. to 50.23%. Through doing case study, we find that long queries contain more word dependencies. Therefore, having a good understanding about the intention of a query requires deep query under- standing. Leveraging external knowledge to con- nect query and table is a potential solution to deal with long queries. Figure 4: P@1 with different query length on We- bQueryTable dataset. We illustrate two examples generated by our NeuralNet approach in Figure 3. The example in Figure 3(a) is a satisfied case that the top ranked result is the correct answer. We can find that the model uses evidences from different aspects to match between a query and a table. In this exam- ple, the supporting evidences come from caption ("ramadan" and "malaysia"), headers ("dates") and cells ("2016"). The example in Figure 3(b) is a dissatisfied case. We can find that the top ranked result contains "life expectancy" in both caption and header, however, it is talking about the peo- ple in U.S. rather than "german shepherd". De- spite the correct table contains a cell whose con- tent is "german shepherd", it still does not obtain a higher rank than the left table. The reason might be that the weight for header is larger than the weight for cells. 5.3 Results on WikiTableQuestions Table 4 shows the results of table ranking on the WikiTableQuestions dataset. Setting BM25 CDSSM-Header Feature NeuralNet Feature + NeuralNet MAP 51.02 45.92 67.70 67.44 72.49 P@1 41.02 31.58 56.25 54.95 61.50 Table 4: Results on the WikiTableQuestions dataset with different features. We implement two baselines. The first baseline is BM25, which is the same baseline we have used for comparison on the WebQueryTable dataset. The second baseline is header grounding, which is partly inspired by Venetis et al. (2011) who show the effectiveness of the semantic relationship be- tween query and table header. We implement a CDSSM (Shen et al., 2014) approach to match between a table header and a query. We train the model by minimizing the cross-entropy error, where the ground truth is the header of the answer. Results are given in Table 4. We can find that de- signed features perform comparably with neural networks, and both of them perform better than BM25 and column grounding baselines. Combin- ing designed features and neural networks obtains further improvement. We also study the effects of different aspects on the WikiTableQuestions dataset. Results are given in Table 5. We can find that the effects of different aspect in designed features and neural networks are consistent. Using more aspects could achieve better performance. Using all aspects obtains the best performance. We also find that the most ef- fective aspect for WikiTableQuestions is header. This is different from the phenomenon in Web- Retrieved Result (Wrong)Ground truthlife expectancy of German shepherd mixWeekdayDateYearRankStateLife ExpectancyRankDog BreedAverage LifespanTue9-Jul20131Hawaii81.31Labrador Retriever11 YearsSun29-Jun20142Minnesota81.12German Shepherd11 YearsThu18-Jun20153Connecticut80.83Golden Retriever11 YearsTue7-Jun20164California80.84Beagle12-15 YearsList of U.S. states by life expectancy -WikipediaLife Expectancy of Dogs: How Long Will My Dog Live?Ramadan dates Malaysia 2016Ramadan begins in Malaysia -Timeanddate.com(a)(b)RetrievedResult(Correct)0.450.50.550.60.650.7234567>=8P@1Length of Query Setting Header (H) Cell (Cel) Caption (Cap) H + Cel H + Cel + Cap MAP 46.36 44.33 33.36 60.03 67.70 Feature P@1 MAP 52.93 32.52 43.49 30.97 24.79 46.83 60.55 47.42 56.25 67.44 NeuralNet P@1 36.47 26.41 31.54 45.71 54.95 Table 5: Results on the WikiTableQuestions dataset with different aspects. QueryTable that the most effective aspect is cap- tion. We believe that this is because the questions in WikiTableQuestions typically include content constrains from cells or headers. Two randomly sampled questions are "which country won the 1994 europeans men's handball championship's preliminary round?" and "what party had 7,115 inactive voters as of october 25, 2005?". On the contrary, queries from WebTableQuery usually do not use information from specific headers or cells. Examples include "polish rivers", "world top 5 mountains" and "list of american cruise lines". From Table 1, we can also find that the question in WikiTableQuestions are longer than the queries in WebQueryTable. In addition, we observe that not all the questions from WikiTableQuestions are suitable for table retrieval. An example is "what was the first player to be drafted in this table?". 6 Related Work Our work connects to the fields of database and natural language processing. There exists several works in database com- munity that aims at finding related tables from keyword queries. A representative work is given by Cafarella et al. (2008), which considers table search as a special case of document search task and represent a table with its surrounding text and page title. Limaye et al. (2010) use YAGO on- tology to annotate tables with column and rela- tionship labels. Venetis et al. (2011) go one step further and use labels and relationships extracted from the web. Pimplikar and Sarawagi (2012) fo- cus on the queries that describe table columns, and retrieve tables based on column mapping. There also exists table-related studies such as search- ing related tables from a table (Das Sarma et al., 2012), assembling a table from list in web page (Gupta and Sarawagi, 2009) and extracting tables using tabular structure from web page (Gatter- bauer et al., 2007). Our work differs from this line of research in that we focus on exploring the content of table to find relevant tables from web queries. Our work relates to a line of research works that learn continuous representation of structured knowledge with neural network for natural lan- guage processing tasks. For example, Neelakan- tan et al. (2015); Yin et al. (2015b) develop neu- ral operator on the basis of table representation and apply the model to question answering. Yin et al. (2015a) introduce a KB-enhanced sequence- to-sequence approach that generates natural lan- guage answers to simple factoid questions based on facts from KB. Mei et al. (2016) develop a LSTM based recurrent neural network to generate natural language weather forecast and sportscast- ing commentary from database records. Serban et al. (2016) introduce a recurrent neural network approach, which takes fact representation as input and generates factoid question from a fact from Freebase. Lebret et al. (2016) presented an neural language model that generates biographical sen- tences from Wikipedia infobox. Our neural network approach relates to the re- cent advances of attention mechanism and rea- soning over external memory in artificial intelli- gence (Bahdanau et al., 2015; Sukhbaatar et al., 2015; Graves et al., 2016). Researchers typi- cally represent a memory as a continuous vector or matrix, and develop neural network based con- troller, reader and writer to reason over the mem- ory. The memory could be addressed by a "soft" attention mechanism trainable by standard back- propagation methods or a "hard" attention mecha- nism trainable by REINFORCE (Williams, 1992). In this work, we use the soft attention mechanism, which could be easily optimized and has been suc- cessfully applied in nlp tasks (Bahdanau et al., 2015; Sukhbaatar et al., 2015). 7 Conclusion In this paper, we give an empirical study of content-based table retrieval for web queries. We implement a feature-based approach and a neural network based approach, and release a new dataset consisting of web queries and web tables. We con- duct comprehensive experiments on two datasets. Results not only verify the effectiveness of our approach, but also present future challenges for content-based table retrieval. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly International Con- learning to align and translate. ference on Learning Representations (ICLR) . Sreeram Balakrishnan, Alon Y Halevy, Boulos Harb, Hongrae Lee, Jayant Madhavan, Afshin Ros- tamizadeh, Warren Shen, Kenneth Wilder, Fei Wu, and Cong Yu. 2015. Applying webtables in prac- tice. Proceedings of Conference on Innovative Data Systems Research (CIDR) . Christopher JC Burges. 2010. From ranknet to lamb- darank to lambdamart: An overview. Microsoft Re- search Technical Report MSR-TR-2010-82 11(23- 581):81. Michael J Cafarella, Alon Halevy, Daisy Zhe Wang, Eugene Wu, and Yang Zhang. 2008. Webtables: ex- ploring the power of tables on the web. Proceedings of the VLDB Endowment 1(1):538–549. Kyunghyun Cho, Bart van Merrienboer, Caglar Gul- cehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Nat- ural Language Processing (EMNLP). Association for Computational Linguistics, Doha, Qatar, pages 1724–1734. http://www.aclweb.org/anthology/D14- 1179. Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence model- ing. arXiv preprint arXiv:1412.3555 . Anish Das Sarma, Lujun Fang, Nitin Gupta, Alon Halevy, Hongrae Lee, Fei Wu, Reynold Xin, and In Pro- Cong Yu. 2012. Finding related tables. ceedings of the 2012 ACM SIGMOD International Conference on Management of Data. ACM, pages 817–828. Anthony Fader, Luke Zettlemoyer, and Oren Etzioni. 2013. Paraphrase-driven learning for open question answering. In Proceedings of Annual Meeting of the Association for Computational Linguistics (ACL). Wolfgang Gatterbauer, Paul Bohunsky, Marcus Her- zog, Bernhard Krupl, and Bernhard Pollak. 2007. Towards domain-independent information extrac- tion from web tables. In Proceedings of the 16th in- ternational conference on World Wide Web (WWW). ACM, pages 71–80. Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska- Barwi´nska, Sergio G´omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. Hybrid computing using a neural net- 2016. Nature work with dynamic external memory. 538(7626):471–476. Rahul Gupta and Sunita Sarawagi. 2009. Answering table augmentation queries from unstructured lists on the web. Proceedings of the VLDB Endowment 2(1):289–300. Philipp Koehn, Franz Josef Och, and Daniel Marcu. 2003. Statistical phrase-based translation. Proceed- ings of Annual Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies (NAACL- HLT) 1:48–54. R´emi Lebret, David Grangier, and Michael Auli. 2016. Neural text generation from structured data with ap- plication to the biography domain. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language (EMNLP). Girija Limaye, Sunita Sarawagi, and Soumen Annotating and searching Chakrabarti. 2010. web tables using entities, types and relationships. Proceedings of the VLDB Endowment 3(1-2):1338– 1347. Christopher D Manning, Prabhakar Raghavan, Hinrich Schutze, et al. 2008. Introduction to information re- trieval, volume 1. Cambridge university press Cam- bridge. Hongyuan Mei, Mohit Bansal, and Matthew R. Wal- ter. 2016. What to talk about and how? se- lective generation using lstms with coarse-to-fine In Proceedings of the 2016 Confer- alignment. ence of the North American Chapter of the Associ- ation for Computational Linguistics: Human Lan- guage Technologies. Association for Computational Linguistics, San Diego, California, pages 720–730. http://www.aclweb.org/anthology/N16-1086. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- rado, and Jeff Dean. 2013. Distributed representa- tions of words and phrases and their compositional- In Advances in neural information processing ity. systems (NIPS). pages 3111–3119. Arvind Neelakantan, Quoc V Le, and Ilya Sutskever. Inducing latent pro- arXiv preprint 2015. Neural programmer: grams with gradient descent. arXiv:1511.04834 . Panupong Pasupat and Percy Liang. 2015. Compo- sitional semantic parsing on semi-structured tables. Proceedings of Annual Meeting of the Association for Computational Linguistics (ACL) . Rakesh Pimplikar and Sunita Sarawagi. 2012. Answer- ing table queries on the web using column keywords. Proceedings of the VLDB Endowment 5(10):908– 919. Stephen E Robertson, Steve Walker, Susan Jones, Micheline M Hancock-Beaulieu, Mike Gatford, et al. 1995. Okapi at trec-3. NIST SPECIAL PUB- LICATION SP 109:109. Iulian Vlad Serban, Alberto Garc´ıa-Dur´an, Caglar Gulcehre, Sungjin Ahn, Sarath Chandar, Aaron Courville, and Yoshua Bengio. 2016. Generat- ing factoid questions with recurrent neural net- works: The 30m factoid question-answer corpus. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers). Association for Computa- tional Linguistics, Berlin, Germany, pages 588–598. http://www.aclweb.org/anthology/P16-1056. Yelong Shen, Xiaodong He, Jianfeng Gao, Li Deng, and Gr´egoire Mesnil. 2014. A latent semantic model with convolutional-pooling structure for information retrieval. In Proceedings of the Conference on Infor- mation and Knowledge Management (CIKM). pages 101–110. Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. 2015. End-to-end memory net- works. In Advances in Neural Information Process- ing Systems (NIPS). pages 2431–2439. Petros Venetis, Alon Halevy, Jayant Madhavan, Mar- ius Pas¸ca, Warren Shen, Fei Wu, Gengxin Miao, and Chung Wu. 2011. Recovering semantics of tables on the web. Proceedings of the VLDB Endowment 4(9):528–538. Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. 2015. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391 . Ronald J Williams. 1992. Simple statistical gradient- following algorithms for connectionist reinforce- ment learning. Machine learning 8(3-4):229–256. Jun Yin, Xin Jiang, Zhengdong Lu, Lifeng Shang, Neural arXiv preprint Hang Li, and Xiaoming Li. 2015a. generative question answering. arXiv:1512.01337 . Pengcheng Yin, Zhengdong Lu, Hang Li, and Ben Kao. 2015b. Neural enquirer: Learning to query arXiv preprint tables with natural arXiv:1512.00965 . language.
1908.06629
2
1908
2019-12-07T18:40:31
Memory limitations are hidden in grammar
[ "cs.CL", "cs.DM" ]
The ability to produce and understand an unlimited number of different sentences is a hallmark of human language. Linguists have sought to define the essence of this generative capacity using formal grammars that describe the syntactic dependencies between constituents, independent of the computational limitations of the human brain. Here, we evaluate this independence assumption by sampling sentences uniformly from the space of possible syntactic structures. We find that the average dependency distance between syntactically related words, a proxy for memory limitations, is less than expected by chance in a collection of state-of-the-art classes of dependency grammars. Our findings indicate that memory limitations have permeated grammatical descriptions, suggesting that it may be impossible to build a parsimonious theory of human linguistic productivity independent of non-linguistic cognitive constraints.
cs.CL
cs
Memory limitations are hidden in grammar Carlos G´omez-Rodr´ıguez1, Morten H. Christiansen2,3 and Ramon Ferrer-i-Cancho4∗ 1FASTPARSE Lab, LyS Research Group, Departamento de Computaci´on, Universidade da Coruna, CITIC, Campus de Elvina s/n, 15071, A Coruna, Spain 2Department of Psychology, Cornell University, Ithaca, NY 14853, USA 3Interacting Minds Centre and School of Communication and Culture, Nobelparken, Aarhus University, 8000 Aarhus C, Denmark 4Complexity and Quantitative Linguistics Lab, LARCA Research Group Departament de Ci`encies de la Computaci´o, Universitat Polit`ecnica de Catalunya (UPC) Jordi Girona 1-2, 08034, Barcelona, Spain ∗To whom correspondence should be addressed; E-mail: [email protected]. The ability to produce and understand an unlimited number of different sen- tences is a hallmark of human language. Linguists have sought to define the essence of this generative capacity using formal grammars that describe the syntactic dependencies between constituents, independent of the compu- tational limitations of the human brain. Here, we evaluate this independence assumption by sampling sentences uniformly from the space of possible syn- tactic structures. We find that the average dependency distance between syn- tactically related words, a proxy for memory limitations, is less than expected by chance in a collection of state-of-the-art classes of dependency grammars. Our findings indicate that memory limitations have permeated grammatical descriptions, suggesting that it may be impossible to build a parsimonious the- ory of human linguistic productivity independent of non-linguistic cognitive 1 constraints. One Sentence Summary: Analyses of billions of sentences reveal that human linguistic productivity cannot be cap- tured without cognitive constraints. An often celebrated aspect of human language is its capacity to produce an unbounded number of different sentences (1, 2). For many centuries, the goal of linguistics has been to capture this capacity by a formal description -- a grammar -- consisting of a systematic set of rules and/or principles that determine which sentences are part of a given language and which are not (3). Over the years, these formal grammars have taken many forms but common to them all is the assumption that they capture the idealized linguistic competence of a native speaker/hearer, independent of any memory limitations or other non-linguistic cognitive con- straints (1, 2). These abstract formal descriptions have come to play a foundational role in the language sciences, from linguistics, psycholinguistics, and neurolinguistics (4, 5) to computer science, engineering, and machine learning (6 -- 8). Despite evidence that processing difficulty underpins the unacceptability of certain sentences (9, 10), the cognitive independence assump- tion that is a defining feature of linguistic competence has not been examined in a systematic way using the tools of formal grammar. It is therefore unclear whether these supposedly ideal- ized descriptions of language are free of non-linguistic cognitive constraints, such as memory limitations. If the cognitive independence assumption should turn out not to hold, then it would have wide-spread theoretical and practical implications for our understanding of human linguistic productivity. It would require a reappraisal of key parts of linguistic theory that hitherto have posed formidable challenges for explanations of language processing, acquisition and evolu- 2 Figure 1: Examples of syntactic dependency structures. Arcs indicate syntactic dependencies from a head to its dependent and are labelled with the distance between them. n is the number of words of the sentence, D is the sum of dependency distances and (cid:104)d(cid:105) = D/(n − 1) is the average dependency distance. A. A mildly non-projective tree from the classes 1EC and M H4 (adapted from (15)) where n = 8 and (cid:104)d(cid:105) = 13/7 ≈ 1.85. B. A planar but non-projective tree where n = 5 and (cid:104)d(cid:105) = 3/2 (adapted from (16)). C. A projective tree (adapted from (16)) where n = 4 and (cid:104)d(cid:105) = 4/3. D. A diagram of the superset relationships between projective, planar, mildly non-projective and unrestricted (all) syntactic dependency structures. tion (4,5,11) -- pointing to new ways of thinking about language that may simplify the problem space considerably by making it possible to explain apparently arbitrary aspects of linguistic structure in terms of general learning and processing biases (12, 13). In terms of practical ram- ifications, engineers may benefit from building human cognitive limitations directly into their natural language processing systems, so as to better mimic human language skills and thereby improve performance. Here, we therefore evaluate the cognitive independence assumption us- ing a state-of-the-art grammatical framework, dependency grammar (14), to search for possible hidden memory constraints in these formal, idealized descriptions of natural language. In dependency grammar, the syntactic structure of a sentence is defined by two components. First, a directed graph where vertices are words and arcs indicate syntactic dependencies be- 3 Youbroughtyourdog121Someonearrivedwithredhair2121Ahearingisscheduledontheissuetoday1311421AllMildly non-projective treesProjective treesPlanar treesAAABCD tween a head and its dependent. Such a graph has a root (a vertex that receives no edges) and edges are oriented away from the root (Figure 1). Second, the linear arrangement of the vertices of the graph (defined by the sequential order of the words in a sentence). Thus, syntactic depen- dency structures constitute a particular kind of spatial network where the graph is embedded in one dimension (17), a correspondence that has led to the development of syntactic theory from a network theory standpoint (13). Dependency grammar is an important framework for various reasons. First, categorial grammar defines the syntactic structure of a sentence as dependency grammar (9). Second, equivalences exist between certain formalisms of dependency grammar and constituency gram- mar (18, 19). Third, there has been an evolution of minimalism towards dependency gram- mar (20). Finally, dependency grammar has become a de facto standard in computational lin- guistics (21). To delimit the set of possible grammatical descriptions, various classes or sets of syntactic dependency structures have been proposed. These classes can be seen as filters on the possible linear arrangements of a given tree. Here, we consider four main classes. First, consider planar structures, where edges do not cross when drawn above the words of the sentence. The structure in Figures 1B-C are planar while that of Figure 1A is not. Second, we have projective structures, the most well-known class. A dependency tree is projective if, and only if, it is planar and its root is not covered by any dependency (Figure 1C). Third, there are mildly non-projective structures, comprising the union of planar structures and additional structures with further (but slight) deviations from projectivity, e.g., by having a low number of edge crossings (Figure 1A). Finally, the class of all structures, that has no constraints on the possible structures. Fig. 1D shows the inclusion relationships among these classes. However, the whole picture, encompassing state-of-the-art classes is more complex. Mildly non-projective structures are not actually a class but a family of classes. We have selected three representative classes: M Hk, 4 W G1 and 1EC structures, that are supersets of projective structures but whose definition is more complex (Supplementary Text). Here we validate the assumption of independence between grammatical constraints and cog- nitive limitations in these classes of grammar using the distance between syntactically related words in a dependency tree as a proxy for memory constraints (22, 23). Such a distance is de- fined as the number of intermediate words plus one. Thus, if the linked words are consecutive they are at distance 1, if they are separated by an intermediate word they are at distance two, and so on, as shown in Figure 1. Dependency distance minimization, a type of memory constraint, is believed to result from pressure against decay of activation or interference during the processing of sentences (22, 23). Dependency distances reduce in case of cognitive impairment (24). Assuming that all the linear arrangements are equally likely, (cid:104)d(cid:105), the average of dependency distances in a sentence of n words, is expected to be (25) (cid:104)d(cid:105)rla = (n + 1)/3. (1) Figure 2A shows that (cid:104)d(cid:105)RS, the average dependency distance in attested syntactic depen- dency structures (RS), is below the random baseline defined by (cid:104)d(cid:105)rla (see Supplementary Text for a justification of this baseline). This is in line with previous statistical analyses (25 -- 28) (see (22, 23) for a broader review of previous work) and the expected influence of performance constraints on attested trees. The fact that (cid:104)d(cid:105)RS is below 4 has been interpreted as a sign that dependency lengths are constrained by working memory limitations (26). For this reason, we test whether memory effects have permeated the classes of grammar by determining if (cid:104)d(cid:105)AS, the average dependency distance in a collection of artificial syntactic dependency structures (AS) from a certain class, is also below (cid:104)d(cid:105)rla. The purpose of Figure 2A is merely to provide the reader with a baseline derived from attested dependency structures in natural language as a backdrop for the main 5 contribution of the article, which is based on artificial syntactic dependency structures. For a given n, we generate an ensemble of artificial syntactic dependency structures by exhaustive sampling for n ≤ n∗ = 10 and random sampling for n > n∗ (Supplementary Materials). These artificial syntactic dependency trees are only constrained by the definition of the different classes. They are thus free from any memory constraint other than the ones the different classes of grammars may, perhaps, impose indirectly. Still, these artificial syntactic structures have dependency lengths that are below the chance level (Figure 2 B), indicating that memory constraints are hidden in the definition of these classes. Interestingly (cid:104)d(cid:105)AS is below chance for sufficiently large n in all classes of grammars although (cid:104)d(cid:105)AS could be above (cid:104)d(cid:105)rla in principle (Supplementary Text). In general, the largest reduction of (cid:104)d(cid:105)AS with respect to the random baseline is achieved by the projective class, followed by the planar class. It is worth noting that a reduction of (cid:104)d(cid:105)AS with respect to our random baseline has been observed for the projective class in past work, but with some important caveats: (26) did not control for sentence length as in Figure 2 B; and whereas (27) did implement this control and considered another class of marginal interest (2-component structures) in addition to projec- tive trees, their use of attested dependency trees instead of artificial control trees suggests that memory limitations might have influenced the results. The reduction of (cid:104)d(cid:105) with respect to the random baseline in artificial trees from a wide range of state-of-the art classes is consistent with the hypothesis that the scarcity of crossing dependencies is a side-effect of pressure to reduce the distance between syntactically related words (13). The smaller reduction of dependency distances with respect to the random baseline in artificial dependency structures can be explained by the fact that the curves in Figure 2 B derive from uniform sampling of the space of all possible trees. In contrast, real speakers may not only choose linear arrangements that reduce dependency distance, but also sample the space of possible structures with a bias towards structures that facilitate that such reduction or 6 Figure 2: The average dependency length, (cid:104)d(cid:105), as a function of n, the sentence length (in words). For reference, the baseline defined by a random linear arrangement of the words of the sentence, (cid:104)d(cid:105)rla is also shown (dashed line). A. Attested syntactic dependency trees (RS) following three different annotation criteria: UD, Prague and Stanford dependencies. B. Arti- ficial syntactic dependency structures (AS) belonging to different classes of grammars. Due to undersampling, only points represented by at least 30 structures are shown for n > n∗. 7 llllllllllllllllllllllll051015202502468sentence length, nmean dependency distance, <d>RSllllllllllllllllllllllllllllllllllllllllllllllllUDStanfordPragueAlllllllllllllllllllllll051015202502468sentence length, nmean dependency distance, <d>ASllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllallprojectiveplanarWG1MH4MH51ECB that satisfy other cognitive constraints (29). Our findings complete our understanding of the relationship between projectivity or mildly non-projectivity and dependency distance minimization. It has been shown that such minimiza- tion leads to a number of edge crossings that is practically zero (30), and to not covering the root (one of the conditions for projectivity, in addition to planarity) (31). Here, we have demon- strated a complementary effect, i.e., that dependency distance reduces below chance when edge crossings are minimized (planarity) or projectivity is imposed. Whereas a recent study of simi- lar classes of grammars suggested that crossing dependencies are constrained by either grammar or cognitive pressures rather than occurring naturally at some rate -- citeYadav2019a, our findings strongly demonstrate that it is not grammar but rather non-linguistic cognitive constraints, that limit the occurrence of crossing dependencies in languages. We sampled about 16 billion syntactic dependency structures, that differed in length and syntactic complexity, to determine whether linguistic grammars are free of non-linguistic cog- nitive constraints, as is typically assumed. Strikingly, while previous work on natural languages has shown that dependency lengths are considerably below what would be expected by a random baseline without memory constraints (25 -- 27,32), we still observe a drop in dependency lengths for randomly generated, mildly non-projective structures that supposedly abstract away from cognitive limitations. Our interpretation of these results is that memory constraints, in the form of dependency distance minimization, have become inherent to formal linguistic grammars. It may be objected that our conclusions are limited by the sample of classes that we have considered and that we cannot not exclude the possibility that, in the future, researchers might adopt a new class of mildly non-projective structures whose dependency distances cannot be distinguished from the random baseline. However, we believe that this is very unlikely for the following reasons: (1) our current sample of classes is representative of the state of the 8 art (33), and spans classes that originated with different goals and motivations (from purely theoretical to parsing efficiency), with all sharing the drop in dependency lengths, (2) while one could conceivably engineer a class to have lengths in line with the baseline while still having high coverage of linguistic phenomena, this would mean forwarding more responsibility for dependency distance reduction to other parts of the linguistic theory in order to warrant that dependency distances are reduced to a realistic degree (Fig. 2) and hence would preclude a par- simonious approach to language, and (3) given the positive correlation between crossings and dependency lengths (34, 35), such a class would be likely to have many dependency crossings, so it would be, at the least, questionable to call it mildly non-projective. Beyond upending longheld assumptions about the nature of human linguistic productivity, our findings also have key implications for debates on how children learn language, how lan- guage evolved, and how computers might best master language. Whereas a common assumption in the acquisition literature is that children come to the task of language learning with built-in linguistic constraints on what they learn (5, 11), our results suggest that language-specific con- straints may not be needed and instead be replaced by general cognitive constraints (36). The strong effects of memory on dependence distance minimization provide further support for the notion that language evolved through processes of cultural evolution shaped by the human brain (12), rather than the biological evolution of language-specific constraints (5). Finally, our results raise the intriguing possibility that if we want to develop computer systems that target human linguistic ability in the context of human-computer interaction, we may paradoxically need to constraint the power of such systems to be in line with human cognitive limitations, rather than giving them the super-human computational capacity of AlphaGo. Our study was conducted using the framework of dependency grammar, but because of the close relationship between this framework and other ways of characterizing the human unbounded capacity, such as categorial grammar (9), phrase structure grammar (18, 19), and 9 minimalist grammar (20), our results suggest that any parsimonious grammatical framework will incorporate memory constraints. Moreover, given that dependency grammars constitute a special case of a graph that is embedded in one dimension, the physics toolbox associated with statistical mechanics and network theory may be applied to provide further insight into the nature of human linguistic productivity (13, 17). However, these future explorations notwith- standing, our current findings show that memory limitations have permeated current linguistic conceptions of grammar, suggesting that it may not be possible to adequately capture our un- bounded capacity for language, at least in the context of a parsimonious theory compatible with the idea of mild non-projectivity, without incorporating non-linguistic cognitive constraints into the grammar formalism. References 1. N. Chomsky, Aspects of the theory of syntax (MIT Press, Cambridge, MA, 1965). 2. P. Miller, Strong generative capacity: The semantics of linguistic formalism (Cambridge University Press, Cambridge, UK, 2000). 3. R. Bod, A New History of the Humanities: The Search for Principles and Patterns from Antiquity to the Present (Oxford University Press, Oxford, UK, 2013). 4. M. D. Hauser, N. Chomsky, W. T. Fitch, Science 298, 1569 (2002). 5. S. Pinker, Language evolution, M. H. Christiansen, S. Kirby, eds. (Oxford University Press, New York, 2003), pp. 16 -- 37. 6. D. Klein, C. D. Manning, Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics (ACL) (2003), pp. 423 -- 430. 10 7. C. Dyer, A. Kuncoro, M. Ballesteros, N. A. Smith, Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Association for Computational Linguistics, San Diego, California, 2016), pp. 199 -- 209. 8. C. G´omez-Rodr´ıguez, T. Shi, L. Lee, Proceedings of the 56th Annual Meeting of the Asso- ciation for Computational Linguistics (Volume 1: Long Papers) (Association for Computa- tional Linguistics, Melbourne, Australia, 2018), pp. 2663 -- 2674. 9. G. Morrill, Categorial grammar: logical syntax, semantics, and processing (Oxford Uni- versity Press, Oxford, 2010). 10. J. A. Hawkins, Efficiency and Complexity in Grammars (Oxford University Press, Oxford, 2004). 11. E. M. Gold, Information and Control 10, 447 (1967). 12. M. H. Christiansen, N. Chater, Behavioral and Brain Sciences 31, 489 (2008). 13. C. G´omez-Rodr´ıguez, R. Ferrer-i-Cancho, Physical Review E 96, 062304 (2017). 14. J. Nivre, Dependency grammar and dependency parsing, Tech. Rep. MSI 05133, Vaxjo University, School of Mathematics and Systems Engineering (2005). 15. J. Nivre, Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP: Volume 1 - Volume 1, ACL '09 (Association for Computational Linguistics, Stroudsburg, PA, USA, 2009), pp. 351 -- 359. 16. T. Gross, T. Osborne, SKY Journal of Linguistics 22, 43 (2009). 11 17. M. Barth´elemy, Morphogenesis of Spatial Networks (Springer, Cham, Switzerland, 2018). 18. H. Gaifman, Information and Control 8, 304 (1965). 19. S. Kahane, N. Mazziotta, Proceedings of the 14th Meeting on the Mathematics of Language (MoL 2015) (Association for Computational Linguistics, Chicago, USA, 2015), pp. 152 -- 164. 20. T. Osborne, M. Putnam, T. Gross, The Linguistic Review 28, 315364 (2011). 21. S. Kubler, R. McDonald, J. Nivre, Dependency Parsing (Morgan and Claypool, 2009). 22. H. Liu, C. Xu, J. Liang, Physics of Life Reviews 21, 171 (2017). 23. D. Temperley, D. Gildea, Annual Review of Linguistics 4, 67 (2018). 24. B. Roark, M. Mitchell, J. Hosom, K. Hollingshead, J. Kaye, IEEE Transactions on Audio, Speech, and Language Processing 19, 2081 (2011). 25. R. Ferrer-i-Cancho, Physical Review E 70, 056135 (2004). 26. H. Liu, Journal of Cognitive Science 9, 159 (2008). 27. Y. Albert Park, R. Levy, Proceedings of the 10th Annual Meeting of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT) conference (Association for Computational Linguistics, Stroudsburg, PA, USA, 2009), pp. 335 -- 343. 28. R. Futrell, K. Mahowald, E. Gibson, Proceedings of the National Academy of Sciences 112, 10336 (2015). 29. R. Ferrer-i-Cancho, C. G´omez-Rodr´ıguez, Journal of Quantitative Linguistics p. in press (2019). 12 30. R. Ferrer-i-Cancho, Europhysics Letters 76, 1228 (2006). 31. R. Ferrer-i-Cancho, Advances in Complex Systems 11, 393 (2008). 32. R. Ferrer-i-Cancho, H. Liu, Glottotheory 5, 143 (2014). 33. C. G´omez-Rodr´ıguez, Computational Linguistics 42, 809 (2016). 34. R. Ferrer-i-Cancho, C. G´omez-Rodr´ıguez, Complexity 21, 320 (2016). 35. L. Alemany-Puig, Edge crossings in linear arrangements: from theory to algorithms and applications, Master's thesis, Barcelona School of Informatics (2019). 36. M. Tomasello, Constructing a language. A usage-based theory of language acquisition (Harvard University Press, Cambridge, MA, 2005). 37. J. Nivre, M. Abrams, Z. Agi´c, et al., Universal dependencies 2.4 (2019). LINDAT/CLARIN digital library at the Institute of Formal and Applied Linguistics ( ´UFAL), Faculty of Math- ematics and Physics, Charles University. 38. M.-C. de Marneffe, C. D. Manning, COLING 2008: Proceedings of the workshop on Cross- Framework and Cross-Domain Parser Evaluation (COLING 2008 Organizing Committee, 2008), pp. 1 -- 8. 39. J. Bresnan, Lexical-Functional Syntax (Blackwell, Chichester, United Kingdom, 2000). 40. R. Rosa, et al., Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14), N. C. C. Chair), et al., eds. (European Language Resources Association (ELRA), Reykjavik, Iceland, 2014). 13 41. M.-C. de Marneffe, et al., Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14), N. C. C. Chair), et al., eds. (European Language Resources Association (ELRA), Reykjavik, Iceland, 2014). 42. J. Hajic, et al., Prague dependency treebank 2.0, CDROM CAT: LDC2006T01, ISBN 1- 58563-370-4. Linguistic Data Consortium (2006). 43. P. Sgall, A functional approach to syntax in generative description of language (Elsevier, 1969). 44. E. Hajicova, Concise History of the Language Sciences, E. Koerner, R. Asher, eds. (Perga- mon, Amsterdam, 1995), pp. 253 -- 262. 45. M. C. Passarotti, L'analisi Linguistica e Letteraria 1, 21 (2016). 46. R. V. Hogg, E. A. Tanis, Probability and Statistical Inference (Prentice Hall, Upper Saddle River, NJ, 1997), 7th edn. 47. J. L. Esteban, R. Ferrer-i-Cancho, C. G´omez-Rodr´ıguez, Journal of Statistical Mechanics p. 063401 (2016). 48. H. Prufer, Arch. Math. Phys 27, 742 (1918). 49. A. Cayley, Quart. J. Math 23, 376 (1889). 50. H. K. Kesavan, Jaynes' maximum entropy principle (Springer US, Boston, MA, 2009), pp. 1779 -- 1782. 51. D. Gildea, D. Temperley, Cognitive Science 34, 286 (2010). 52. R. Ferrer-i-Cancho, C. G´omez-Rodr´ıguez, Glottometrics 33, 33 (2016). 14 53. M. H. Christiansen, N. Chater, Cognitive Science 23, 157 (1999). 54. R. Ferrer-i-Cancho, Glottometrics 25, 1 (2013). 55. C. G´omez-Rodr´ıguez, J. Nivre, Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, ACL '10 (2010), pp. 1492 -- 1501. 56. A. Yli-Jyra, C. G´omez-Rodr´ıguez, Proceedings of the 55th Annual Meeting of the Associ- ation for Computational Linguistics (Volume 1: Long Papers) (Association for Computa- tional Linguistics, Vancouver, Canada, 2017), pp. 1745 -- 1755. 57. M. Kuhlmann, P. Jonsson, Transactions of the Association for Computational Linguistics 3, 559 (2015). 58. J. Nivre, Proceedings of the 8th International Workshop on Parsing Technologies (IWPT) (2003), pp. 149 -- 160. 59. J. Nivre, Proceedings of the Workshop on Incremental Parsing: Bringing Engineering and Cognition Together (ACL) (2004), pp. 50 -- 57. 60. J. Nivre, Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP (ACL-IJCNLP) (2009), pp. 351 -- 359. 61. M. A. Covington, Proceedings of the 39th Annual ACM Southeast Conference (2001), pp. 95 -- 102. 62. D. Chen, C. Manning, Proceedings of the 2014 Conference on Empirical Methods in Nat- ural Language Processing (EMNLP) (Doha, Qatar, 2014), pp. 740 -- 750. 15 63. C. Dyer, M. Ballesteros, W. Ling, A. Matthews, N. A. Smith, Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers) (Association for Computational Linguistics, Beijing, China, 2015), pp. 334 -- 343. 64. R. Ferrer-i-Cancho, C. G´omez-Rodr´ıguez, J. L. Esteban, Physica A: Statistical Mechanics and its Applications 493, 311 (2018). 65. M. Kuhlmann, J. Nivre, Proceedings of the COLING/ACL 2006 Main Conference Poster Sessions (2006), pp. 507 -- 514. 66. M. Bodirsky, M. Kuhlmann, M. Mohl, 10th Conference on Formal Grammar and 9th Meet- ing on Mathematics of Language (Edinburgh, Scotland, UK, 2005). 67. M. Kuhlmann, Dependency Structures and Lexicalized Grammars. An Algebraic Approach, vol. 6270 of Lecture Notes in Computer Science (Springer, 2010). 68. C. G´omez-Rodr´ıguez, D. Weir, J. Carroll, Proceedings of the 12th Conference of the Eu- ropean Chapter of the Association for Computational Linguistics (EACL-09) (2009), pp. 291 -- 299. 69. C. G´omez-Rodr´ıguez, J. Carroll, D. Weir, Computational Linguistics 37, 541 (2011). 70. C. Corro, J. Le Roux, M. Lacroix, A. Rozenknop, R. Wolfler Calvo, Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (Association for Computational Linguistics, Berlin, Germany, 2016), pp. 355 -- 366. 71. E. Pitler, S. Kannan, M. Marcus, Transactions of the Association of Computational Lin- guistics 1, 13 (2013). 72. E. Pitler, Transactions of the Association for Computational Linguistics 2, 41 (2014). 16 Acknowledgments We thank two anonymous reviewers from Science for their many suggestions to improve the article. We are also to L. Alemany-Puig, A. Hernandez-Fernandez and M. Vitevitch for help- ful commments. Funding: CGR has received funding from the European Research Council (ERC), under the European Union's Horizon 2020 research and innovation programme (FAST- PARSE, grant agreement No 714150), from the ANSWER-ASAP project (TIN2017-85160-C2- 1-R) from MINECO (Ministerio de Economia, Industria y Competitividad), and from Xunta de Galicia (ED431B 2017/01, and an Oportunius program grant to complement ERC grants). RFC is supported by the grant TIN2017-89244-R from MINECO and the recognition 2017SGR-856 (MACDA) from AGAUR (Generalitat de Catalunya). Author contributions: R.F.C and C.G.R designed the experiments. C.G.R. performed the experiments. R.F.C., M.H.C. and C.G.R wrote the article. Competing interests: Authors declare no competing interest. Data and materials availability: All data are available either as auxilary files published with the article or in open access repositories indicated in the supplementary materials. Materials and Methods Materials We estimated the average dependency distances in attested sentences using collections of syn- tactic dependency treebanks from different languages. A syntactic dependency treebank is a database of sentences and their syntactic dependency trees. To provide results on a wide range of languages while controlling for the effects of different syntactic annotation theories, we use two collections of treebanks: • Universal Dependencies (UD), version 2.4 (37). This is the largest available collection of syntactic dependency treebanks, featuring 146 treebanks from 83 distinct languages. All 17 of these treebanks are annotated following the common Universal Dependencies annota- tion criteria, which are a variant of the Stanford Dependencies for English (38), based on lexical-functional grammar (39), adapting them to be able to represent syntactic phenom- ena in diverse languages under a common framework. This collection of treebanks can be freely downloaded1 and is available under free licenses. • HamleDT 2.0 (40). This collection is smaller than UD, featuring 30 languages, all of which (except for one: Bengali) are also available in UD, often with overlapping source material. Thus, using this collection does not meaningfully extend the diversity of lan- guages covered beyond using only UD. However, the interest of HamleDT 2.0 lies in that each of the 30 treebanks is annotated with not one, but two different sets of annotation criteria: Universal Stanford dependencies (41) and Prague Dependencies (42). We ab- breviate these two subsets of the HamleDT 2.0 collection as "Stanford" and "Prague", respectively. While Universal Stanford dependencies are closely related to UD, Prague dependencies provide a significantly different view of syntax, as they are based on the functional generative description (43) of the Praguian linguistic tradition (44), which dif- fers from Stanford dependencies in substantial ways, like the annotation of conjunctions or adpositions (45). Thus, using this version of HamleDT2 makes our analysis more ro- bust, as we can draw conclusions without being tied to a single linguistic tradition. The HamleDT 2.0 treebanks are available online.3 While not all of the treebanks are made fully available to the public under free licenses, to reproduce our analysis it is sufficient to use a stripped version where the words have been removed from the sentences for licensing reasons, but the bare trees are available. This version is distributed freely.4 1https://universaldependencies.org/ 2While there is a later version (HamleDT 3.0), it abandoned the dual annotation and adopted Universal Depen- dencies instead, thus making it less useful for our purposes. 3https://ufal.mff.cuni.cz/hamledt/hamledt-treebanks-20 4https://lindat.mff.cuni.cz/repository/xmlui/handle/11858/ 18 A preprocessed file with the minimal information needed to reproduce Figure 1A is available.5 Methods In our study, we do not investigate the average dependency distance over a whole ensemble of dependency structures but conditioning on sentence length (32). Then for a given n, we cal- culate (cid:104)d(cid:105)AS, the average dependency length for an ensemble of artificial syntactic dependency structures (AS), and also (cid:104)d(cid:105)RS, the average dependency length for an ensemble of attested syn- tactic dependency structures (RS). By doing that, we are controlling for sentence length, getting rid of the possible influence of the distribution of sentence length in the calculation of (cid:104)d(cid:105)RS or (cid:104)d(cid:105)AS (32). To preprocess the treebanks for our analysis, we removed punctuation, following common practice in statistical research of dependency structures (13). We also removed tree nodes that do not correspond to actual words, such as the null elements in the Bengali, Hindi and Telugu HamleDT corpora and the empty nodes in several UD treebanks. To ensure that the dependency structures are still valid trees after these removals, we reattached nodes whose head has been deleted as dependents of their nearest non-deleted ancestor. Finally, in our analysis we disre- garded syntactic trees with less than three nodes, as their statistical properties are trivial and provide no useful information (a single-node dependency tree has no dependencies at all, and a 2-node tree always has a single dependency of distance 1). Table 1 summarizes the languages in each collection of treebanks. Apart from the attested trees, we used a collection of over 16 billion randomly-generated trees. For values of n (the length or number of nodes) from 3 to n∗ = 10, we exhaustively obtained all possible trees. The number of possible dependency trees for a given length n is 00-097C-0000-0023-9551-4?show=full 5https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/ DVN/XHRIYX 19 Table 1: The languages in every collection grouped by family. The counts attached to the col- lection names indicate the number of different families and the number of different languages. The counts attached to family names indicate the number of different languages. Collection UD (19, 83) Languages Akkadian, Amharic, Arabic, Assyrian, Coptic, Hebrew, Maltese Kazakh, Turkish, Uyghur Vietnamese Indonesian, Tagalog Basque Tamil, Telugu Family Afro-Asiatic (7) Altaic (3) Austro-Asiatic (1) Austronesian (2) Basque (1) Dravidian (2) Indo-European (46) Afrikaans, Ancient Greek, Armenian, Belarusian, Breton, Bulgarian, Catalan, Croatian, Czech, Danish, Dutch, English, Faroese, French, Galician, German, Gothic, Greek, Hindi, Hindi-English, Irish, Ital- ian, Kurmanji, Latin, Latvian, Lithuanian, Marathi, Norwegian, Old Church Slavonic, Old French, Old Russian, Persian, Polish, Por- tuguese, Romanian, Russian, Sanskrit, Serbian, Slovak, Slovenian, Spanish, Swedish, Ukrainian, Upper Sorbian, Urdu, Welsh Japanese Korean Bambara Buryat Wolof, Yoruba Naija Swedish Sign Language Cantonese, Chinese, Classical Chinese Thai Mbya Guarani Erzya, Estonian, Finnish, Hungarian, Karelian, Komi Zyrian, North Sami Arabic Turkish Basque Tamil, Telugu Altaic (1) Basque (1) Dravidian (2) Indo-European (21) Ancient Greek, Bengali, Bulgarian, Catalan, Czech, Danish, Dutch, English, German, Greek, Hindi, Italian, Latin, Persian, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish Japanese Estonian, Finnish, Hungarian Arabic Turkish Basque Tamil, Telugu Japanese (1) Uralic (3) Afro-Asiatic (1) Altaic (1) Basque (1) Dravidian (2) Indo-European (21) Ancient Greek, Bengali, Bulgarian, Catalan, Czech, Danish, Dutch, English, German, Greek, Hindi, Italian, Latin, Persian, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish Japanese Estonian, Finnish, Hungarian Japanese (1) Uralic (3) 20 Japanese (1) Korean (1) Mande (1) Mongolic (1) Niger-Congo (2) Other (1) Pama-Nyungan (1) Warlpiri Sign Language (1) Sino-Tibetan (3) Tai-Kadai (1) Tupian (1) Uralic (7) Stanford (7, 30) Afro-Asiatic (1) Prague (7, 30) given by nn−1, ranging from 9 possible trees for n = 3 to 109 for n = n∗. From n > n∗ onwards, the number of trees grows too large to be manageable, so we resort to uniformly random sampling of 109 trees for n∗ < n ≤ 25. For each tree in the collection, the classes it belongs to are indicated in the dataset6. The reason why we do not go beyond length 25 is that, for larger lengths, trees that belong to our classes under analysis are very scarce (Fig. 3A). For example, even sampling 109 random trees for each length, no projective trees are found for n > 18. The same can be said of planar trees for n > 19, 1EC trees for n > 22, M H4 trees for n > 23, and W G1 trees for n > 24. For the M H5 class, some trees can still be found in the sample for length 25, but only 69 out of 109 belong to the class. Due to undersampling, the plot on artificial structures in the main article only shows points represented by at least 30 structures for n > n∗. 30 is considered a rule of thumb for the minimum sample size that is needed to estimate the mean of random variables that follow short tailed distributions (46). Fig. 3B shows average dependency distances not excluding any point. For n ≤ n∗, the ensemble of AS used to calculate (cid:104)d(cid:105)AS contains all possible syntactic dependency structures for all classes. For n > n∗, it contains a random sample of them. Within a given ensemble, each structure is generated from a labelled directed tree whose vertex labels are interpreted as vertex positions in the linear arrangement. The values of (cid:104)d(cid:105)AS for each class are exact (the mean over all possible syntactic dependency structures) for n ≤ n∗ and random sampling estimates for n > n∗. A detailed explanation follows. For a given n, an ensemble of syntactic dependency structures is generated with a proce- dure that is a generalization of the procedure used to generate random structures formed by an undirected tree and a linear arrangement (47). The procedure has two versions: the exhaustive version, that was used for n ≤ n∗, and the random sampling version, that was used for n > n∗. 6The trees are freely available from https://dataverse.harvard.edu/dataset.xhtml? persistentId=doi:10.7910/DVN/XHRIYX. 21 Figure 3: Undersampling in artificial syntactic dependency structures (AS). A. p, the proportion of artificial structures of a certain class in the sample. B. The average dependency length, (cid:104)d(cid:105)AS, as a function of n, the sentence length (in words). For reference, the base line defined by a random linear arrangement of the words of the sentence, (cid:104)d(cid:105)rla is also shown (dashed line). 22 lllllllllllllllllllllll0510152025sentence length, nproportion of trees, p10−910−810−710−610−510−410−310−210−1lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllallprojectiveplanarWG1MH4MH51EClllllllllllllllllllllll051015202502468sentence length, nmean dependency distance, <d>ASlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllallprojectiveplanarWG1MH4MH51ECBA The exhaustive version consists of 1. Generating all the T (n) labelled (undirected) trees of n vertices using Prufer codes (48). It is known that T (n) = nn−2 (49). 2. Converting each of these random trees into labelled directed trees (i.e., dependency trees) by rooting it in all possible ways. A rooting consists in choosing one node of the tree as the root, and making all edges point away from the root via a depth-first traversal. This produces nT (n) = nn−1 syntactic dependency structures. 3. Producing a syntactic dependency structure from every directed tree using vertex labels (integers from 1 to n) as vertex positions in a linear arrangement (47). 4. Discarding the trees that do not belong to the target class. The random sampling version consists of 1. Generating S uniformly random labelled (undirected) trees of n vertices, via uniformly random Prufer codes (48). 2. Converting these uniformly random labelled trees to uniformly random labelled directed trees (i.e., dependency trees) by randomly choosing one node of each tree as the root, and making all edges point away from the root via a depth-first traversal. This produces S syntactic dependency structures. 3. Same as exhaustive version. 4. Same as exhaustive version. Note that Step 2 warrants that labelled directed trees in the ensemble are uniformly random: if we call Kn the probability of generating each undirected tree of n vertices with a random Prufer 23 code, we can observe that each possible directed tree corresponds to exactly one undirected tree (obtained by ignoring arc directions), and each undirected tree corresponds to exactly n distinct directed trees (resulting from picking each of its n nodes as the root). Thus, the method of generating a random Prufer code and then choosing a root generates each possible directed tree with a uniform probability Kn/n (as the probability of choosing the underlying undirected tree is Kn, and the probability of choosing the relevant root is 1/n). After each procedure, the average dependency length (cid:104)d(cid:105) for a given n and a given class is calculated. While the exhaustive procedure allows one to calculate the true average dependency length over a certain class, the random sampling algorithm only allows one to estimate the true average. Put differently, the exhaustive procedure allows one to calculate exactly the expected dependency length in a class assuming that all labelled directed trees are equally likely whereas the random sampling procedure only allows one to obtain an approximation. We explore all values of n within the interval [nmin, nmax] with nmin = 3 and nmax = 25 and n∗ = 10 and S = 109. The total number of syntactic dependency structures generated for our study is n∗(cid:88) n∗(cid:88) U = (nmax − n∗)S + nT (n) = (nmax − n∗)S Applying the parameters above, one obtains n=nmin n=nmin Supplementary text The random baseline Although the random baseline U ≈ 1.6 · 1010 (cid:104)d(cid:105)rla = (n + 1)/3 24 nn−1. (2) (3) follows from Jaynes' maximum entropy principle in the absence of any constraint (50), it may be objected that our baseline is too unconstrained from a linguistic perspective. In previous research, random baselines that assume projectivity or consistent branching, whereby languages tend to grow parse trees either to the right (as in English) or to the left (as in Japanese), have been considered (26, 28, 51). However, it has been argued that these linguistic constraints could be a reflection of memory limitations (52, 53). Therefore, incorporating these linguistic constraints into the baseline for evaluating dependency distances would not provide an adequate test of the cognitive independence assumption because they could mask the effect of dependency distance minimization (DDm). Consistently, the planarity assumptions reduces the statistical power of a test of DDm (29). In addition, these additional constraints compromise the parsimony of a general theory of language for neglecting the predictive power of DDm (52). A priori, (cid:104)d(cid:105)AS could be below the random baseline as it occurs typically in human lan- guages (25,32) but it could also be above. As for the latter situation, empirical research in short sentences has shown that there are languages where dependency lengths are larger than expected by chance (29). In addition, there exist syntactic dependency structures where (cid:104)d(cid:105) > (cid:104)d(cid:105)rla from a network theoretical standpoint. For instance, among planar syntactic structures, the maximum average dependency distance is (cid:104)d(cid:105)max = n/2 (54). (cid:104)d(cid:105)AS never exceeds (cid:104)d(cid:105)rla and it deviates from (cid:104)d(cid:105)rla when n = 3 for projective trees, n = 4 for planar trees and M H4 and n = 5 for 1EC, M H5 and W G1. For the class of all syntactic dependency structures (Fig. 2 of main article), we find that (cid:104)d(cid:105)AS matches Eq. 3 as expected from previous research (47). The classes of dependency structures Planar trees: A dependency tree is said to be planar (or noncrossing) if its dependency arcs do not cross when drawn above the words. Planar trees have been used in syntactic parsing 25 Figure 4: A. A tree that is planar (dependencies do not cross) but not projective (the root node, 3, is covered by the dependency in red). B. A tree that is planar and projective. C. A tree that is not planar (the dependencies in red cross), and thus not projective. algorithms (55), and their generalization to noncrossing graphs has been widely studied both for its formal properties (56) and for parsing (57). Projective trees: A dependency tree is said to be projective if it is planar and its root is not covered by any dependency (see Figure 4). Projectivity facilitates the design of simple and efficient parsers (58,59), whereas extending them to support non-projective trees increases their computational cost (60, 61). For this reason, and because treebanks of some languages (like English or Japanese) have traditionally had few or no non-projective analyses, many practical implementations of parsers assume projectivity (62, 63). However, non-projective parsing is needed to deal with sentences exhibiting non-projective phenomena such as extraposition, scrambling or topicalization. Non-projectivity is particularly common in flexible word order languages, but generally present in a wide range of languages. However, non-projectivity in natural languages tends to be mild in the sense that the actually oc- curring non-projective trees are very close to projective trees, as they have much fewer crossing dependencies than would be expected by chance (64). For this reason, there has been research interest in finding a restriction that would be a better fit for the phenomena observed in human languages. From a linguistic standpoint, the goal is to describe the syntax of human language better than with the overly restrictive projective trees or the arguably excessive permissiveness of admitting any tree without restriction, disregarding the observed scarcity of crossing dependencies. From an engineering standpoint, the goal is to 26 A12345B12345C12345 Figure 5: A. An ill-nested tree (the yields of node 3 -- circled -- and node 4 -- squared -- form an interleaving pattern). B. A tree with gap degree 2 (the yield of node 2, squared, has two discontinuities, at nodes 3 and 5). C. A tree that is well-nested and has gap degree 1, and thus is in W G1. strike a balance between the efficiency provided by more restrictive parsers with a smaller search space and the coverage of the non-projective phenomena that can be found in attested sentences. In this line, various sets of dependency structures that have been proposed are supersets of projective trees allowing only a limited degree of non-projectivity. These sets are called mildly non-projective classes of dependency trees (65). Here, we focus on three of the best known such sets, which have interesting formal prop- erties and/or have been shown to be practical for parsing due to providing a good efficiency- coverage trade-off. We briefly outline them here, and refer the reader to (33) for detailed defi- nitions and coverage statistics of these and other mildly non-projective classes of trees. Well-nested trees with Gap degree 1 (W G1): A dependency tree is well-nested (66) if it does not contain two nodes with disjoint, interleaving yields. Given two disjoint yields a1 . . . ap and b1 . . . bq, they are said to interleave if there exist i, j, k, l such that ai < bj < ak < bl. On the other hand, the gap degree of a tree is the maximum number of discontinuities present in the yield of a node, i.e., a dependency tree has gap degree 1 if every yield is either a contiguous substring, or the union of two contiguous substrings of the input sentence. Figure 5 provides graphical examples of these properties. W G1 trees have drawn interest mainly from the for- mal standpoint, for their connections to constituency grammar (67), but they also have been investigated in dependency parsing (68 -- 70). 27 A123456B123456C123456 Figure 6: A. An 1-Endpoint-Crossing tree (given any dependency, dependencies crossing it are incident to a common node -- for example, here the dependencies crossing the one marked in red are incident to node 4). B. A tree that is not 1-Endpoint-Crossing. The dependency arc in red has two crossing dependencies which are not incident to any common node. Multi-Headed with at most k heads per item (M Hk): Given k ≥ 3, the set of M Hk trees contains the trees that can be parsed by an algorithm called M Hk (69). k is a parameter of the class, such that for k = 3 the class coincides with projective trees, but for k > 3 it cov- ers increasingly larger sets of non-projective structures (but the parser becomes slower). A recent neural implementation of the M H4 parser has obtained competitive accuracy on UD (8). For k > 4, the M Hk sets have been shown to be Pareto optimal (among known mildly non- projective classes) in terms of balance between efficiency and practical coverage (33). In this paper, we will consider the M H4 and M H5 sets. 1-Endpoint-Crossing trees (1EC): A dependency tree has the property of being 1-Endpoint- Crossing if, given a dependency, all other dependencies crossing it are incident to a common node (71). This property is illustrated in Figure 6. 1EC trees were the first mildly non-projective class of dependency trees to have a practical exact-inference parser (72), which was reimple- mented with a neural architecture in (8). They are also in the Pareto frontier with respect to coverage and efficiency, according to (33). 28 A123456B123456
1704.02215
2
1704
2017-04-10T10:31:49
EELECTION at SemEval-2017 Task 10: Ensemble of nEural Learners for kEyphrase ClassificaTION
[ "cs.CL" ]
This paper describes our approach to the SemEval 2017 Task 10: "Extracting Keyphrases and Relations from Scientific Publications", specifically to Subtask (B): "Classification of identified keyphrases". We explored three different deep learning approaches: a character-level convolutional neural network (CNN), a stacked learner with an MLP meta-classifier, and an attention based Bi-LSTM. From these approaches, we created an ensemble of differently hyper-parameterized systems, achieving a micro-F1-score of 0.63 on the test data. Our approach ranks 2nd (score of 1st placed system: 0.64) out of four according to this official score. However, we erroneously trained 2 out of 3 neural nets (the stacker and the CNN) on only roughly 15% of the full data, namely, the original development set. When trained on the full data (training+development), our ensemble has a micro-F1-score of 0.69. Our code is available from https://github.com/UKPLab/semeval2017-scienceie.
cs.CL
cs
EELECTION at SemEval-2017 Task 10: Ensemble of nEural Learners for kEyphrase ClassificaTION Steffen Eger†‡, Erik-Lan Do Dinh†, Ilia Kuznetsov†, Masoud Kiaeeha†, Iryna Gurevych†‡ †Ubiquitous Knowledge Processing Lab (UKP-TUDA) Department of Computer Science, Technische Universitat Darmstadt ‡Ubiquitous Knowledge Processing Lab (UKP-DIPF) German Institute for Educational Research and Educational Information 7 1 0 2 r p A 0 1 ] L C . s c [ 2 v 5 1 2 2 0 . 4 0 7 1 : v i X r a http://www.ukp.tu-darmstadt.de Abstract This paper describes our approach to the SemEval 2017 Task 10: "Extracting Keyphrases and Relations from Scientific Publications", specifically to Subtask (B): "Classification of identified keyphrases". We explored three different deep learn- ing approaches: a character-level convo- lutional neural network (CNN), a stacked learner with an MLP meta-classifier, and an attention based Bi-LSTM. From these approaches, we created an ensemble of differently hyper-parameterized systems, achieving a micro-F1-score of 0.63 on the test data. Our approach ranks 2nd (score of 1st placed system: 0.64) out of four ac- cording to this official score. However, we erroneously trained 2 out of 3 neural nets (the stacker and the CNN) on only roughly 15% of the full data, namely, the origi- nal development set. When trained on the full data (training+development), our en- semble has a micro-F1-score of 0.69. Our code is available from https://github. com/UKPLab/semeval2017-scienceie. Introduction 1 Although scientific experiments are often accom- panied by vast amounts of structured data, full-text scientific publications still remain one of the main means for communicating academic knowledge. Given the dynamic nature of modern research and its ever-accelerating pace, it is crucial to automat- ically analyze new works in order to have a com- plete picture of advances in a given field. Recently, some progress has been made in this direction for the fixed-domain use case1. How- ever, creating a universal open-domain system still 1 E.g. BioNLP: http://2016.bionlp-st.org/ remains a challenge due to significant domain dif- ferences between articles originating from differ- ent fields of research. The SemEval 2017 Task 10: ScienceIE (Augenstein et al., 2017) promotes the multi-domain use case, providing source ar- ticles from three domains: Computer Science, Material Sciences and Physics. The task con- sists of three subtasks, namely (A) identification of keyphrases, (B) classifying them into broad domain-independent classes and (C) inferring re- lations between the identified keyphrases. For example, for the input sentence 'The ther- modynamics of copper-zinc alloys (brass) was subject of numerous investigations' the following output would be expected: (A) 1. The thermodynamics of copper-zinc alloys 2. copper-zinc alloys 3. brass (B) 1. TASK 2. MATERIAL 3. MATERIAL (C) synonym(2,3) Our submission focuses on (B) keyphrase clas- sification given item boundaries. We avoid task- specific feature engineering, which would poten- tially render the system domain-dependent. In- stead, we build an ensemble of several deep learn- ing classifiers detailed in §3, whose inputs are word embeddings learned from general domains. 2 Task and Data In the annotation scheme proposed by the task or- ganizers, keyphrases denoting a scientific model, algorithm or process should be classified as PROCESS (P), which also comprises methods (e.g. 'backpropagation'), physical equipment (e.g. 'plasmatic nanosensors', 'electron microscope') and tools (e.g. 'MATLAB'). TASK (T) contains concrete research tasks (e.g. 'powder processing', 'dependency parsing') and research areas (e.g. 'machine learning'), while MATERIAL (M) in- cludes physical materials (e.g. 'iron', 'nanotube'), and corpora or datasets (e.g. 'the CoNLL-2003 NER corpus'). The corpus for the shared task consisted of 500 journal articles retrieved from ScienceDirect2, evenly distributed among Computer Science, Ma- terial Sciences and Physics domains. It was split into three segments of 350 (training), 50 (develop- ment), and 100 (test) documents. The corpus used in subtask (B) contains paragraphs of those arti- cles, annotated with spans of keyphrases. Table 1 shows the distribution of the classes M, T, and P in the data. We note that class T is underrepresented and makes up less than 16% of all instances. Train+Dev Test Material Process Task 44% 16% 47% 9% 40% 44% Table 1: Class distribution in the datasets. Inter-annotator agreement for the dataset was published to be between 0.45 and 0.85 (Cohen's κ) (Augenstein et al., 2017). Reviewing similar anno- tation efforts (QasemiZadeh and Schumann, 2016) already shows that despite the seemingly simple annotation task, usually annotators do not reach high agreement neither on span of annotations nor the class assigned to each span3. 3 In this section, we describe the individual systems that form the basis of our experiments (see §4). Implemented Approaches Our basic setup for all of our systems was as follows. For each keyphrase we extracted its left context, right context and the keyphrase itself (center). We represent each of the three contexts as the concatenation of their word tokens: to have fixed-size representations, we limit the left context to the (cid:96) previous tokens, the right context to the r following tokens and the center to the c initial to- kens of the keyphrase. We consider (cid:96), r and c as hyper-parameters of our modeling. If necessary, we pad up each respective context with 'empty' word tokens. We then map each token to a d- dimensional word embedding. The choices for 2 http://www.sciencedirect.com/ 3F1-scores ranging from 0.528 to 0.755 for span bound- aries and from 0.471 to 0.635 for semantic categories. word embeddings are described below. To sum- marize, we frame our classification problem as a mapping fθ (θ represents model parameters) from concatenated word embeddings to one of the three classes MATERIAL, PROCESS, and TASK: fθ : R(cid:96)·d × Rc·d × Rr·d → {M, P, T}. Next, we describe the embeddings that we used and subsequently the machine learning models fθ. Word Embeddings We experimented with three kinds of word em- beddings. We use the popular Glove embeddings (Pennington et al., 2014) (6B) of dimensions 50, 100, and 300, which largely capture semantic in- formation. Further we employ the more syntac- tically oriented 300-dimensional embeddings of Levy and Goldberg (2014), as well as the 300- dimensional embeddings of Komninos and Man- andhar (2016), which are trained to predict both dependency- and standard window-based context. Deep Learning models Our first model is a character-level convolutional neural network (char-CNN) illustrated in Fig- ure 1. This model (A) considers each of the three contexts (left, center, right) independently, repre- senting them by a 100-dimensional vector as fol- lows. Each character is represented by a 1-hot vector, which is then mapped to a 32-dimensional 100-d 32-d 32-d 32-d 32-d 1-hot 1-hot 1-hot 1-hot H M M SsS Figure 1: CNN. Each character is represented by a 1-hot vec- tor, which is then mapped to a learned 32-d embedding vec- tor. On these, m (m = 2 in the example) filters operate, which are combined to an m-dimensional vector via max- over-time-pooling. The output layer, with tanh activation, is 100-d and is fully connected with the m-dim layer that feeds into it. We represent the left context, right context, and center via the same illustrated CNN, and then concatenate the 100-d representations to a 300-d representation of the input. embedding (not pre-trained, and updated during learning). Then m filters, each of size s, are applied on the embedding layer. Max-over-time pooling results in an m-dimensional layer which is fully connected with the 100-dimensional output layer, with tanh activation function. The 100-d representations of each context are then (B) con- catenated, resulting in a 300-dimensional repre- sentation of the input. A final softmax layer pre- dicts one of our three target classes. The hyper- parameters of this model-additional to (cid:96), r, c mentioned above-are: number of filters m, fil- ter size s, and a few others, such as the number of characters to consider in each context window. Our second model, which operates on the token- level, is a "stacked learner". We take five base classifiers from scikit-learn (RandomForestClassi- fier with two different parameterizations; Extra- TreesClassifier with two different parameteriza- tions; and XGBClassifier), and train them repeat- edly on 90% of the training data, extracting their softmax concat concat concat backward ht−1 forward ht−1 ... xt−1 ht ht xt ht+1 ht+1 ... ... xt+1 ... convolutional layers convolutional layers filter widths = 2, 3, 5, 7 filter widths = 2, 3, 5, 7 concat max-over-time pooling Figure 2: Bi-LSTM with attention. Pre-trained word embed- dings xt are fed to an ensemble of CNN layers with 4 differ- ent filter widths. For each timestep the outputs are concate- nated and we employ max-over-time pooling. The resulting attention vector is supplied to the nodes in the forward and backward LSTM layers. The output of both LSTM layers is concatenated to a 128-dim vector, which is fed to the final softmax layer. predictions on the remaining 10%. This process is iterated 10 times, in a cross-validation manner, so that we have a complete sample of predictions of the base classifiers on the training data. We then use a multi-layer perceptron (MLP) as a meta- classifier that is trained to combine the predictions of the base classifiers into a final output prediction. The MLP is trained for 100 epochs and the model with best performance on a 10% development set is chosen as the model to apply to unseen test data. Our third model (Figure 2), also operating on the token level, is an attention based Bi- directional Long Short-Term Memory network (AB-LSTM)4. After loading pre-trained word em- beddings, we apply 4 convolutional layers with fil- ter sizes 2, 3, 5 and 7, followed by max-over-time- pooling. We concatenate the respective vectors to create an attention vector. The forward and back- ward LSTM layers (64-dimensional) are supplied with the pre-trained embeddings and the computed attention vector. Their output is concatenated and, after applying dropout of 0.5, is used by the final softmax layer to predict the label probabilities. 4 Submitted Systems We set the c hyper-parameter to 4, and draw left and right context length hyper-parameters (cid:96), r ((cid:96) = r) from a discrete uniform distribution over the multi-set {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5}. Performance measure was micro-F1 as com- puted by the task's evaluation script.5 Table 2 shows average, maximum, and minimum perfor- mances of the systems we experimented with. We indicate the 'incorrect' systems (those trained on only the dev set) with a star. We tested 56 dif- ferent CNNs-hyper-parameters randomly drawn from specific ranges; e.g., we draw the number of filters m from a normal distribution N (µ = 250, σ = 50)-90 different stackers, and 20 dif- ferent AB-LSTMs. Our three submitted systems were simple majority votes of (1) the 90 stackers, (2) the 90 stackers and 56 CNNs, (3) the 90 stack- ers, 56 CNNs and 20 AB-LSTMs. Overall, ma- jority voting is considerably better than the mean performances of each system. 4 Code was adapted from https://github.com/ codekansas/keras-language-modeling 5 We report results without the "rel" flag, i.e., correspond- ing to the column "Overall" in Augenstein et al. (2017), Ta- ble 4. Setting "rel" leads to consistently higher results. E.g., with this flag, we have 72% micro-F1 for our best ensemble (corresponding to column "B" in Augenstein et al. (2017), Table 4), rather than 69% as reported in our Table 2. CNN Stacker AB-LSTM Majority Mean 58.32∗/64.08 61.57∗/67.11 59.12 63∗/69 Max 61∗/65 64∗/68 64 63∗/69 Min 54∗/60 59∗/65 56 62∗/68 Table 2: Micro-F1 results in % for our systems. For the stacker, the Komninos embeddings worked consistently best, with an average F1- score of 63.83%. Levy embeddings were second (62.50), followed by Glove embeddings of size 50 (61%), size 300 (60.80) and size 100 (59.50). We assume this is due to the Komninos embed- dings being 'richest' in nature, capturing both se- mantic and syntactic information. However, with more training data (corrected results), mean per- formances as a function of embedding type are closer: 67.77 (Komninos), 67.61 (Levy), 67.38 (Glove-300), 66.88 (Glove-50), 65.77 (Glove- 100). The AB-LSTM could not capitalize as much on the syntactic information, and performed best with the Glove embeddings, size 100 (60.35%), and worst with the Levy embeddings (57.80). The char-level CNN and the stacker performed individually considerably better than the AB- LSTM. However, including the AB-LSTM in the ensemble slightly increased the majority F1-score on both the M and T class, as Table 3 shows. Ensemble (1) Stackers (2) Stackers+CNNs (3) Stackers+CNNs+AB-LSTMs M P 71 76 72 76 77 72 T 46 46 47 Table 3: F1 results in % across different classes. Error analysis: Table 4 details that TASK is often confused with PROCESS, and-though less often-vice versa, leading to drastically lower F1- score than for the other two classes. This mis- match is because PROCESS and TASK can de- scribe similar concepts, resulting in rather sub- tle differences. E.g., looking at various 'analy- sis' instances, we find that some are labeled as PROCESS and others as TASK in the gold data. This holds even for a few seemingly very simi- lar keyphrases ('XRD analysis', 'FACS analysis'). The ensemble has trouble labeling this correctly, tagging 6 of 17 'analysis' instances wrongly. Be- yond further suspicious labelings in the data (e.g., 'nuclear fissions reactors' as Task), other cases could have been resolved by knowledge of syntax ('anionic polymerization of styrene' is a process, not a material) and/or POS tags, and by knowledge of common abbreviations such as 'PSD'. We note that our submitted systems have the best F1-score for the minority class TASK (45%∗/47% vs. ≤28% for all other participants). Thus, our submission would have scored 1st using macro-F1 (60.66∗/65.33 vs. ≤56.66), even in the erroneous setting of much less training data. Prediction Material Process Task d Material Process Task l o G 710 218 22 194 708 105 0 28 67 Table 4: Stackers+CNNs+AB-LSTMs confusion matrix. 5 Conclusion We present an ensemble-based keyphrase classi- fication system which has achieved close-to-the- best results in the ScienceIE Subtask (B) while us- ing only a fraction of the available training data. With the full training data, our approach ranks 1st. To avoid using expert features has been one of our priorities, but we believe that incorporating addi- tional task-neutral information beyond words and word order would benefit the system performance. We also experimented with document embed- dings, created from additionally crawled Sci- enceDirect6 articles. Even though the stacker de- scribed in §3 acting as a document classifier ob- tained a reasonably high accuracy of ∼87%, its predictions had little effect on the overall results. Manual examination of system errors shows that using part-of-speech tags, syntactic relations and simple named entity recognition would very likely boost the performance of our systems. Acknowledgments This work has been supported by the Volkswagen Foundation, FAZIT, DIPF, KDSL, and the EU's Horizon 2020 research and innovation programme (H2020-EINFRA-2014-2) under grant agreement № 654021. It reflects only the authors' views and the EU is not liable for any use that may be made of the information contained therein. 6 https://dev.elsevier.com/api docs.html References Isabelle Augenstein, Mrinal Kanti Das, Sebastian Riedel, Lakshmi Nair Vikraman, and Andrew Mc- Callum. 2017. SemEval 2017 Task 10: ScienceIE - Extracting Keyphrases and Relations from Scientific In Proceedings of the International Publications. Workshop on Semantic Evaluation. ACL, Vancou- ver, Canada. Alexandros Komninos and Suresh Manandhar. 2016. Dependency Based Embeddings for Sentence Clas- In Proceedings of NAACL-HLT sification Tasks. '16. ACL, San Diego, CA, USA, pages 1490–1500. Omer Levy and Yoav Goldberg. 2014. Dependency- In Proceedings of ACL Based Word Embeddings. '14. ACL, Baltimore, MD, USA, pages 302–308. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. Glove: Global Vectors for In Proceedings of EMNLP Word Representation. '14. ACL, Doha, Qatar, pages 1532–1543. Behrang QasemiZadeh and Anne-Kathrin Schumann. 2016. The ACL RD-TEC 2.0: A Language Re- source for Evaluating Term Extraction and Entity Recognition Methods. In Proceedings of LREC '16. ELRA, Portoroz, Slovenia, pages 1862–1868.
1608.06718
1
1608
2016-08-24T05:30:45
A Large-Scale Multilingual Disambiguation of Glosses
[ "cs.CL" ]
Linking concepts and named entities to knowledge bases has become a crucial Natural Language Understanding task. In this respect, recent works have shown the key advantage of exploiting textual definitions in various Natural Language Processing applications. However, to date there are no reliable large-scale corpora of sense-annotated textual definitions available to the research community. In this paper we present a large-scale high-quality corpus of disambiguated glosses in multiple languages, comprising sense annotations of both concepts and named entities from a unified sense inventory. Our approach for the construction and disambiguation of the corpus builds upon the structure of a large multilingual semantic network and a state-of-the-art disambiguation system; first, we gather complementary information of equivalent definitions across different languages to provide context for disambiguation, and then we combine it with a semantic similarity-based refinement. As a result we obtain a multilingual corpus of textual definitions featuring over 38 million definitions in 263 languages, and we make it freely available at http://lcl.uniroma1.it/disambiguated-glosses. Experiments on Open Information Extraction and Sense Clustering show how two state-of-the-art approaches improve their performance by integrating our disambiguated corpus into their pipeline.
cs.CL
cs
A Large-Scale Multilingual Disambiguation of Glosses Jos´e Camacho-Collados, Claudio Delli Bovi, Alessandro Raganato and Roberto Navigli Department of Computer Science, Sapienza University of Rome {collados,dellibovi,raganato,navigli}@di.uniroma1.it Via Regina Elena, 295 - 00161 Roma, Italy 6 1 0 2 g u A 4 2 ] L C . s c [ 1 v 8 1 7 6 0 . 8 0 6 1 : v i X r a Abstract Linking concepts and named entities to knowledge bases has become a crucial Natural Language Understanding task. In this respect, recent works have shown the key advantage of exploiting textual definitions in various Natural Language Processing applications. However, to date there are no reliable large-scale corpora of sense-annotated textual definitions available to the research community. In this paper we present a large-scale high-quality corpus of disambiguated glosses in multiple languages, comprising sense annotations of both concepts and named entities from a unified sense inventory. Our approach for the construction and disambiguation of the corpus builds upon the structure of a large multilingual semantic network and a state-of-the-art disambiguation system; first, we gather comple- mentary information of equivalent definitions across different languages to provide context for disambiguation, and then we combine it with a semantic similarity-based refinement. As a result we obtain a multilingual corpus of textual definitions featuring over 38 million definitions in 263 languages, and we make it freely available at http://lcl.uniroma1.it/disambiguated-glosses. Experiments on Open Information Extraction and Sense Clustering show how two state-of-the-art approaches improve their performance by integrating our disambiguated corpus into their pipeline. Keywords: Word Sense Disambiguation, Entity Linking, textual definitions, definitional knowledge, multilingual corpus 1. Introduction In addition to lexicography, where their use is of paramount importance, textual definitions drawn from dic- tionaries or encyclopedias have been widely used in var- ious Natural Language Processing tasks and applications. Some of the areas where the use of definitional knowl- edge has proved to be key in achieving state-of-the-art re- sults are Word Sense Disambiguation (Lesk, 1986; Baner- jee and Pedersen, 2002; Navigli and Velardi, 2005; Agirre and Soroa, 2009; Fernandez-Ordonez et al., 2012; Chen et al., 2014; Camacho-Collados et al., 2015b), Taxonomy and Ontology Learning (Velardi et al., 2013; Flati et al., 2014; Espinosa-Anke et al., 2016), Information Extraction (Richardson et al., 1998; Delli Bovi et al., 2015), Plagia- rism Detection (Franco-Salvador et al., 2016), and Ques- tion Answering (Hill et al., 2015). In fact, textual definitions (or glosses) are today widely to be found in resources of various kinds, from lexicons and dictionaries, such as WordNet (Miller et al., 1990) or Wiktionary, to encyclopedias and knowledge bases, such as Wikidata and OmegaWiki. These include Wikipedia itself: indeed, the first sentence of a Wikipedia article is generally regarded as the definition of its subject1. In any case, an accurate semantic analysis of a definition corpus is made difficult by the short and concise nature of definitional text. Furthermore, the majority of approaches making use of def- initions are restricted to corpora where each concept or en- tity is associated with a single definition, while definitions coming from different resources are often complementary and might give different perspectives on the definiendum. Moreover, equivalent definitions of the same concept or en- tity may vary substantially according to the language, and be more precise or self-explanatory in some languages than 1According to the Wikipedia guidelines an article should be- gin with a short declarative sentence defining what (or who) the subject is and why it is notable. others. This has the potential to be especially valuable in the context of disambiguation (Navigli, 2009), where highly ambiguous terms in one language may become less ambiguous (or even unambiguous) in other languages. In this paper we bring together definitions coming from both different resources and different languages, and dis- ambiguate them by exploiting their cross-lingual and cross- resource complementarities. Our goal is to obtain a large- scale high-quality corpus of sense-annotated textual defini- tions. In order to do this we leverage BabelNet2 (Navigli and Ponzetto, 2012), a multilingual lexicalized semantic network obtained from the automatic integration of lexico- graphic and encyclopedic resources. Due to its wide cover- age of both lexicographic and encyclopedic terms, Babel- Net gives us a very large sense inventory for disambigua- tion, as well as a vast and comprehensive target corpus of textual definitions. In fact, as it is a merger of vari- ous different resources, BabelNet provides a large hetero- geneous set of over 35 million definitions for over 250 lan- guages from WordNet, Wikipedia, Wiktionary, Wikidata and OmegaWiki. To the best of our knowledge, this set constitutes the largest available corpus of definitional text. We evaluate our sense-annotated corpus intrinsically, ob- taining a disambiguation precision of over 90% on a ran- dom sample of definitions in three different languages, and extrinsically on Open Information Extraction and Sense Clustering tasks. Our experiments show the potential of exploiting our disambiguated glosses within the pipelines of two state-of-the-art systems, improving on their original performance. 2. Related Work Among all resources using textual definitions, WordNet has definitely been the most popular and the most exploited 2http://babelnet.org to date. In fact, WordNet glosses have still been used suc- cessfully in recent work (Khan et al., 2013; Chen et al., 2015). A first attempt to disambiguate WordNet glosses auto- matically was proposed as part of the eXtended WordNet project3 (Novischi, 2002). However, this attempt's esti- mated coverage did not reach 6% of the total amount of sense-annotated instances. Moldovan and Novischi (2004) proposed an alternative disambiguation approach, specifi- cally targeted at the WordNet sense inventory and based on a supervised model trained on the SemCor sense-annotated corpus (Miller et al., 1993). In general, the drawback of supervised models arises from the so-called knowledge- acquisition bottleneck, a problem that becomes particu- larly vexed when such models are applied to larger inven- tories, due to the vast amount of annotated data they nor- mally require. Another disambiguation task focused on WordNet glosses was presented as part of the SensEval-3 workshop (Litkowski, 2004). However, the best reported system obtained precision and recall figures below 70%, which arguably is not enough to provide high-quality sense- annotated data for current state-of-the-art NLP systems. In addition to annotation reliability, another issue that arises when producing a corpus of textual definitions is wide coverage. In fact, reliable corpora of sense-annotated definitions produced to date, such as the Princeton Word- Net Gloss Corpus4, have usually been obtained by relying on human annotators. The Princeton corpus of WordNet disambiguated glosses has already been shown to be suc- cessful as part of the pipeline in semantic similarity (Pile- hvar et al., 2013), domain labeling (Gonz´alez et al., 2012) and Word Sense Disambiguation (Agirre and Soroa, 2009; Camacho-Collados et al., 2015b) systems. However, as new encyclopedic knowledge about the world is constantly being harvested, keeping up using only human annotation is becoming an increasingly expensive endeavor. With a view to tackling this problem, a great deal of research has recently focused on the automatic extraction of definitions from unstructured text (Navigli and Velardi, 2010; Benedic- tis et al., 2013; Espinosa-Anke and Saggion, 2014; Dalvi et al., 2015). On the other hand, the prominent role of collabo- rative resources (Hovy et al., 2013) has created a convenient development ground for NLP systems based on encyclo- pedic definitional knowledge. Nevertheless, extending the manual annotation of definitions to much larger and up-to- date knowledge repositories like BabelNet is not feasible. First of all, the number of items to disambiguate is mas- sive; moreover, as the number of concepts and named enti- ties increases, annotators would have to deal with the added difficulty of selecting context-appropriate synsets from an extremely large sense inventory. In fact, WordNet 3.0 com- prises 117 659 synsets and a definition for each synset, while BabelNet 3.0 covers 13 801 844 synsets with a to- tal of 40 328 194 definitions. Instead, in this paper we propose an automatic disam- biguation approach which leverages multilinguality and cross-resource information along with a state-of-the-art 3http://www.hlt.utdallas.edu/xwn/ 4http://wordnet.princeton.edu/glosstag. shtml multilingual Word Sense Disambiguation/Entity Linking system (Moro et al., 2014) and a vector-based semantic rep- resentation of concepts and entities (Camacho-Collados et al., 2015a). By exploiting these features, we are able to produce a large-scale high-quality corpus of glosses, auto- matically disambiguated with BabelNet synsets5. 3. Methodology The gist of our approach lies in the combination of differ- ent languages and resources for high-quality disambigua- tion. In fact, since many definitions are short and concise, the lack of meaningful context would negatively affect the performance of a Word Sense Disambiguation/Entity Link- ing system targeted at individual definitions. To improve the data quality before the disambiguation step, we tokenize and Part-of-Speech (PoS) tag the defini- tions for a subset of languages: Tokenization. We use the tokenization system available from the polyglot project6 for 165 languages. Part-of-Speech tagging. We train the Stanford tagger (Toutanova et al., 2003), for 30 languages using the avail- able data from the Universal Dependencies project7(Nivre, 2015). Our disambiguation strategy is based on two steps: (1) all definitions are gathered together, grouped by definien- dum and disambiguated using a multilingual disambigua- tion system (Section 3.1.); (2) the disambiguation output is then refined using semantic similarity (Section 3.2.). 3.1. Context-rich Disambiguation As an example, consider the following definition of castling in chess as provided by WordNet: Interchanging the positions of the king and a rook. (1) The context in (1) is limited and it might not be obvious for an automatic disambiguation system that the concept being defined relates to chess: an alternative definition of castling where the game of chess is explicitly mentioned would defi- nitely help the disambiguation process. Following this idea, given a BabelNet synset, we carry out a context enrichment procedure by collecting all the definitions of this synset in every available language and resource, and gathering them together into a single multilingual text. We use a state-of-the-art graph-based approach to Entity Linking and Word Sense Disambiguation, Babelfy8 (Moro et al., 2014), to disambiguate definitions after preprocess- ing and context-enrichment. Our methodology relies on the fact that, as shown in Section 3.1., disambiguation sys- tems like Babelfy work better with richer context. When provided with the definition of Example (1) in isolation, 5Note that BabelNet covers WordNet and Wikipedia among other resources, which makes our sense annotations expandable to any of these resources. 6http://polyglot.readthedocs.org/en/ latest/Tokenization.html 7https://universaldependencies.github.io/ docs/ 8http://babelfy.org Wikipedia Wikidata Wiktionary OmegaWiki WordNet Total All languages 29 792 245 8 484 267 281 756 115 828 146 018 38 820 114 English 4 854 598 703 369 281 756 29 863 117 226 5 986 812 Spanish 1 152 271 232 091 - 22 446 - 1 406 808 French 1 590 767 1 392 718 - 12 777 - 2 996 262 Italian 1 113 357 987 912 - 14 763 - 2 116 032 Persian 414 950 352 697 - 11 - 767 658 Table 1: Number of disambiguated glosses by language (columns) and by resource (rows). Babelfy incorrectly disambiguates rook as "rookie, inexpe- rienced youth". However, by using additional definitions from other resources and languages, Babelfy exploits the added context and disambiguates rook with its correct chess sense. This approach is particularly advantageous for lan- guages with low resources, where standard disambiguation techniques have not yet proved to be reliable, due to the shortage of annotated data. 3.2. Disambiguation Refinement Babelfy outputs a set D of disambiguated instances, i.e. mappings from text fragments to items in the BabelNet sense inventory, each associated with a confidence score (Babelfy score henceforth). When Babelfy score goes be- low 0.7, a back-off strategy based on the most common sense is used by default for that instance. Our aim is to correct or discard these low-confidence instances using Se- mantic Similarity. First, for each disambiguated instance d ∈ D we com- pute a coherence score Cd. The coherence score is provided by Babelfy as the number of semantic connections from d to the rest of disambiguation instances in the semantic graph (normalized): Cd = Disambiguated instances connected to d Disambiguated instances − 1 (2) We empirically set a coherence score threshold to 0.125 (i.e. one semantic connection out of eight disambiguated instances). Let L be the set of disambiguated instances below both Babelfy and coherence score thresholds (low confidence). In order to refine the disambiguated in- stances in L, we use NASARI9 (Camacho-Collados et al., 2015a; Camacho-Collados et al., 2015b). NASARI pro- vides vector representations for over four million BabelNet synsets built by exploiting the complementary knowledge of Wikipedia and WordNet. These semantic representations have proved capable of obtaining state-of-the-art results in various lexical semantics tasks such as Semantic Similar- ity, Sense Clustering and Word Sense Disambiguation.We consider those instances in L for which a NASARI vec- tor can be retrieved (virtually all noun instances), and com- pute an additional score (NASARI score). First, we calcu- late the centroid µ of all the NASARI vectors for instances in D \ L. Then, for each disambiguated instance l ∈ L, 9We use the 2.1 release version of the NASARI-embed vectors, downloaded from http://lcl.uniroma1.it/nasari we retrieve all the candidate senses of its surface form in BabelNet and calculate a NASARI score Ns for each can- didate sense. Ns is calculated as the cosine similarity be- tween the centroid µ and its corresponding NASARI vec- tor N ASARI(s): Ns = Sim(µ, N ASARI(s)) (3) The NASARI score allows us to both discard low- confidence disambiguated instances and correct the origi- nal disambiguation output by Babelfy in some cases. Then, each l ∈ L is re-tagged with the sense obtaining the highest NASARI score: s = argmax s∈Sl Nl (4) where Sl is the set containing all the candidate senses for l. For what concerns the high-precision disambiguated glosses release (see Section 6.) we set the NASARI thresh- old to 0.75. Considering example (1) again, Babelfy does not provide a high-confidence disambiguation for the word king, which is then incorrectly disambiguated using the most common sense strategy. However, the error is fixed during the refinement step: our system accurately selects the chess sense of king thanks to its high semantic connec- tion with the disambiguated instances in D \ L. 4. Statistics The output of our disambiguation procedure is a cor- pus of 38 820 114 glosses extracted from BabelNet (corre- sponding to 8 665 300 BabelNet synsets), covering 263 lan- guages and 5 different resources (Wiktionary, WordNet10, Wikidata, Wikipedia11 and OmegaWiki) and including 249 544 708 annotations from the BabelNet sense inventory (6.4 annotations per definition on average). Table 1 reports some general statistics of the complete corpus of disam- biguated textual definitions and for five sample languages: English, Spanish, French, Italian and Persian. The number of disambiguated instances, before and af- ter the refinement step, are displayed in Tables 2 and 3, organized, respectively, by language and Part-of-Speech (PoS). Babelfy and NASARI refer to the instances disam- biguated by the two respective approaches and MCS to the 10Including Open Multilingual WordNet. 11Definitions from Wikipedia include both first sentences of Wikipedia articles and definitions coming from Wikipedia's dis- ambiguation pages. Before refinement After refinement Babelfy MCS Total Babelfy NASARI Total All languages 174 256 335 75 288 373 249 544 708 144 637 032 18 392 099 163 029 131 English 39 096 127 19 724 340 58 820 467 33 260 600 4 680 745 37 941 345 Spanish 9 006 888 5 164 557 14 171 445 7 029 173 1 353 494 8 382 667 French 11 178 328 7 064 210 18 242 538 8 735 298 1 865 920 10 601 218 Italian 8 892 763 4 525 610 13 418 373 7 106 414 1 301 370 8 407 784 Persian 3 766 754 1 524 267 5 291 021 3 085 804 330 917 3 416 721 Table 2: Number of annotations by language (columns) and by type (rows) before and after refinement. Before refinement After refinement Babelfy MCS Total Babelfy NASARI Total All content words 174 256 335 75 288 373 249 544 708 144 637 032 18 392 099 163 029 131 Nouns 158 310 414 56 231 910 214 542 324 140 111 921 18 392 099 158 504 020 Verbs 4 368 488 8 344 930 12 713 418 1 326 947 - 1 326 947 Adjectives Adverbs 930 512 10 646 921 1 455 036 9 256 497 19 903 418 2 385 548 133 748 3 064 416 - - 133 748 3 064 416 Table 3: Number of annotations by Part-of-Speech (PoS) tag (columns) and by type (rows) before and after refinement. instances which were disambiguated using the Most Com- mon Sense (MCS) heuristic. After refinement, 24.7% of the low-confidence noun annotations are fixed using semantic similarity (see Section 3.2.). Assuming the coverage of our first disambiguation step (see Section 3.1.) to be 100%12, the coverage of our system after the refinement step is esti- mated to be 65.3%. As shown in Table 3, discarded anno- tations mostly include verbs, adjectives and adverbs, often harder to disambiguate as they are not directly related to the definiendum. In fact, the coverage of noun instances after refinement is estimated to be 73.9%. 5. Evaluation 5.1. Intrinsic evaluation We first carry out an intrinsic evaluation of the resource, by manually assessing the quality of disambiguation on some randomly extracted samples of definitions. We rely on three human judges and evaluate samples of 100 items for three languages. We evaluated the disambiguation out- put before and after the refinement step, and compared against a baseline where each definition is disambiguated in isolation with Babelfy. Table 4 reports the evaluation on the three sample languages: English, Spanish and Ital- ian. Although the disambiguation of context-free defini- tions improves only slightly with respect to the disambigua- tion of definitions in isolation, this improvement is con- sistent across languages. Furthermore, our system signifi- cantly increases the precision after the refinement step. Re- finement reduces the coverage by 35% for English, and by 43% for Spanish and Italian, but increases precision by al- most 11% for English, 20% for Spanish and 13% for Ital- ian. 12There is no straightforward way to estimate the coverage of a disambiguation system automatically. In our first step using Ba- belfy, we provide disambiguated instances for all content words (including multi-word expressions) from BabelNet and also for overlapping mentions. Therefore the output of our first step, even if not perfectly accurate, may be considered to have full coverage in comparison with our refinement step. Definitions in isolation Context-rich defs. pre-refin. Context-rich defs. post-refin. 74.6 74.7 95.0 English Spanish Italian Prec. Cov. Prec. Cov. Prec. Cov. 100 84.2 100 84.3 95.1 56.8 100 100 64.8 100 100 57.3 77.6 78.0 91.1 Table 4: Disambiguation precision (Prec.) and coverage (Cov.) percentage (%) of the three different disambiguation strategies on the 300 sample definitions. 5.2. Extrinsic evaluation The sense-annotated corpus of definitions is also evalu- ated extrinsically with two experiments. The first experi- ment (Section 5.2.1.) evaluates our corpus before the high- precision refinement, and is focused on DEFIE (Delli Bovi et al., 2015), an Open Information Extraction (OIE) system that works on textual definitions. In its original implemen- tation DEFIE uses Babelfy to disambiguate definitions one- by-one before extracting relation instances. We modified that implementation and used the glosses disambiguated with our approach as input for the system, and we com- pared the extracted information with the information ob- tained by the original implementation. The second experi- ment (Section 5.2.2.), instead, evaluates our refined high- precision corpus, and focuses on the semantic represen- tations of NASARI (Section 3.2.). These representations were constructed based on the BabelNet semantic network. We reimplemented NASARI using the same network en- riched with the high-precision disambiguated glosses and compared these with the original glosses in the sense clus- tering task. 5.2.1. Open Information Extraction In this experiment we investigated the impact of our dis- ambiguation approach on the definitional corpus used as input for the pipeline of DEFIE. The original OIE pipeline of the system takes as input an unstructured corpus of tex- tual definitions, which are then preprocessed one-by-one to extract syntactic dependencies and disambiguate word DEFIE + glosses DEFIE # Glosses 150 146 # Triples 340 318 # Relations 184 171 Table 5: Extractions of DEFIE on the evaluation sample. DEFIE + glosses DEFIE 0.872 0.865 Relation Relation Instances 0.780 0.770 Table 6: Precision of DEFIE on the evaluation sample. senses and entity mentions. After this preprocessing stage, the algorithm constructs a syntactic-semantic graph rep- resentation for each definition, from which subject-verb- object triples (relation instances) are eventually extracted. As highlighted in Section 3.1., poor context of particularly short definitions may introduce disambiguation errors in the preprocessing stage, which then tend to propagate and re- flect on both relations and relation instances. To assess the quality of our disambiguation methodology as compared to a standard approach, we modified the implementation of DEFIE to consider our disambiguated instances instead of executing the original disambiguation step, and then we evaluated the results obtained at the end of the pipeline in terms of quality of relation and relation instances. Experimental setup. We first selected a random sample of 150 textual definitions from our disambiguated corpus (Section 4.). We generated a baseline for the experiment by discarding all disambiguated instances from the sam- ple, and treating the sample itself as an unstructured text of textual definitions which we used as input for DEFIE, letting the original pipeline of the system carry out the dis- ambiguation step. Then we carried out the same procedure using, instead, the modified implementation for which our disambiguated instances are taken into account. In both cases, we ran the extraction algorithm of DEFIE and eval- uated the output in terms of both relations and relation in- stances. Following Delli Bovi et al. (2015), we relied on two human judges and performed the same evaluation pro- cedure described therein over the set of distinct relations extracted from the sample, as well as the set of extracted relation instances. Results. Results reported in Tables 5 and 6 show a slight but consistent improvement resulting from our dis- ambiguated glosses over both the number of extracted re- lations and triples and over the number of glosses with at least one extraction (Table 5), as well as over the estimated precision of such extractions (Table 6). Context-rich dis- ambiguation of glosses across resources and languages en- abled the extraction of 6.5% additional instances from the sample (2.26 extractions on the average from each defini- tion) and, at the same time, increased the estimated preci- sion of relation and relation instances over the sample by ∼1%. 5.2.2. Sense Clustering This experiment focuses on the sense clustering task. Knowledge resources such as Wikipedia or WordNet suf- fer from the high granularity of their sense inventories. A meaningful cluster of senses within these sense inventories would help boost the performance in different applications (Hovy et al., 2013). In this section we will explain how to deal with this issue in Wikipedia. We integrate the high-precision version of the network as enrichment of the BabelNet semantic network in order to improve the results of the state-of-the-art system based on NASARI lexical vectors (more details of NASARI in Section 3.2.). NASARI uses Wikipedia ingoing links and the BabelNet taxonomy in the process of obtaining contex- tual information for a given concept. We simply enrich the BabelNet taxonomy with the high-precision disambiguated glosses (see Section 3.2.) of the target language. The high- precision disambiguated glosses are synsets that are highly semantically connected with the definiendum, which makes them particularly suitable for enriching a semantic network. The rest of the default NASARI lexical pipeline for obtain- ing semantic representations (lexical specificity applied to the contextual information) remains unchanged. By inte- grating the high-precision disambiguated glosses into the NASARI pipeline, we obtain a new set of vector represen- tations for BabelNet synsets, increasing its initial coverage (4.4M synsets covered by the default NASARI compared to 4.6M synsets covered by NASARI enriched with our dis- ambiguated glosses). Experimental setup. We used the two sense clustering datasets created by Dandala et al. (2013). The task in these datasets consists of, given a pair of Wikipedia arti- cles, to decide whether they should be merged into a sin- gle cluster or not. The first dataset (500-pair henceforth) contains 500 pairs of Wikipedia articles, while the sec- ond dataset (SemEval) consists of 925 pairs coming from a set of highly ambiguous words taken from disambigua- tion tasks of SemEval workshops. We follow the original setting of (Camacho-Collados et al., 2015a) and only clus- ter a pair of Wikipedia articles if their similarity, calculated by using the square-rooted Weighted Overlap comparison measure (Pilehvar et al., 2013), surpasses 0.5 (i.e. the mid- dle point in the Weighted Overlap similarity scale). Results. Table 7 shows the results of different systems in the sense clustering task. As a naive baseline we include a system which clusters all pairs. For comparison we also include the Support Vector Machine classifier of Dandala et al. (2013) exploiting information of Wikipedia in four different languages (Dandala-multilingual). Finally, we re- port the results of the default NASARI English lexical vec- tors (NASARI13) and the NASARI-based vectors obtained from the BabelNet semantic network enriched with our high-precision disambiguated glosses (NASARI+glosses). As we can see from Table 7, the enrichment produced by our glosses proved to be highly beneficial, significantly im- proving on the original results obtained by NASARI. More- over, NASARI+glosses obtains the best performance over- all, outperforming Dandala-multilingual in terms of accu- racy in both datasets. 13Downloaded from http://lcl.uniroma1.it/ nasari/ Figure 1: Sample XML output for the definition of castling in WordNet from the complete disambiguated corpus. Figure 2: Sample XML output for the definition of castling in WordNet from the high-precision disambiguated corpus. NASARI+Glosses NASARI Dandala-multilingual Baseline 500-pair Acc. F1 74.8 86.0 81.6 65.4 84.4 28.6 44.5 - SemEval Acc. F1 64.7 88.1 85.7 57.4 85.5 17.5 29.8 - Table 7: Accuracy (Acc.) and F-Measure (F1) percent- ages of different systems on the Wikipedia sense clustering datasets. • anchor: this corresponds to the exact surface form match found within the definition. • bfScore: this corresponds to the Babelfy score. • coherenceScore: this corresponds to the coher- ence score. • nasariScore: this corresponds to the NASARI score (only for the high-precision annotations). 6. Release 7. Conclusion is at The corpus of disambiguated glosses freely available http://lcl.uniroma1.it/ disambiguated-glosses. We released both the complete (Section 3.1.) and the high-precision (Section 3.2.) versions of our corpus. The format for each of the two versions is almost identical: the corpus is first divided by resource (WordNet, Wikipedia, Wiktionary, Wikidata and OmegaWiki) and each resource is then divided by language. The disambiguated glosses for each language and re- source are stored in standard XML files. Figures 1 and 2 show a sample definition as displayed in the XML files of, respectively, the high-precision and complete version of our disambiguated corpus. Each file contains a list of definition tags, with their respective id14 as attribute. Then, each definition tag is composed by the original def- inition as plain text and annotations. The annotation tag refers to the sense-annotations provided as a result of our disambiguation process. Each annotation includes its disambiguated BabelNet id and has four (or five) attributes (see Section 3. for more details about the attributes): • source: this indicates whether the disambiguation has been performed by Babelfy, the Most Common Sense ("MCS") heuristic (only in the complete version of the corpus) or NASARI (only in the high-precision version of the corpus). 14Identifiers depend on the resource, e.g. offsets in WordNet and page titles in Wikipedia. In this paper we presented a large-scale multilingual cor- pus of disambiguated glosses. Disambiguation was per- formed by exploiting cross-resource and cross-language complementarities of textual definitions. By leveraging the structure of a wide-coverage semantic network and sense inventory like BabelNet, we obtained a fully disambiguated corpus of textual definitions coming from multiple sources and multiple languages which, to the best of our knowl- edge, constitutes the largest available corpus of its kind. Additionally, we refined our sense annotations by integrat- ing a module based on semantic similarity into our disam- biguation pipeline, in order to identify a subset of high- precision disambiguated instances across the definitions. This refined version of the corpus has a great potential in high-precision low-coverage applications, where having a disambiguation error as low as possible is the first require- ment. Since the disambiguated instances in this version of the corpus are directly connected to the definiendum, this high-precision disambiguated corpus may also be used to enrich a semantic network, or even used as a semantic net- work on its own. We evaluated our corpus intrinsically on three different languages, showing that our system out- performs previous approaches and a standard state-of-the- art disambiguation system in terms of coverage, precision and recall. We also carried out an extrinsic evaluation that shows some applications of our resource: we integrated the complete and high-precision versions of our corpus into the pipeline of both an Open Information Extraction system and a Sense Clustering system, improving on their original results and obtaining state-of-the-art figures in both tasks. Acknowledgments The authors gratefully acknowledge the support of the ERC Starting Grant Multi- JEDI No. 259234. 8. References Agirre, E. and Soroa, A. (2009). Personalizing PageR- ank for Word Sense Disambiguation. In Proceedings of EACL, pages 33 -- 41. Banerjee, S. and Pedersen, T. (2002). An adapted Lesk al- gorithm for Word Sense Disambiguation using WordNet. In Proceedings of the Third International Conference on Computational Linguistics and Intelligent Text Process- ing, CICLing'02, pages 136 -- 145, Mexico City, Mexico. Benedictis, F. D., Faralli, S., and Navigli, R. (2013). Gloss- Boot: Bootstrapping Multilingual Domain Glossaries from the Web. In Proceedings of ACL, pages 528 -- 538. Camacho-Collados, J., Pilehvar, M. T., and Navigli, R. (2015a). NASARI: a Novel Approach to a Semantically- In Proceedings of Aware Representation of Items. NAACL, pages 567 -- 577. Camacho-Collados, J., Pilehvar, M. T., and Navigli, R. (2015b). A unified multilingual semantic representation of concepts. In Proceedings of ACL (2), pages 741 -- 751, Beijing, China, July. Chen, X., Liu, Z., and Sun, M. (2014). A unified model for word sense representation and disambiguation. In Pro- ceedings of EMNLP, pages 1025 -- 1035, Doha, Qatar. Chen, T., Xu, R., He, Y., and Wang, X. (2015). Improv- ing distributed representation of word sense via word- net gloss composition and context clustering. Proceed- ings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers). Dalvi, B., Minkov, E., Talukdar, P. P., and Cohen, W. W. (2015). Automatic Gloss Finding for a Knowledge Base using Ontological Constraints. In Proceedings of WSDM, pages 369 -- 378. Dandala, B., Hokamp, C., Mihalcea, R., and Bunescu, R. C. (2013). Sense clustering using Wikipedia. In Proceed- ings of Recent Advances in Natural Language Process- ing, pages 164 -- 171, Hissar, Bulgaria. Delli Bovi, C., Telesca, L., and Navigli, R. (2015). Large- Scale Information Extraction from Textual Definitions through Deep Syntactic and Semantic Analysis. Trans- actions of the Association for Computational Linguistics (TACL), 3. Espinosa-Anke, L. and Saggion, H. (2014). Applying Dependency Relations to Definition Extraction. Nat- ural Language Processing and Information Systems, 8455:63 -- 74. Espinosa-Anke, L., Saggion, H., Ronzano, F., and Navigli, R. (2016). ExTaSem! Extending, Taxonomizing and Semantifying Domain Terminologies. In Proceedings of the 30th Conference on Artificial Intelligence (AAAI'16). Fernandez-Ordonez, E., Mihalcea, R., and Hassan, S. (2012). Unsupervised word sense disambiguation with multilingual representations. In LREC, pages 847 -- 851. Flati, T., Vannella, D., Pasini, T., and Navigli, R. (2014). Two is bigger (and better) than one: the Wikipedia Bitax- onomy project. In Proceedings of the 52nd Annual Meet- ing of the Association for Computational Linguistics, pages 945 -- 955, Baltimore, USA. Franco-Salvador, M., Rosso, P., and Montes-y G´omez, M. (2016). A systematic study of knowledge graph analy- sis for cross-language plagiarism detection. Information Processing & Management. Gonz´alez, A., Rigau, G., and Castillo, M. (2012). A graph- based method to improve Wordnet domains. In Proceed- ings of 13th International Conference on Intelligent Text Processing and Computational Linguistics (CICLING), pages 17 -- 28, New Delhi, India. Hill, F., Cho, K., Korhonen, A., and Bengio, Y. (2015). Learning to understand phrases by embedding the dic- tionary. arXiv preprint arXiv:1504.00548. Hovy, E. H., Navigli, R., and Ponzetto, S. P. (2013). Col- laboratively built semi-structured content and Artificial Intelligence: The story so far. Artificial Intelligence, 194:2 -- 27. Khan, M. F., Khan, A., and Khan, K. (2013). Efficient word sense disambiguation technique for sentence level sentiment classification of online reviews. Science Inter- national (Lahore), 25:937 -- 943. Lesk, M. (1986). Automatic sense disambiguation using machine readable dictionaries: How to tell a pine cone from an ice cream cone. In Proceedings of the 5th An- nual Conference on Systems Documentation, Toronto, Ontario, Canada, pages 24 -- 26. Litkowski, K. C. (2004). Senseval-3 task: Word-sense In In Proc. of disambiguation of wordnet glosses. SENSEVAL-3 Workshop on Sense Evaluation, in the 42th Annual Meeting of the Association for Computational Linguistics (ACL 2004. Citeseer. Miller, G. A. and Beckwith, R.T. and Fellbaum, Christiane D. and Gross, D. and Miller, K. (1990). WordNet: an Online Lexical Database. Miller, G. A., Leacock, C., Tengi, R., and Bunker, R. (1993). A semantic concordance. In Proceedings of the 3rd DARPA Workshop on Human Language Technology, pages 303 -- 308. Moldovan, D. and Novischi, A. (2004). Word sense disam- biguation of wordnet glosses. Computer Speech & Lan- guage, 18(3):301 -- 317. Moro, A., Raganato, A., and Navigli, R. (2014). Entity Linking meets Word Sense Disambiguation: a Unified Approach. Transactions of the Association for Compu- tational Linguistics (TACL), 2:231 -- 244. Navigli, R. and Ponzetto, S. P. (2012). BabelNet: The automatic construction, evaluation and application of a wide-coverage multilingual semantic network. Artificial Intelligence, 193:217 -- 250. Navigli, R. and Velardi, P. (2005). Structural Semantic In- terconnections: a knowledge-based approach to Word Sense Disambiguation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 27(7):1075 -- 1088. Navigli, R. and Velardi, P. (2010). Learning Word-Class Lattices for definition and hypernym extraction. In Pro- ceedings of ACL 2010, pages 1318 -- 1327, Uppsala, Swe- den. Navigli, R. (2009). Word Sense Disambiguation: A sur- vey. ACM Computing Surveys, 41(2):1 -- 69. Nivre, J. (2015). Towards a universal grammar for natural language processing. In Computational Linguistics and Intelligent Text Processing, pages 3 -- 16. Springer. Novischi, A. (2002). Accurate semantic annotations via pattern matching. In FLAIRS Conference, pages 375 -- 379. Pilehvar, M. T., Jurgens, D., and Navigli, R. (2013). Align, Disambiguate and Walk: a Unified Approach for Mea- suring Semantic Similarity. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics, pages 1341 -- 1351, Sofia, Bulgaria. Richardson, S. D., Dolan, W. B., and Vanderwende, L. (1998). MindNet: Acquiring and Structuring Semantic Information from Text. In Proceedings of ACL, pages 1098 -- 1102. Toutanova, K., Klein, D., Manning, C. D., and Singer, Y. (2003). Feature-rich part-of-speech tagging with a cyclic dependency network. In Proceedings of the 2003 Con- ference of the North American Chapter of the Associa- tion for Computational Linguistics on Human Language Technology-Volume 1, pages 173 -- 180. Association for Computational Linguistics. Velardi, P., Faralli, S., and Navigli, R. (2013). OntoLearn Reloaded: A Graph-Based Algorithm for Taxonomy In- duction. Computational Linguistics, 39(3):665 -- 707.
1705.07393
2
1705
2017-06-29T14:37:32
Recurrent Additive Networks
[ "cs.CL" ]
We introduce recurrent additive networks (RANs), a new gated RNN which is distinguished by the use of purely additive latent state updates. At every time step, the new state is computed as a gated component-wise sum of the input and the previous state, without any of the non-linearities commonly used in RNN transition dynamics. We formally show that RAN states are weighted sums of the input vectors, and that the gates only contribute to computing the weights of these sums. Despite this relatively simple functional form, experiments demonstrate that RANs perform on par with LSTMs on benchmark language modeling problems. This result shows that many of the non-linear computations in LSTMs and related networks are not essential, at least for the problems we consider, and suggests that the gates are doing more of the computational work than previously understood.
cs.CL
cs
Recurrent Additive Networks Kenton Lee†∗ Omer Levy†∗ Luke Zettlemoyer†‡ †Paul G. Allen School, University of Washington, Seattle, WA ‡Allen Institute for Artificial Intelligence, Seattle, WA {kentonl,omerlevy,lsz}@cs.washington.edu Abstract We introduce recurrent additive networks (RANs), a new gated RNN which is dis- tinguished by the use of purely additive latent state updates. At every time step, the new state is computed as a gated component-wise sum of the input and the previous state, without any of the non-linearities commonly used in RNN tran- sition dynamics. We formally show that RAN states are weighted sums of the input vectors, and that the gates only contribute to computing the weights of these sums. Despite this relatively simple functional form, experiments demonstrate that RANs perform on par with LSTMs on benchmark language modeling problems. This result shows that many of the non-linear computations in LSTMs and related networks are not essential, at least for the problems we consider, and suggests that the gates are doing more of the computational work than previously understood. 1 Introduction such as long recurrent neural networks (GRNNs), Gated short-term memories (LSTMs) (Hochreiter and Schmidhuber, 1997) and gated recurrent units (GRUs) (Cho et al., 2014), have become ubiquitous in natural language processing (NLP). GRNN's widespread popularity is at least in part due to their ability to model crucial language phenomena such as word order (Adi et al., 2017), syntactic structure (Linzen et al., 2016), and even long-range semantic dependencies (He et al., 2017). Like simple recurrent neural networks (S-RNNs) (Elman, 1990), they are able to learn non-linear functions of arbitrary-length input sequences, while at the same time alleviating the problem of vanishing gradients (Bengio et al., 1994) by including gated additive state updates. While GRNNs work well in practice for a wide range of tasks, it is often difficult to interpret what function they have learned. In this paper, we introduce a new GRNN architecture that is much simpler than existing approaches (e.g. fewer parameters and fewer non-linearities) and produces highly interpretable outputs, while matching the robust performance of LSTMs on benchmark language modeling tasks. More specifi- cally, we propose recurrent additive networks (RANs), which are distinguished by their use of purely additive latent state updates. At every time step, the new state is computed as a gated component- wise sum of the input and the previous state. Unlike almost all existing RNNs, non-linearities affect the recurrent state only by controlling the gates at each timestep. One advantage of simplifying the transition dynamics this way is that we can formally characterize the space of functions RANs compute. It is easy to show that the internal state of a RAN at each time step is simply a component-wise weighted sum of the input vectors up to that time. Because all computations are component-wise, RANs can directly select which part of each input element to retain at each time step, leading to a highly expressive yet interpretable model. ∗The first two authors contributed equally to this paper. Despite their relative simplicity, RANs perform as well as LSTMs and related architectures on three language modeling benchmarks, but with far fewer parameters. To better understand this result, we derive the RAN updates from LSTM equations by (1) removing the recurrent non-linearity from ect (LSTM's internal S-RNN) and (2) by removing the output gate. Experiments show that we maintain the same level of performance after both simplifications, suggesting that additive connections, rather than the non-linear transition dynamics, are the driving force behind LSTM's success. 2 Recurrent Additive Networks In this section, we first formally define the RAN model and then show that it represents a relatively simple class of additive functions over the input vectors. 2.1 Model Definition We assume a sequence of input vectors {x1, . . . , xn}, and define a network that produces a sequence of output vectors {h1, . . . , hn}. All recurrences over time are mediated by a sequence of state vectors {c1, . . . , cn}, computed as follows for each time step t: ect = Wcxxt it = σ(Wihht−1 + Wixxt + bi) ft = σ(Wf hht−1 + Wf xxt + bf ) ct = it ◦ ect + ft ◦ ct−1 ht = g(ct) (1) The new state ct is a weighted sum where two gates, it (input) and ft (forget), control the mixing of the content layer ect and the previous state ct−1. The content layer ect is a linear transformation Wx over the input xt, which is useful when the number of input dimensions di is different from the number of hidden dimensions dh (e.g. embedding one-hot vectors). We also include an output layer ht computed with a function g of the internal state ct. In our experiments, we use g(x) = tanh(x) and the identity function g(x) = x. The matrices W∗ and biases b∗ are free trainable parameters. The content layer ect and output function g are presented above to be consistent with other GRNN notation. However, the content layer ect in RANs is very simple and only serves to allow different input vector and state vector dimensions. Similarly, the output function can be the identity, merging ht with ct. When the content and output layers are trivial, the RAN can be reduced to an even simpler form: it = σ(Wicct−1 + Wixxt + bi) ft = σ(Wf cct−1 + Wf xxt + bf ) ct = it ◦ xt + ft ◦ ct−1 (2) h + 4dhdi, but only 2d2 Unlike LSTMs and GRUs, RANs only use additive connections to update the latent state ct. RANs also use relatively fewer parameters. For example, the number of parameters (omitting biases) in an LSTM are 4d2 h + 3dhdi in a RAN. In Section 4, we explore their relationships more closely, showing that RANs are a significantly simplified variation of both LSTMs and GRUs. These simplifications, perhaps surprisingly, perform just as well as LSTMs on language modeling (Section 3). They also lead to a highly interpretable model that can be careful analyzed, as we present in more detail in the rest of this section and in Section 5. 2.2 Analysis Another advantage of the relative simplicity of RANs is that we can formally characterize the space of functions that are used to compute the hidden states ct. In particular, each state is a component- 2 wise weighted sum of the input with the form: ct = it ◦ xt + ft ◦ ct−1 (cid:16)ij ◦ tY k=j+1 fk(cid:17) ◦ xj wt j ◦ xj (3) = = j=1 tX tX j=1 when considering the simpler RAN described in equation set (2).2 Each weight wt j is a product of the input gate ij (when its respective input xj was read) and every subsequent forget gate fk. An interesting property of these weights is that, like the gates, they are also soft component-wise binary filters. This also produces a highly interpretable model, where each component of each state can be directly traced back to the inputs that contributed the most to its sum. 3 Language Modeling Experiments We compare the RANs' performance to LSTMs on three benchmark language modeling tasks. For each dataset, we use previously reported hyperparameter settings that were tuned for LSTMs in order to ensure a fair comparison (Section 3.1). Our experiments show that RANs perform on par with LSTMs on all three benchmarks (Section 3.2). The code and settings to replicate these experiments is publicly available.3 3.1 Experiment Setup Penn TreeBank The Penn Treebank (PTB) (Marcus et al., 1993) is a popular language-modeling benchmark, containing approximately 1M tokens over a vocabulary of 10K words. We used the implementation of Zaremba et al. (2014) while replacing any invocation of LSTMs with RANs. We tested two configurations: medium, which uses two layers of 650-dimension RANs, and large, which uses two layers of 1500-dimension RANs. Word embedding size is set to match the recurrent lay- ers' size, and dropout (Srivastava et al., 2014) is used throughout the network. Both settings use stochastic gradient descent (SGD) to optimize the model, each with a unique hyperparameter setting to gradually decrease the learning rate.4 Billion-Word Benchmark Google's billion-word benchmark (BWB) (Chelba et al., 2014) is about a thousand times larger than PTB, and uses a more diverse vocabulary of 800K words. Using the implementation of Józefowicz et al. (2016), we tested the LSTM-2048-512 configuration, which uses a single-layered LSTM of 2048 hidden dimensions and a word embedding space of 512 dimen- sions. In our experiments, the LSTM was replaced with a RAN, while reusing exactly the same hyperparameters (dimensions, dropout, learning rates, etc) that were originally tuned for LSTMs by Jozefowicz et al. Following their implementation, we project the hidden state at each time step down to 512 dimensions. Due to the enormous size of this dataset, we stopped training after 5 epochs. Text8 We also evaluated on a character-based language modeling benchmark, Text8.5 This dataset is made of the first 100M characters in English Wikipedia after some filtering process. The vocab- ulary contains only 27 characters (lowercase a–z and space). We adapted the implementation of Zilly et al. (2017) by taking hyperparameter settings from Chung et al. (2017), which had an LSTM- like architecture. Their setting used 128-dimension character embeddings, followed by 3 LSTM layers of 1024, 1024, and 2048 dimensions respectively, which we adapted to RANs of the same dimensions. We present only tanh RANs for this benchmark because identity RANs were unstable with these hyperparameters. 2The state is also a linear function of the inputs in the more general form (equation set (1)). However, it is a weighted sum of linearly transformed inputs, instead of a weighted sum of the input vectors themselves. 3http://www.github.com/kentonl/ran 4The only modifications we made from the original setting was to use lower initial learning rates to improve stability. Exact values are provided in the code. 5http://mattmahoney.net/dc/textdata 3 Configuration Model Perplexity # RNN Parameters Medium Large LSTM (Zaremba et al., 2014) tanh RAN identity RAN LSTM (Zaremba et al., 2014) tanh RAN identity RAN 82.7 81.9 85.5 78.4 78.5 83.2 6.77M 4.23M 4.23M 36.02M 22.52M 22.52M Table 1: The performance of RAN and LSTM on the Penn TreeBank (PTB) benchmark, measured by perplexity. We also display the number of RNN parameters for comparison. Model Perplexity # RNN Parameters LSTM (Józefowicz et al., 2016) tanh RAN identity RAN 47.5 47.9 47.2 9.46M 6.30M 6.30M Table 2: The performance of RAN and LSTM on Google's billion-word benchmark (BWB), mea- sured by perplexity after 5 epochs. We also display the number of RNN parameters for comparison. 3.2 Results We first compare the performance of RANs to that of LSTMs on the word-based language modeling benchmarks, PTB (Table 1) and BWB (Table 2). In all configurations, the change in performance is below 1% relative difference between LSTMs and tanh RANs. It appears that despite using less than two-thirds the parameters, RANs can perform on par with LSTMs. The BWB result is particularly interesting, because it demonstrates RANs' ability to to leverage big data like LSTMs. Perhaps an even more remarkable result is the fact that identity RANs – which, excluding the gates, compute a linear function of the input – are also performing comparably to LSTMs on the BWB. This observation begs the question: how is it possible that a simple weighted sum performs just as well as an LSTM? In Section 4, we show that LSTMs (and similarly GRUs) are implicitly computing some form of component-wise weighted sum as well, and that this computation is key to their success. Finally, we compare the performance of RANs to a variety of LSTM variants on the character-based language modeling task Text8 (Table 3). While the different results vary both in model and in hyperparameters, the same trend in which RANs perform similarly to LSTMs emerges yet again. 4 The Role of Recurrent Additive Networks in Long Short-Term Memory The need for LSTMs is typically motivated by the fact that they can ease the vanishing gradient prob- lem found in simple RNNs (S-RNNs) (Bengio et al., 1994; Hochreiter and Schmidhuber, 1997). By introducing cell states that are controlled by a set of gates, LSTMs enable shortcuts through which gradients can flow easily when learning with backpropagation. This mechanism enables learning of long-distance dependencies while preserving the expressive power of recurrent non-linearities provided by S-RNNs. Rather than viewing the gating mechanism as simply an auxiliary mechanism to address a learning problem, we present an alternate of view of LSTMs that emphasizes the modeling strengths of the gates. We argue that it is possible to reinterpret LSTMs as a hybrid of two other recurrent architec- tures: (1) S-RNNs and (2) RANs. More specifically, LSTMs can be seen as computing a content layer using an S-RNN, which is then aggregated into a weighted sum using a RAN (Section 4.1). To better understand this composition, we show how a RAN can be derived by simplifying an LSTM (Section 4.2) or a GRU (Section 4.3). Given our empirical observations in Section 3, which show that RANs perform comparably with LSTMs, it appears that the recurrent non-linearity provided by S-RNN is not required for language modeling, and that the RAN is in fact performing the heavy lifting. 4 Model td-LSTM (Zhang et al., 2016) MI-LSTM (Wu et al., 2016) mLSTM (Krause et al., 2017) tanh RAN BatchNorm LSTM (Cooijmans et al., 2017) LayerNorm HM-LSTM (Chung et al., 2017) RHN (Zilly et al., 2017) BPC 1.49 1.44 1.40 1.38 1.36 1.29 1.27 Table 3: The performance of RAN and recently-published LSTM variants on the Text8 character- based language modeling benchmark, measured by bits per character (BPC). 4.1 LSTM as a Hybrid of S-RNN and RAN We first demonstrate the two sub-components of LSTM by dissecting its definition: ect = tanh(Wchht−1 + Wcxxt + bc) it = σ(Wihht−1 + Wixxt + bi) ft = σ(Wf hht−1 + Wf xxt + bf ) ot = σ(Wohht−1 + Woxxt + bo) ct = it ◦ ect + ft ◦ ct−1 ht = ot ◦ tanh(ct) (4) state ct behaves like a RAN, using input and forget gates to compute a weighted sum of the current We refer to ect as the content layer, which like S-RNNs is a non-linear recurrent layer. The cell content layer ect and the previous cell state ct−1. In fact, just as in RANs, we can express each cell state as a component-wise weighted sum of the all previous content layers: ct = it ◦ ect + ft ◦ ct−1 (cid:16)ij ◦ tY k=j+1 fk(cid:17) ◦ ecj = = j=0 tX tX j=0 wt j ◦ ecj However, unlike RANs, the content layer ecj depends on both the current input and the previous state cell state. Therefore, LSTMs cannot express the cell state as a weighted sum of the input vectors. 4.2 Deriving RAN from LSTM To derive an RAN from LSTM's equations, we perform two steps: (1) simplify the output layer by removing the output gate, and (2) simplify the content layer using only a linear projection of the input. Simplifying the Output Layer the output non-linearity tanh with g: In the first step, we simply remove the output gate, and abstract ect = tanh(Wchht−1 + Wcxxt + bc) it = σ(Wihht−1 + Wixxt + bi) ft = σ(Wf hht−1 + Wf xxt + bf ) ct = it ◦ ect + ft ◦ ct−1 ht = g(ct) This step follows previous architectural ablations of LSTM (Józefowicz et al., 2015; Greff et al., 2016), which demonstrated that removing the output gate has limited effects. 5 Simplifying the Content Layer We proceed to remove the embedded S-RNN from the LSTM vector ht−1. Specifically, we replace the original content layer with a simple linear projection of the by eliminating the non-linearity of the content layer ect and its dependence on the previous output input vector ect = Wxxt, resulting in the RAN architecture: ect = Wcxxt it = σ(Wihht−1 + Wixxt + bi) ft = σ(Wf hht−1 + Wf xxt + bf ) ct = it ◦ ect + ft ◦ ct−1 ht = g(ct) This step emphasizes the most significant difference between RANs and other RNNs. The fact that removing the embedded S-RNN does not harm performance on our benchmarks in any significant way suggests that it is perhaps unnecessary, and that the gating mechanism has sufficient modeling capacity of its own for language modeling. 4.3 Deriving RAN from GRU A similar analysis can be applied to other gated RNNs such as GRUs, which are typically defined as follows: zt = σ(Wzhht−1 + Wzxxt + bz) rt = σ(Wrhht−1 + Wrxxt + br) (5) eht = tanh(Whh(r ◦ ht−1) + Whxxt + bh) ht = zt ◦eht + (1 − zt) ◦ ht−1 For ease of discussion, we present the following non-standard but equivalent form of GRUs, which aligns better with the notation from LSTMs and RANs: ect = tanh(Wchht−1 + Wcxxt + bc) it = σ(Wicct−1 + Wixxt + bi) ot = σ(Wocct−1 + Woxxt + bo) ct = it ◦ ect + (1 − it) ◦ ct−1 ht = ot ◦ ct (6) In this form, the content layer ect is equivalent to eht. The input gate it is equivalent to zt, and the output gate ot is equivalent to the reset gate rt. In this form, the output vector at each time step is ct. A subtle detail that enables this transformation is that GRUs can be seen as maintaining separate cell and output states, similar to LSTMs. However, GRUs compute the content layer with respect to the previous hidden state ht−1 rather than the previous output ct−1. In our alternate form, it is clear that GRUs also accumulate weighted summations ct of previous content layers ect. The derivation of RAN from here involves two straightforward steps. First, the non-linear recurrence of the content layer ect is replaced by a simple linear projection ect = Wcxxt, as we did for LSTMs. This step also makes ht redundant. Second, we repurpose the output gate ot as a forget gate by applying it to the previous cell state ct−1 rather than the current cell state ct: This step results in a RAN with an identity output function g: ct = it ◦ ect + ot ◦ ct−1 ect = Wcxxt it = σ(Wicct−1 + Wixxt + bi) ot = σ(Wocct−1 + Woxxt + bo) An interesting effect of the coupled gates in GRU is that these weights are normalized, i.e. the weights over all previous time steps sum to 1. As a result, GRUs are computing weighted averages rather than weighted sums of their content layer. In development experiments, we found that this ct = it ◦ ect + ot ◦ ct−1 6 An earthquake struck northern California killing more than 50 people He sits down at the piano and plays Conservative party fails to secure a majority resulting in a hung parliament Figure 1: Partial visualizations of the weights in the weighted sum computed by an RAN (wt j in equation set (3)). The arrows indicate for each word t which previous word has the highest weighted component (vt in equation (7)). normalization hurt performance if added to the RAN architecture. However, it is closely related to another architecture that computes weighted averages: attention (Bahdanau et al., 2015). In fact, we can consider a GRU as a component-wise attention mechanism over its previous content layers and a RAN to be an unnormalized component-wise generalization of attention, which can point to many different possible inputs independently. 5 Weight Visualization Given the relative interpretability of the RAN predictions, we can trace the importance of each component in each of the previous elements explicitly, as shown in equation set (3). In language modeling, we can also compute which previous word had the overall strongest influence in predicting the next word at time step t: vt = t−1 argmax j=1 (cid:0) dhmax m=1 (wt j(m))(cid:1) (7) In Figure 1, we visualize this computation by drawing arrows from each word t to its most influential predecessor (i.e. the previous word with the highest weighted component). In these four example sentences, we see that RANs can recover long distance dependencies that make intuitive sense given the syntactic and semantic structure of the text. For example, verbs are related to their arguments, even when coordinated, and nouns in relative clauses depend on the noun they are modifying. This illustration provides only a glimpse into what the model is capturing, and perhaps future, more detailed visualizations that take the individual components into account can provide further insight into what RANs are learning in practice. 6 Related Work Many variants of LSTMs (Hochreiter and Schmidhuber, 1997) and alternative designs for more gen- eral GRNNs have been proposed. One such variant adds peephole connections between the cell state and the gates (Gers and Schmidhuber, 2000). GRUs (Cho et al., 2014) decrease the num- ber of parameters by coupling the input and forget gates and rewiring the gate computations (see Section 4.3 for an alternative formulation). Greff et al. (2016) conducted an LSTM ablation study that probed the importance of each component independently, while others (Józefowicz et al., 2015; Zoph and Le, 2017) took an automatic approach to the task of architecture design, finding additional variants of GRNNs. While we demonstrate that RANs can be seen as an ablation of LSTMs or 7 GRUs, they are vastly simpler than the variants explored in the aforementioned studies. Specifically, this is the first study to remove the recurrent non-linearity (the embedded simple RNN) from such models. Concurrently, Lei et al. (2017) arrived at a similar space of models as RANs by deriving recurrent neural networks from string kernels, which they call kernel neural networks (KNNs). Our studies complement each other in two ways. First, Lei et al. show the connection between RANs/KNNs and kernels, while we show the connection to LSTMs and GRUs. Second, we conduct somewhat different experiments; we compare RANs to LSTMs in standard settings that were tuned for LSTMs, while Lei et al. show that RANs can achieve state-of-the-art performance when the network's design is more flexible and can be fitted with the latest advances in language modeling. Several approaches represent sequences as weighted sums of their elements. Perhaps the most pop- ular mechanism in NLP is attention (Bahdanau et al., 2015), which assigns a normalized scalar weight to each element (typically a word vector) as a function of its compatibility with an exter- nal element. The ability to inspect attention weights has driven the use of more interpretable neural models. Self-attention (Cheng et al., 2016; Parikh et al., 2016) extends this notion by computing intra-sequence attention. Vaswani et al. (2017) further showed that state-of-the-art machine transla- tion can be achieved using only self-attention, without the use of recurrent non-linearities found in LSTMs. Recently, Arora et al. (2017) proposed a theory-driven approach to assign scalar weights to elements in a bag of words. While these methods assign scalar weights to each input explicitly, RANs implicitly compute a component-wise weighted sum as a byproduct of a simple RNN state scheme. 7 Conclusion We introduced recurrent additive networks (RANs), a type of gated RNNs that performs purely additive updates to its latent state. While RANs do not include the non-linear recurrent connections that are typically considered to be crucial for RNNs, they have remarkably similar performance to LSTMs on several language modeling benchmarks. RANs are also considerably more transparent than other RNNs; their limited use of non-linearities enables the state vector to be expressed as a component-wise weighted sum of previous input vectors. This also allows the individual impact of the sequence inputs on the state to be recovered explicitly, directly pointing to which factors are most influencing each part of the current state. This work also sheds light on the inner workings of existing, more opaque models, primarily LSTMs and GRUs. We demonstrate that RAN-like components exist within LSTMs and GRUs. Further- more, we provide empirical evidence that the use of recurrent non-linearities within those architec- tures is perhaps unnecessary for language modeling. While we demonstrate the robustness of RANs on several language modeling benchmarks, it is an open question whether these findings will generalize across a wider variety of tasks. However, the results do suggest that it may be possible to develop related, relatively simple, additive gated RNNs that are better building blocks for a wide range of different neural architectures. We hope that our findings prove helpful in the design of future recurrent neural networks. Acknowledgements The research was supported in part by DARPA under the DEFT program (FA8750-13-2-0019), the ARO (W911NF-16-1-0121), the NSF (IIS-1252835, IIS-1562364), gifts from Google, Tencent, and Nvidia, and an Allen Distinguished Investigator Award. We also thank Yoav Goldberg, Benjamin Heinzerling, Tao Lei, Luheng He, Aaron Jaech, Ariel Holtzman, and the UW NLP group for helpful conversations and comments on the work. References Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In ICLR, 2017. Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. In ICLR, 2017. 8 Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. Yoshua Bengio, Patrice Y. Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, 1994. Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, and Phillipp Koehn. One In INTER- billion word benchmark for measuring progress in statistical language modeling. SPEECH, 2014. Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine In Proceedings of the 2016 Conference on Empirical Methods in Natural Language reading. Processing, pages 551–561, Austin, Texas, November 2016. Association for Computational Lin- guistics. URL https://aclweb.org/anthology/D16-1053. Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724–1734, Doha, Qatar, October 2014. Associa- tion for Computational Linguistics. URL http://www.aclweb.org/anthology/D14-1179. Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural net- works. In ICLR, 2017. Tim Cooijmans, Nicolas Ballas, César Laurent, and Aaron C. Courville. Recurrent batch normaliza- tion. In ICLR, 2017. Jeffrey L. Elman. Finding structure in time. Cognitive Science, 14:179–211, 1990. Felix A. Gers and Jürgen Schmidhuber. Recurrent nets that time and count. In IJCNN, 2000. Klaus Greff, Rupesh K Srivastava, Jan Koutník, Bas R Steunebrink, and Jürgen Schmidhuber. Lstm: A search space odyssey. IEEE Transactions on Neural Networks and Learning Systems, 2016. Luheng He, Kenton Lee, Mike Lewis, and Luke Zettlemoyer. Deep semantic role labeling: What works and what's next. In Proceedings of the Annual Meeting of the Association for Computa- tional Linguistics, 2017. Sepp Hochreiter and Jürgen Schmidhuber. Long Short-term Memory. Neural computation, 9(8): 1735–1780, 1997. Rafal Józefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In ICML, 2015. Rafal Józefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. Ben Krause, Iain Murray, Steve Renals, and Liang Lu. Multiplicative LSTM for sequence modelling. In ICLR Workshop, 2017. Tao Lei, Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Deriving neural architectures from sequence and graph kernels. In ICML, 2017. Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntax- sensitive dependencies. TACL, 4:521–535, 2016. Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. Computational Linguistics, 19:313–330, 1993. Ankur Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. In Proceedings of the 2016 Conference on Empirical Meth- ods in Natural Language Processing, pages 2249–2255, Austin, Texas, November 2016. Associ- ation for Computational Linguistics. URL https://aclweb.org/anthology/D16-1244. Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. 9 Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan Salakhutdinov. On multi- plicative integration with recurrent neural networks. In NIPS, 2016. Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. Saizheng Zhang, Yuhuai Wu, Tong Che, Zhouhan Lin, Roland Memisevic, Ruslan Salakhutdinov, and Yoshua Bengio. Architectural complexity measures of recurrent neural networks. In NIPS, 2016. Julian G. Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. In ICLR, 2017. Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2017. 10 T               hh  hh T               hh  hh T               hh  hh T               hh  hh T               hh  hh T               hh  hh
1803.02710
1
1803
2018-03-07T15:18:03
Generating Contradictory, Neutral, and Entailing Sentences
[ "cs.CL", "cs.AI" ]
Learning distributed sentence representations remains an interesting problem in the field of Natural Language Processing (NLP). We want to learn a model that approximates the conditional latent space over the representations of a logical antecedent of the given statement. In our paper, we propose an approach to generating sentences, conditioned on an input sentence and a logical inference label. We do this by modeling the different possibilities for the output sentence as a distribution over the latent representation, which we train using an adversarial objective. We evaluate the model using two state-of-the-art models for the Recognizing Textual Entailment (RTE) task, and measure the BLEU scores against the actual sentences as a probe for the diversity of sentences produced by our model. The experiment results show that, given our framework, we have clear ways to improve the quality and diversity of generated sentences.
cs.CL
cs
Generating Contradictory, Neutral, and Entailing Sentences Yikang Shen * 1 Shawn Tan * 1 Chin-Wei Huang * 1 Aaron Courville 1 8 1 0 2 r a M 7 ] L C . s c [ 1 v 0 1 7 2 0 . 3 0 8 1 : v i X r a Abstract Learning distributed sentence representations re- mains an interesting problem in the field of Natu- ral Language Processing (NLP). We want to learn a model that approximates the conditional latent space over the representations of a logical an- tecedent of the given statement. In our paper, we propose an approach to generating sentences, conditioned on an input sentence and a logical inference label. We do this by modeling the dif- ferent possibilities for the output sentence as a distribution over the latent representation, which we train using an adversarial objective. We eval- uate the model using two state-of-the-art models for the Recognizing Textual Entailment (RTE) task, and measure the BLEU scores against the actual sentences as a probe for the diversity of sen- tences produced by our model. The experiment results show that, given our framework, we have clear ways to improve the quality and diversity of generated sentences. 1. Introduction Algorithms designed to learn distributed sentence represen- tations have been shown to be transferable across a range of tasks (Mou et al., 2016) and languages (Tiedemann, 2018). For example, Guu et al. (2017) proposed to represent sen- tences as vectors that encode a notion similarity between sentence pairs, and showed that vector manipulations of the representation can result in meaningful change in semantics. The question we would like to explore is whether the seman- tic relationship between sentence pairs can be modeled in a more explicit manner. More specifically, we want to model the logical relationship between sentences. Controlling the logical relationship between sentences has many direct applications. First of all, we can use it to pro- vide a more clear definition of paraphrasing. To do so, we *Equal contribution 1Department of Computation, Universit´e de Montr´eal, Montr´eal, Canada. Correspondence to: Yikang Shen <[email protected]>, Shawn Tan <[email protected]>, Chin- Wei Huang <[email protected]>. require two simultaneous conditions: (i) that the input sen- tence entails the output sentence; and (ii) that the output sentence entails the input sentence. (SENTENCE1 = SENTENCE2)∧ (SENTENCE2 = SENTENCE1) (1) The first requirement ensures the output sentence cannot be false if the input sentence is true, so that the output sentence can be considered a fact expressed by the input sentence. The second requirement ensures that the output contains at least the input's information. The two requirements to- gether can be used to define semantic equivalence between sentence. Another interesting application is multi-document summa- rization. Traditionally, to summarize multiple documents, one would expect the model to abstract the most important part of the source documents, and this is usually measured by the amount of overlap that the output document has with the inputs. Informally, one finds the maximal amount of information that has the highest precision with each source document. Alternatively, if one wants to automate news aggregation, the ideal summary would need to contain the same number of facts as are contained in the union of all source documents. We can think of this second objective as requiring that the output document entail every single sentence across all source documents. In this paper, we propose an approach to generating sen- tences, conditioned on an input sentence and a logical infer- ence label. We do this by modeling the different possibilities for the output sentence as a distribution over the latent rep- resentation, which we train using an adversarial objective. In particular, we differ from the usual adversarial train- ing on text by using a differentiable global representation. Architecture-wise, we also propose a Memory Operation Selection Module (MOSM) for encoding a sentence into a vector representation. Finally, we evaluate the quality and the diversity of our samples. The rest of the paper is organized as follows: Sec. 2 will cover the related literature. Sec. 3 will detail the proposed model architecture, and Sec. 4 will describe and analyze the experiments run. Sec. 5 will then discuss the implications of being able to solve this task well, and the future research directions relating to this work. Finally, we conclude in Sec. Generating Contradictory, Neutral, and Entailing Sentences 6. 2. Related Work Many natural language tasks require reasoning capabiliities. The Recognising Textual Entailment (RTE) task requires the system to determine if the premise and hypothesis pair are (i) an entailment, (ii) contradicting each other or (iii) neutral to each other. The Natural language Inference (NLI) Task from Bowman et al. (2015a) introduces a large dataset with labeled pairs of sentences and their corresponding logical relationship. This dataset allows us to quantify how well current systems are able to be trained to recognise sentences with those relationships. Examples of the current state-of- the-art for this task include Chen et al. (2017) and Gong et al. (2017). Here we are interested in generating natural language that satisfies the given textual entailment class. Kolesnyk et al. (2016) has attempted this using only sentences from the entailment class, and focusing on generating a hypothesis given the premise. Going in this direction results in removal of information from the premise sentence. In this paper, we focus on going in the other direciton: generating a premise from a hypothesis. This requires adding additional details to the premise which have to make sense in context. In order to produce sentences with extra details and without some other details, we suggest that a natural way to model this kind of structure is to impose a distribution over an intermediate distribution representing the semantic space of the premise sentence. In the realm of learning representations for sentences, Kiros et al. (2015) has a popular method for learning representa- tions called "skip-thought" vectors. These are trained by using the encoded sentence to predict the previous and next sentence in a passage. Conneau et al. (2017) specifically learned sentence representations from the SNLI dataset. They claim that using the supervised data from SNLI can outperform "skip-thought" representations on different tasks. There have also been several efforts towards learning a dis- tribution over sentence embeddings. Bowman et al. (2015b) used Variational Autoencoders (VAEs) to learn Gaussian distributed word embeddings. Hu et al. (2017) use a com- bined VAE/GAN objective to produce a disentangled rep- resentation that can be used to modify some attributes like sentiment and tense. There have also been forays into conditional distributions for sentences – which is what is required here. Both Gupta et al. (2017) and Guu et al. (2017) introduce models of the form p(xz, x(cid:48)), where x is a paraphrase of x(cid:48), and z repre- sents the variability in the output sentence. Guu et al. (2017) introduces z as an edit vector. However, because z has to be paired with x(cid:48) in order to generate the sentence, z serves a z φ η (cid:96) Figure 1. The conceptual graphical model behind the formulation of our model. The red arrow represents the inference path from φ to z. very different purpose, and cannot be considered a sentence embedding in its own right. Ideally, what we want is a dis- tribution over sentence representations, each one mapping to a set of semantically similar sentences. This is important if we want the distribution to model the possibilities of con- cepts that correspond to the right textual entailment with the hypothesis. 3. Method Some approaches map a sentence to a distribution in the embedding space (Bowman et al., 2015b). The assumption when doing this is that there is some uncertainty over the latent space when mapping from the sentence. Some ap- proaches, like Hu et al. (2017) attempt to disentangle factors in the learnt latent variable space, so that modifying each dimension in the latent representation modifies sentiment or tense in the original sentence. If we consider plausible premise sentences φ given a hy- pothesis η and an inference label (cid:96), there are many possi- ble solutions, of varying likelihoods. We can model this probabilistically as p(φη, (cid:96)). In our model, we assume an underlying latent variable z that accounts for the variation in possible output sentences, (cid:90) p(φη, (cid:96)) = p(φz)p(zη, (cid:96))dz Another assumption we make is that given φ, z is indepen- dent of η and (cid:96). The resulting graphical model associated with the above dependency assumptions are depicted in Figure 1. In our proposed model, we take inspiration from the Ad- versarial Autoencoder (Makhzani et al., 2015), however our prior is conditioned on η and (cid:96). Zhang et al. (2017) also proposed a Conditional Adversarial Autoencoder for age progression prediction. In addition to the adversarial discriminator, our model includes a classifier on the repre- sentation and the hypothesis and label. A similar framework is also discussed in Salimans et al. (2016). Generating Contradictory, Neutral, and Entailing Sentences Prior We draw a sample, conditioned on (η, (cid:96)), through the prior, which is described using following equations: hη 1 , ..., hηη = RNNenc(xη 1 , ..., xηη) (7) Figure 2. The architecture of the model. The autoencoder maps given premise φ to a sentence representation z, and reconstructs φ from z. Samples are drawn from the prior conditioned on η and (cid:96). The classifier takes z and η as input, and outputs probability of l. The discriminator takes z, η and l as input, and predicts whether z is given by the autoencoder or the prior. 3.1. Architecture The model consists of an encoder q(zφ), a conditional prior, p(zη, (cid:96)), a decoder p(φz), and a discriminator D(z, η, (cid:96)). Autoencoder The autoencoder comprises of two parts. An encoder that maps the given premise φ to a sentence representation z, and a decoder that reconstructs φ from a given z. In our model, the encoder reads the input premise φ = (xφ 1 , ..., xφφ) using an RNN network: hφ 1 , ..., hφφ = RNNenc(xφ 1 , ..., xφφ) (2) and p(x(cid:48) tx(cid:48) (4) 1 , ..., hφφ) z = fcompress(hφ (3) where ht ∈ Rn is a hidden state at time t. z is a vector generated from sequence of the hidden states. We will call fcompress(·) the compression function. The decoder is trained to predict the next word x(cid:48) t given the sentence representation z and all the previously pre- dicted words (x(cid:48) t−1). With an RNN, the conditional probability distribution of x(cid:48) 1, ..., x(cid:48) t−1, z) = g(st, ct) t is modeled as: 1, ..., x(cid:48) and 1, ..., x(cid:48) s1, ..., sφ = RNNdec(x(cid:48) φ) ct = fretrieve(z, st) (5) (6) where g(·) is a nonlinear, potentially multi-layered, function that outputs the probability of x(cid:48) t, st is the hidden state of decoder RNN, and fretrieval takes st as the key to retrieve related information from z. We note that other architectures such as a CNN or a transformer (Vaswani et al., 2017) can be used in place of the RNN. The details of the compression function and retrieval function will be discussed in Sec. 3.2. t , e(cid:96), ]) ht = MLP([hη h1, ..., hη = RNNrefine(h1, ..., hη) z = fcompress(h1, ..., hη) (8) (9) (10) where  is a random vector, i ∼ N (0, 1); e(cid:96) is the label embedding and [·,·] represents the concatenation of input vectors. Classifier This outputs the probability distribution over labels, taking as input the tuple (z, η), and is described using the following equations: t , ct,hη t − ct, hη 1 , ..., xηη) 1 , ..., hηη = RNNenc(xη hη ct = fretrieve(z, hη t ) ht = MLP([hη h1, ..., hη = RNNrefine(h1, ..., hη) hmax = Poolingmax(h1, ..., hη) hmean = Poolingmean(h1, ..., hη) p((cid:96)z, η) = σ(MLP([hmax, hmean])) (11) (12) t (cid:12) ct])(13) (14) (15) (16) (17) where Pooling(·) refers to an element-wise pooling oper- ator, and the activation function σ for output layer is the softmax function. The architecture of the classifier is in- spired by (Chen et al., 2017). Instead of doing attention over the sequence of hidden states for the premise, we use the retrieval function in Equation 12 to retrieve related informa- tion ct in z for hη t . Discriminator The discriminator takes as input (z, η, (cid:96)), and tries to determine if the z in question comes from the encoder or prior. The architecture of the discriminator is similar to that of the classifier, with the exception that Equa- tion 13 is replaced by: t , ct, e(cid:96)]) ht = MLP([hη (18) to pass label information to the discriminator. The sigmoid function is used as the activation for the output layer. In our model the autoencoder, prior and classifier share the same RNNenc(·) parameters. The prior and the autoencoder share the same fcompress(·) parameters. The classifier and the autoencoder share the same fretrieve(·) parameters. The discriminator does not share any parameters with the rest of model. 3.2. Compression and Retrieval Functions The compression (Equation 3) and retrieval (Equation 6) functions can be modeled through many different mecha- nisms. Here, we introduce two different methods: Generating Contradictory, Neutral, and Entailing Sentences Retrieval functions use {st} as control vectors to retrieve information from z. Since the layer generates a different weight matrix for the feedforward path for different st, we can output different o for the same z. 3.3. Model Learning Like most adversarial networks, the conditional adversarial autoencoder is trained with a gradient descent based method in two phases: the generative phase and the discriminative phase. In the generative phase, the autoencoder is updated to mini- mize the reconstruction error of the premise. The classifier and the encoder are updated to minimize the classification error of the premise-hypothesis pair. The prior is also up- dated to optimize the classification error of p((cid:96)z, η), where z is draw from the prior. The encoder and the prior are updated to confuse the discriminator. In our initial experiments, we found that the samples from just the adversarial training alone results in wildly varied output sentences. To ameliorate this, we propose an auxil- iary loss: i∈(1,...,N ) {NLL(φzi)} , Lauxiliary = min zi ∼ p(zη, (cid:96)) (26) where N is the number of samples that are drawn from prior. The auxiliary loss measures how far our generated premises are from the true premise when conditioned on the hypothesis and label. As shown in experiment the model has better generating diversity, while more samples were drawn during training. One can view this auxiliary loss as a 'hard' version of tak- ing the log average of the probability of N Monte-Carlo samples, zi ∼ p(zη, (cid:96)) − log Ep(zη,(cid:96)) [p(φz)] p(φzi), ≈ − log N(cid:88) 1 N N(cid:88) i − log = − log ≤ − log 1 N 1 N exp log p(φzi) i + min i∈(1,...,N ) − log p(φzi) (27) (28) (29) (30) N is a constant, minimizing over the Equation 30 Since log 1 is the same as minimizing Equation 26. In the discriminative phase, the discriminator is updated to tell apart the true z (generated using the prior) from the generated samples (given by autoencoder). Figure 3. Memory Operation Selection Module takes a pair of vec- tor (k, v) as input, output a vector o. k provide the control signal for the layer to compute a weighted sum of candidate weight matri- ces. The obtained matrix is used as the weight matrix in a normal feedforward layer, that takes v as input and outputs o. Mean Pooling the hidden states: can be used to compress the sequence of fcompress(h1, ..., hT ) = 1 T ht (19) and its retrieve counterpart directly returns z: fretrieve(z, st) = z (20) Memory Operation Selection Module (MOSM) As an alternative to mean pooling, we use the architecture shown in Figure 3. A layer is defined as: T(cid:88) t=1 γ = softmax(Ωk) NW(cid:88) W = γiWi i=1 o = σ( Wv) (21) (22) (23) (cid:33) (cid:32) T(cid:88) t=1 1 T where σ can be any activation function, v is the input vector, k is the control vector, {Wi} are NW candidate weight matrices. For convenience, we denote the MOSM function as fMOSM(v, k). Thus, we can define the MOSM compression method as: fcompress(h1, ..., hT ) = tanh fMOSM (ht, ht) (24) The compression function uses {ht} as both control and input vector, to write themselves into z. Because different hts select different combinations of candidate matrices, we can have different mapping function each different ht at each time step. fretrieve(z, st) = fMOSM(z, st) (25) Generating Contradictory, Neutral, and Entailing Sentences 4. Experiments We use the Stanford Natural Language Inference (SNLI) corpus (Bowman et al., 2015a) to train and evaluate our models. From our experiments, we want to determine two things. First, do the sentences produced by the model form the correct textual entailment class on which it was condi- tioned on? Second, is there diversity among the sentences that are generated? 4.1. Baseline Methods For comparison, we use a normal RNN encoder-decoder as a baseline method. The model uses a bidirectional LSTM network as encoder. The encoder reads the input hypothesis into a sequence of hidden states {ht}: 1 , .., hηη = RNNenc(xη hη zη = fcompress(hη (31) (32) Where fcompress(·) can be the mean method or an MOSM. The distributed representation of label e(cid:96) and zη are concate- nated together to feed into a normal MLP network, which output the sentence representation z: 1 , .., xηη) 1 , .., hηη) z = MLP([zη, e(cid:96)]) (33) The decoder compute the conditional probability distribu- tion with equations: tx(cid:48) st = RNNdec(x(cid:48) t−1) = g([st, z]) t−1, st−1) (34) (35) p(x(cid:48) 1, ..., x(cid:48) Thus, the baseline model share a similar architecture with prior and decoder in our model, while the randomness been toke out. 4.2. Experiment Settings For all models, RNNenc and RNNrefine are 2-layers bi- directional LSTM (Hochreiter & Schmidhuber, 1997), RNNdec are 2-layers uni-directional LSTM. The dimen- sion of hidden state, embeddings and latent representation z are 300. When training, optimization is performed with Adam using learning rate lr = 0.001, β1 = 0, β2 = 0.999 and σ = 10−8. We carry out gradient clipping with maxi- mum norm 1.0. We train each model for 30 epoch. For each iteration, we randomly choose to run the generative phase or discriminative phase with probability 0.5 : 0.5. Since we didn't observe significant benefit from using Beam Search, all premises are generated using greedy search. 4.3. Quality Evaluation In order to evaluate the quality of the samples from our model, we trained two state-of-the-art models for SNLI: (1) Table 1. Classification accuracies for different state-of-the-art mod- els on our samples. The row labeled RANDOM we randomly per- muted the premises of the original test set and ran them through the classifiers to test for the models' reliance on just the hypothesis for classification. MODEL RANDOM BASELINE (MEAN) BASELINE (MOSM) DIIN ESIM 42.7% 41.1% 59.6% 59.6% 62.7% 62.6% MOSM (N=1, -CLASSIFIER) MOSM (-AUXILIARY LOSS) 67.2% 67.3% 63.2% 60.6% MEAN (N=1) MEAN (N=10) MOSM (N=1) MOSM (N=10) 64.4% 62.4% 64.3% 62.3% 76.1% 75.9% 72.6% 71.8% Densely Interactive Inference Network (DIIN)1 (Gong et al., 2017), (2) Enhanced Sequential Inference Model (ESIM)2 (Chen et al., 2017). In our experiments, we found that it is possible to achieve an accuracy of 68% on SNLI label prediction by training a classifier using only the hypothesis as input. This calls into question how much the classification models rely on just the hypothesis for performing its task. To investigate this phenomena further, we randomly permuted the premises of the original test set and passed these new (random) permis- hypothesis pairs to the classifiers. The results are shown in the row labelled RANDOM in Table 1. We were satisfied that at 42.7% and 41.1%, the classification models (both DIIN and ESIM) were not relying entirely on the hypothesis for prediction. We sampled 9845 hypotheses from the test set, and produced φ for each example with the given (cid:96). The (η, φ, (cid:96)) triplet was then passed to the classifiers and evaluated for accuracy. Both classification models perform at ∼88% accuracy, but, while they were not perfect, they provided a good probe for how well our models were generating the required sentences. Table 1 shows the accuracy of prediction on the respective models. Both the DIIN and ESIM models give similar results. Our results show that using the MOSM gives an improve- ment over just taking the mean. Using the adversarial train- ing also results in some gains, which suggests that training the model with the 'awareness' of the distribution over the representation space results in better quality samples. Us- 1https://github.com/YichenGong/Densely-Interactive- Inference-Network 2https://github.com/lukecq1231/nli Generating Contradictory, Neutral, and Entailing Sentences Table 2. The confusion matrix for the samples from the best model MOSM (N = 1) LABEL \PRED. ENT. NEUT. CONT. ENTAILMENT NEUTRAL CONTRADICTION 67.8% 20.9% 11.4% 6.6% 76.7% 16.7% 2.9% 12.8% 84.4% ing the adversarial training in conjunction with the MOSM layer gives us the model with the best performance. We also performed ablation tests, removing certain components of the model from the training to see how it affects the quality of samples. The difference between our best model against MOSM (N = 1, -CLASSIFIER) suggests that the classifier plays in important role in ensuring z is a representation in the right class. In our experiment removing the auxiliary loss, we still achieve an accuracy ∼61%. However, look- ing at the samples for this iteration of the model, while having some concepts in common with the hypothesis, the sentences in general are more nonsensical in comparison to those trained with the auxiliary loss (See an example in Figure 6). The confusion matrix produced when evaluating our best model (MOSM, N = 1) on DIIN shows us where the classification model and our generative model agree (See Table 2). In our RANDOM experiments, we find that the model has a bias towards predicting contradictions. This is observed here as well, with contradictions being the category with the highest agreement. We therefore cannot conclude that contradictions are easier for our model to generate. Also, using the original test set, the category in which DIIN performs the best is entailment, with a precision of 89.1% compared to 84.3% for neutral and 88.4% for contradiction. This suggests that generating suitable premises that entail the hypothesis is the hardest task for the model. We also want to study how the classifier component of our model affects the generation of good samples. As shown in Figure 4, "Z precision" is higher then 0.9. This suggests that the classifier provides a strong regularization signal to the sentence representation z. Because the autoencoder is not perfect, we do not observe the the same sample clas- sification precision after z is decoded. However, we still observe a synchronous improvement of both sample and valid precision. It is therefore reasonable to expect that a better classifier and a better autoencoder would result in better generated premises. 4.4. Diversity Evaluation In order to evaluate the diversity of samples given by our model, we compute the BLEU score between to premises Figure 4. Different classification precisions given by our classifier in our model (MOSM, N=10) during training. Sample Precision shows the probability that classifier predicts correct label for gen- erated premise and related real hypothesis. Valid precision shows the probability that classifier predicts correct label for real premise and real hypothesis. Z precision shows the probability that the feedforward network fclassifier(z, zη) predicts correct label (cid:96), for given η, (cid:96) and z drawn from prior p(zη, (cid:96)). generated conditioned on the same hypothesis and label. In other words, given a triple (φi, ηi, (cid:96)i) from test set, we draw two different samples (zi1, zi2) from the prior distribu- tion p(zηi, (cid:96)i). Then the decoder generates two premises (φi1, φi2) using greedy search conditioned on (zi1, zi2) re- spectively. The similarity score between generated premises is then estimated by: BLEUi = 1 2 (BLEU(zi1, zi2) + BLEU(zi2, zi1)) . (36) For comparison, we also compute the BLEU score between real premise and generated premise (φi, φi1). The average of diversity score between two generated premises is noted as BLEUSS, the one between real and generated premises is noted as BLEURS. Since it is not necessary have n-gram match between premises, BLEU score can be inaccurate on some data points. We employ the Smoothing technique 2 described in Chen & Cherry (2014). As shown in Table 3, when we increase the number of samples N in the auxiliary loss, the diversity of samples increases for both mean pooling and MOSM. This can serve as empirical evidence that the diversity of our model can be controlled by choosing a different hyper-parameter N. The higher BLEURS given by MOSM method could be interpreted as real premise is more close to the center of mass of prior distribution. We also observe a gap between BLEURS and BLEUSS. The gap shows that the sampled premise is still relatively similar between themselves. After Generating Contradictory, Neutral, and Entailing Sentences Table 3. BLEU score for different models SAMPLES FROM MOSM (N=10) MODEL BLEURS BLEUSS BASELINE (MEAN) BASELINE (MOSM) MOSM (N=1, -CLASSIFIER) MOSM (-AUXILIARY LOSS) MEAN (N=1) MEAN (N=10) MOSM (N=1) MOSM (N=10) 14.4 14.7 14.4 10.3 11.9 11.3 14.2 13.2 N/A N/A 46.7 14.8 27.9 17.3 38.9 22.5 H: a worker stands over a bread display . L: Entailment S1: a man in a blue shirt is preparing food in a kitchen . S2: a man in a blue shirt is washing a window . H: there is a jockey riding a horse . L: Entailment S1: a horse rider on a bucking horse . S2: a jockey riding a horse in a rodeo . H: a man sitting on the couch reading a book . L: Contradiction S1: a man is sitting on a bench with his hands in his pockets . S2: a man in a blue shirt is standing in front of a store . H: a baby in his stroller outside . L: Contradiction S1: a woman is sitting on a bench next to a baby . S2: a woman is sitting on a bench in a park . H: the man is being watched . L: Neutral S1: a man jumps from a bridge for an elderly couple at a beach . S2: a man in a blue shirt is standing in front of a building . H: there is a human selling hot dogs . L: Neutral S1: a person is standing in front of a food cart . S2: a woman in a white shirt is standing in front of a counter selling food . SAMPLES FROM MOSM (-AUXILIARY LOSS) H: a restaurant prepares for a busy day . L: Neutral S1: a pink teenager prepares on a tune on the roots . S2: a UNK restaurant dryer for a canvas . Figure 5. Visualization of the effect of auxiliary loss with multiple samples. For a pair of (φ, η), we repeat 100 times the process of compute auxiliary loss (N=10) in Equation 26. Blue points represent zi selected by minimum function, green points represent zi that are not selected. Our model (MOSM, N=10) is used for computing z and perplexities. t-SNE is used to visualize high- dimensional data (Maaten & Hinton, 2008). removing the classifier, we observe an increase in BLEUSS. One possible explanation is that classifier prevents the prior from overfitting the training data. We observe an decrease in both BLEU scores, after removing the auxiliary loss. How- ever, Table 1 and Figure 6 shows that removing auxiliary loss give low quality samples. While the auxiliary loss is essential for the prior and the decoder to learn to cooperate, using an auxiliary loss where (N = 1) will collapse the prior distribution; instead of a distribution, the prior will learn to ignore the random input and deterministically predict z. As shown in Figure 5, the auxiliary loss (N = 10) only passes gradients to the zs in the left region of the distribution. As a result, samples drawn from right region have a significant lower chance receive gradient from decoder, while the entire region receives gra- Figure 6. Example sentence generated by our model (MOSM, N=10). H is the hypothesis, L is the label, S1 is the first sample, and S2 is the second sample. The samples shown below the line are drawn from a model trained without the auxiliary loss. dients from the discriminator and classifier. Therefore, the prior distribution can expand to more regions, but only those regulated by discriminator and classifier. This will increase the diversity of samples. However, we also observe that the precision slightly decreases in Table 1. This suggests that the discriminator and classifier in our model are not perfect for regularizing the prior distribution. 4.5. Samples Figure 6 shows several examples generated by our model (MOSM, N=10). These example shows that our model can generate a variety of different premise while keep the correct semantic relation. Some of subjects in hypothesis are correctly replace by synonyms (e.g. "jocky" is replaced by "horse rider", "human" is replaced by "person" and "woman"). The model also get some potential logical rela- tion correct (e.g. "reading a book" is contradicted by "with Generating Contradictory, Neutral, and Entailing Sentences his hands in his pockets", "stands over a bread display" can either means "washing a window" or "preparing food in a kitchen"). However, we also observe that the model tries to add "a blue shirt" for most "man"s in the sentences, which is one of the easiest way to add extra information into the model. The phenomenon aligned with well-known model collapse fail- ure case for most adversarial training based method. This observation give an explanation for the relatively higher BLEU between sample. The model also have some bias while generating premise (e.g. when hypothesis mention "a baby", the premise automatically mention "a woman"), which aligns with the recent discovery that visual recogni- tion tasks model tend to output biased predictions (Zhao et al., 2017). 5. Discussion The broader vision of our project is to attain logical control for language, which we believe will allow us to perform bet- ter across many natural language applications. This is most easily achieved at the word-level, by adding or removing specific words to a sentence, using word generation rules based on language-specific grammars. However, just as distributed word representations can be meaningfully com- bined (Mikolov et al., 2013) with good outcomes, we believe that sentence-level representations are the way forward for manipulation of text. The kind of control we seek to model, specifically, is charac- terized by the logical relationships between sentence pairs. Controlling semantic representation by modeling logical relationship between the input and output sentences has many potential use cases. Returning to the task of multi- document summarization discussed in the introduction, op- erating in the semantic space allows one to abstract the information of a document. Controlling the logical relation- ships among sentences provides a new way to think about what a summary is. Ideally, when multiple sources of in- formation are given, we would like the output summary φ generated by a machine to be entailable by the union of inputs (∪j∈J ηj) = φ 3. This addresses the problem of precision: the resulting summary now has a subset of the in- formation available in the union of all the given hypotheses. To address the problem of recall, we need the resulting summary to entail each one of the individual hypotheses: ∧i(φ = ηj) Together, these two criteria form a clear formal definition for multi-document summarization, { φ : ∧i(φ = ηj) ∧ (∪j∈J ηj) = φ} which represents the set of all possible φ that fit the criteria. In our paper, we toyed with the possibility of modeling the set { φ : φ = η } by training a model with a distribution over different premises in the latent space z. A good subse- quent step would be modelling the first part of our logical description of multi-document summarisation, { φ : ∧i∈J (φ = ηj)} = ∩i∈J { φ : φ = ηj } This suggests a possible avenue for producing such a premise is finding the intersection of the distribution over z for two given hypotheses that are likely enough to occur. Future work can explore the possibility of this and determin- ing the union of the hypotheses entailing the given premise. 6. Conclusion We have proposed a model that generates premises from hypotheses with an intermediate latent space, which we in- terpret as different possible premises for a given hypothesis. This was trained using a Conditional Adversarial Autoen- coder. This paper also proposed the Memory Operation Selection Module for encoding sentences to a distributed representation that uses attention over different operations in order to encode the input. The model was evaluated for quality and diversity. In terms of quality, we used two state- of-the-art models for the RTE task on SNLI, and the samples generated by our best model were able to achieve an accu- racy of 76.1%. For diversity, we compared the BLEU scores between the real premises and the generated premises, and the BLEU scores between the generated premises. In this re- gard, while our model is able to generate different premises for each hypothesis, there is still a gap between when com- pared to the similarities to the real premises. Looking at the samples, we note that the additional details that our model generates tend to repeat, and correspond to some type of mode collapse. The task of performing reasoning well with natural lan- guage still remains a challenging problem. Our experiments demonstrate that while we can generate sentences with the logical entailment properties we desire, there is still much to be done in this direction. We hope with the new lens on some NLP tasks as natural language manipulation with logical control, new perspectives and methods will emerge to improve the field. References Bowman, Samuel R., Angeli, Gabor, Potts, Christopher, and Manning, Christopher D. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Compu- tational Linguistics, 2015a. 3Here we assume there are no conflicting details. Bowman, Samuel R, Vilnis, Luke, Vinyals, Oriol, Dai, An- Generating Contradictory, Neutral, and Entailing Sentences Mikolov, Tomas, Sutskever, Ilya, Chen, Kai, Corrado, Greg S, and Dean, Jeff. Distributed representations of In Ad- words and phrases and their compositionality. vances in neural information processing systems, 2013. Mou, Lili, Meng, Zhao, Yan, Rui, Li, Ge, Xu, Yan, Zhang, Lu, and Jin, Zhi. How transferable are neural networks in nlp applications? arXiv preprint arXiv:1603.06111, 2016. Salimans, Tim, Goodfellow, Ian, Zaremba, Wojciech, Che- ung, Vicki, Radford, Alec, and Chen, Xi. Improved techniques for training gans. In Advances in Neural In- formation Processing Systems, 2016. Tiedemann, Jrg. Emerging language spaces learned from massively multilingual corpora. arXiv preprint arXiv:1802.00273, 2018. Vaswani, Ashish, Shazeer, Noam, Parmar, Niki, Uszkoreit, Jakob, Jones, Llion, Gomez, Aidan N, Kaiser, Łukasz, and Polosukhin, Illia. Attention is all you need. In Ad- vances in Neural Information Processing Systems, 2017. Zhang, Zhifei, Song, Yang, and Qi, Hairong. Age progres- sion/regression by conditional adversarial autoencoder. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2017. Zhao, Jieyu, Wang, Tianlu, Yatskar, Mark, Ordonez, Vi- cente, and Chang, Kai-Wei. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. arXiv preprint arXiv:1707.09457, 2017. drew M, Jozefowicz, Rafal, and Bengio, Samy. Gener- ating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015b. Chen, Boxing and Cherry, Colin. A systematic comparison of smoothing techniques for sentence-level bleu. In Pro- ceedings of the Ninth Workshop on Statistical Machine Translation, 2014. Chen, Qian, Zhu, Xiaodan, Ling, Zhen-Hua, Wei, Si, Jiang, Hui, and Inkpen, Diana. Enhanced lstm for natural lan- guage inference. In Proceedings of the 55th Annual Meet- ing of the Association for Computational Linguistics (Vol- ume 1: Long Papers), volume 1, 2017. Conneau, Alexis, Kiela, Douwe, Schwenk, Holger, Bar- rault, Loic, and Bordes, Antoine. Supervised learning of universal sentence representations from natural language inference data. arXiv preprint arXiv:1705.02364, 2017. Gong, Yichen, Luo, Heng, and Zhang, Jian. Natural lan- guage inference over interaction space. arXiv preprint arXiv:1709.04348, 2017. Gupta, Ankush, Agarwal, Arvind, Singh, Prawaan, and Rai, Piyush. A deep generative framework for paraphrase generation. arXiv preprint arXiv:1709.05074, 2017. Guu, Kelvin, Hashimoto, Tatsunori B, Oren, Yonatan, and Liang, Percy. Generating sentences by editing prototypes. arXiv preprint arXiv:1709.08878, 2017. Hochreiter, Sepp and Schmidhuber, Jurgen. Long short-term memory. Neural computation, 1997. Hu, Zhiting, Yang, Zichao, Liang, Xiaodan, Salakhutdinov, Ruslan, and Xing, Eric P. Toward controlled generation of text. In International Conference on Machine Learning, 2017. Kiros, Ryan, Zhu, Yukun, Salakhutdinov, Ruslan R, Zemel, Richard, Urtasun, Raquel, Torralba, Antonio, and Fidler, In Advances in neural Sanja. Skip-thought vectors. information processing systems, 2015. Kolesnyk, Vladyslav, Rocktaschel, Tim, and Riedel, Sebas- tian. Generating natural language inference chains. arXiv preprint arXiv:1606.01404, 2016. Maaten, Laurens van der and Hinton, Geoffrey. Visualizing data using t-sne. Journal of machine learning research, 2008. Makhzani, Alireza, Shlens, Jonathon, Jaitly, Navdeep, Goodfellow, Ian, and Frey, Brendan. Adversarial au- toencoders. arXiv preprint arXiv:1511.05644, 2015.
1802.00757
2
1802
2018-07-08T16:27:47
Submodularity-Inspired Data Selection for Goal-Oriented Chatbot Training Based on Sentence Embeddings
[ "cs.CL" ]
Spoken language understanding (SLU) systems, such as goal-oriented chatbots or personal assistants, rely on an initial natural language understanding (NLU) module to determine the intent and to extract the relevant information from the user queries they take as input. SLU systems usually help users to solve problems in relatively narrow domains and require a large amount of in-domain training data. This leads to significant data availability issues that inhibit the development of successful systems. To alleviate this problem, we propose a technique of data selection in the low-data regime that enables us to train with fewer labeled sentences, thus smaller labelling costs. We propose a submodularity-inspired data ranking function, the ratio-penalty marginal gain, for selecting data points to label based only on the information extracted from the textual embedding space. We show that the distances in the embedding space are a viable source of information that can be used for data selection. Our method outperforms two known active learning techniques and enables cost-efficient training of the NLU unit. Moreover, our proposed selection technique does not need the model to be retrained in between the selection steps, making it time efficient as well.
cs.CL
cs
Submodularity-Inspired Data Selection for Goal-Oriented Chatbot Training Based on Sentence Embeddings Mladen Dimovski1, Claudiu Musat2, Vladimir Ilievski1, Andreea Hossmann2, Michael Baeriswyl2 1 School of Computer and Communication Sciences, EPFL, Switzerland 2 Artificial Intelligence Group - Swisscom AG firstname.lastname@{epfl.ch, swisscom.com} 8 1 0 2 l u J 8 ] L C . s c [ 2 v 7 5 7 0 0 . 2 0 8 1 : v i X r a Abstract Spoken language understanding (SLU) systems, such as goal-oriented chatbots or personal assis- tants, rely on an initial natural language under- standing (NLU) module to determine the intent and to extract the relevant information from the user queries they take as input. SLU systems usually help users to solve problems in relatively narrow domains and require a large amount of in-domain training data. This leads to significant data avail- ability issues that inhibit the development of suc- cessful systems. To alleviate this problem, we pro- pose a technique of data selection in the low-data regime that enables us to train with fewer labeled sentences, thus smaller labelling costs. We propose a submodularity-inspired data rank- ing function, the ratio-penalty marginal gain, for selecting data points to label based only on the information extracted from the textual embedding space. We show that the distances in the embedding space are a viable source of information that can be used for data selection. Our method outperforms two known active learning techniques and enables cost-efficient training of the NLU unit. Moreover, our proposed selection technique does not need the model to be retrained in between the selection steps, making it time efficient as well. 1 Introduction In their most useful form, goal-oriented dialogue systems need to understand the user's need in great detail. A typ- ical way of structuring this understanding is the separation of intents and slots that can be seen as parameters of the in- tents. Slot filling, also known as entity extraction, is find- ing the relevant information in a user query that is needed for its further processing by the SLU system. For exam- ple, in a restaurant reservation scenario, given the sentence Are there any French restaurants in downtown Toronto? as an input, the task is to correctly output, or fill, the following slots: {cuisine: French} and {location: downtown Toronto}. The slot filling task is usually seen as a sequence tagging problem where the goal is to tag each relevant word token with the corresponding slot name using the B–I–O (Begin, Inside, Outside) convention. The table below shows how we would correctly tag the previous example sentence. Are O restaurants O there O in O any O downtown B-Location French B-Cuisine Toronto I-Location Most methods created for slot filling are supervised and require large amounts of labeled in-domain sentences in order to perform well. However, it is usually the case that only very little or no training data is available. Annotating new sentences is an expensive process that requires considerable human effort and, as a result, achieving good performance with as little data as possible becomes an important concern. Our solution to the data availability problem relies on a better way of selecting the training samples to be labeled. If a limited amount of resources are available, we want to en- able the user to spend them in the most efficient way. More precisely, we propose a method for ranking the unlabeled sen- tences according to their utility. We measure the latter with the help of a ranking function that satisfies the principles of submodularity, a concept known to capture the intuition present in data selection. We run experiments on three differ- ent publicly available slot filling datasets: the MIT Restau- rant, the MIT Movie and the ATIS datasets [Liu et al., 2013a; Liu et al., 2013b]. We are interested in measuring the model's performance when it is trained with only a few dozen labeled sentences, a situation we refer to as low-data regime. We compare our proposed selection method to several standard baselines, including two variants of active learning. We identify our three main contributions: • We show that the space of raw, unlabeled sentences con- tains information that we can use to choose the sentences to label. • We create a submodularity-inspired ranking function for selecting the potentially most useful sentences to label. • We apply this data selection method to the problem of slot filling and prove that the model's performance can be considerably better when the training samples are chosen in an intelligent way. In Section 3, we provide some background and details about the novel data selection technique. In Section 4, we describe the datasets used in our experiments and the base- lines that we use as a comparison reference point. Finally, in Section 5, we present and discuss the obtained results. 2 Related Work 2.1 Slot Filling Numerous models have been proposed to tackle the slot fill- ing task, of which a comprehensive review was written by [Mesnil et al., 2015]. However, the most successful methods that have emerged are neural network architectures and, in particular, recurrent neural network schemes based on word embeddings [Kurata et al., 2016; Ma and Hovy, 2016; Liu and Lane, 2016; Zhang and Wang, 2016; Zhu and Yu, 2017; Zhai et al., 2017]. The number of proposed model variants in the recent literature is abundant, with architectures ranging from encoder-decoder models [Kurata et al., 2016], models tying the slot filling problem with the closely related intent detection task [Zhang and Wang, 2016] and even models that use the attention mechanism [Liu and Lane, 2016], originally introduced in [Bahdanau et al., 2014]. The final model that we adopted in our study is a bi-directional LSTM network that uses character-sensitive word embeddings, together with a fully-connected dense and linear CRF layer on top [Huang et al., 2015; Lample et al., 2016]. We provide the model's specifications and more details in the appendix. 2.2 Low-Data Regime Challenges Typically, machine learning models work reasonably well when trained with a sufficient amount of data: for example, reported results for the popular ATIS domain benchmark go beyond 95% F1 score [Liu and Lane, 2016; Zhang and Wang, 2016]. However, performance significantly degrades when little amount of training data is available, which is a common scenario when a new domain of user queries is introduced. There are two major approaches used to handle the challenges presented by the scarcity of training data: • The first strategy is to train a multi-task model whose purpose is to deliver better performance on the new do- main by using patterns learned from other closely related domains for which sufficient training data exists [Jaech et al., 2016; Hakkani-Tur et al., 2016] • The second strategy is to select the few training instances that we can afford to label. One well known approach are the active learning strategies [Fu et al., 2013; Angeli et al., 2014] that identify data points that are close to the separation manifold of an imperfectly trained model. In our work, we focus on the latter scenario, as experience has shown that high-quality in-domain data is difficult to re- place by using other techniques. Therefore, we assume that we can choose the sentences we want to label and the main question is how to make this choice in a way that would yield the model's best performance. 3 Data Selection 3.1 Submodularity and Rankings Let V be a ground set of elements and F : 2V → R a func- tion that assigns a real value to each subset of V . F is called submodular if the incremental benefit of adding an el- ement to a set diminishes as the context in which it is con- sidered grows. Formally, let X and Y be subsets of V , with X ⊆ Y ⊆ V . Then, F is submodular if for every e ∈ V \ Y , F (eY ) ≤ F (eX) where F (eA) = F ({e} ∪ A) − F (A) is the benefit, or the marginal gain of adding the element e to the set A. The concept of submodularity captures the idea of diminishing returns that is inherently present in data selection for training machine learning models. In the case of the slot filling problem, the ground set V is the set of all available unlabeled sentences in a dataset and the value F (X) for a set X ⊆ V is a score measuring the utility of the sentences in X. Submodular functions have already been successfully used in document summarization [Lin and Bilmes, 2011; Lin and Bilmes, 2012], and in various tasks of data sub- set selection [Kirchhoff and Bilmes, 2014; Wei et al., 2014; Wei et al., 2015]. However, to the best of our knowledge, they have not yet been studied in the slot filling context. An important hypothesis that is made when submodular functions are used for data selection is that if X and Y are two sets of data points for which F (X) ≤ F (Y ), then us- ing Y for training would give an overall better performance than using X. If we have a predefined size for our training set, i.e., a maximum number of samples that we can afford to label, then we would need to find the set X that maximizes F (X) with a constraint on X. Cardinality-constrained sub- modular function maximization is an NP-hard problem and we usually have to resort to greedy maximization techniques (see [Krause and Golovin, 2014]). If the function is mono- tone, then the greedy solution, in which we iteratively add the element with the largest marginal gain with respect to the already chosen ones, gives a (1 − 1/e)-approximation guar- antee [Nemhauser et al., 1978]. As a byproduct, this greedy procedure also produces a ranking of the n = V sentences, i.e., outputs a ranking permutation π : [n] → [n] that poten- tially orders them according to their usefulness. Therefore, a monotone submodular function F naturally defines a selec- tion criteria πF that is the order in which the elements are chosen with the greedy optimization procedure. In our work, we explore different data selection criteria, without limiting ourselves to properly defined submodular functions. 3.2 Sentence Similarity Unless we perform the selection of the sentences to label based on some intrinsic attributes such as their length, an im- portant metric we need to define is the similarity between a pair of sentences. The need to introduce such a mea- sure of similarity appeared simultaneously with the devel- opment of active learning techniques for text classification. For example, in [McCallum et al., 1998], the similarity be- tween two documents x and y, their analogue to our sen- tences, is measured by an exponentiated Kullback-Leibler divergence between the word occurrence empirical mea- sures P(W = wx) and λP(W = wy) + (1 − λ)P(W = w) (cid:1) (cid:19)−1 (1) (2) where λ is a smoothing parameter. In the recent literature, however, the focus has shifted to using word or sentence em- beddings as a basis for almost all tasks involving text pro- cessing. The continuous (Euclidean) space embeddings have become fundamental building blocks for almost all state-of- the-art NLP applications. In our study, we use a recently developed technique of producing sentence embeddings, sent2vec [Pagliardini et al., 2017]. The sent2vec method produces continu- ous sentence representations that we use to define the sim- ilarity. More precisely, for every sentence s ∈ V , the sent2vec algorithm outputs a 700-dimensional vector em- bedding e(s) ∈ R700 that we in turn use to define the similar- ity between a pair of sentences x and y as follows: sim(x, y) = exp(cid:0) − β(cid:107)e(x) − e(y)(cid:107)2 (cid:18) where β = (cid:88) 1 V (V − 1) u∈V,w∈V (cid:107)e(u) − e(w)(cid:107)2 is a scaling constant, measuring the concentration of the cloud of points in the space. It is the inverse of the average distance between all pairs of embeddings. Note that β will in gen- eral depend on the dataset, but it is not a hyper-parameter that needs to be tuned. Finally, the exponential function con- denses the similarity to be in the interval [0, 1] as β > 0. For a fixed sentence s, the most similar candidates are those whose embedding vectors are the closest to e(s) in the embedding space. Tables 1 and 2 present two example sen- tences (shown in bold), one from the MIT Restaurant and an- other from the MIT Movie dataset, together with their closest neighbors. Based on the numerous examples that we ana- lyzed, it appears that the closeness in the embedding space is in line with the human perception of sentence similarity. Therefore, selecting a particular sentence for training should largely diminish the usefulness of its closest neighbors. A 2-dimensional t-SNE projection of the cloud of points of the MIT Movie domain, together with an isolated example cluster, is shown on Figure 1. The large black triangle in the cluster is an example sentence and the darker dots are its clos- est neighbors. Closeness is measured in a 700-dimensional space and distances are not exactly preserved under the 2- dimensional t-SNE projection portrayed here. The cluster shown on Figure 1 corresponds to the sentences in Table 2. 3.3 Coverage Score Once we have defined a similarity metric between sentences, it can be used in the definition of various submodular func- tions. An important example is the coverage score function Figure 1: A 2-dimensional t-SNE projection of the cloud of points representing the embeddings of the sentences of the MIT Movie do- main. The overlapping plot gives a closer view of the small cluster at the bottom left; the corresponding sentences are shown in Table 2 that evaluates every subset of sentences X in the following way [Lin and Bilmes, 2011]: C(X) = sim(x, y). (3) (cid:88) (cid:88) x∈X y∈V Intuitively, the inner sum measures the total similarity of the sentence x to the whole dataset; it is a score of how well x covers V . The marginal gain of a sentence s is given by C(sX) = C({s} ∪ X) − C(X) = sim(s, y). (4) (cid:88) y∈V It can be easily seen that the marginal gain C(sX) does not depend on X, but only on s itself. This makes the function C, strictly speaking, modular. The cardinality-constrained greedy optimization procedure for C would, in this case, out- put the optimal solution. Table 3 presents the top three cov- erage score sentences from the MIT Restaurant dataset, and Figure 2 shows that these points tend to be centrally posi- tioned in the cloud. The coverage score function suffers from that it only con- siders how much a sentence is useful in general, and not in the context of the other sentences in the set. Hence, it might whats a cheap mexican restaurant here we are looking for a cheap mexican restaurant i am looking for a cheap mexican restaurant is ixtapa mexican restaurant considered cheap what was the movie that featured over the rainbow find me the movie with the song over the rainbow what movie was the song somewhere out there featured in what movie features the song hakuna matata Table 1: An example sentence s from the MIT Restaurant domain and the sentences corresponding to the three closest points to e(s) Table 2: An example sentence s from the MIT Movie domain and the sentences corresponding to the three closest points to e(s) The top three sentences with highest coverage score 1. i need to find somewhere to eat something close by im really hungry can you see if theres any buffet style restaurants within five miles of my location 2. i am trying to find a restaurant nearby that is casual and you can sit outside to eat somewhere that has good appetizers and food that is a light lunch 3. street one that doesnt have a dress code i need to find a restaurant that serves sushi near 5 th Table 3: The top three coverage score sentences from the MIT Restaurant domain Domain MIT Restaurant MIT Movie ATIS #train 7661 9776 4978 #test 1522 2444 893 #slots 17 25 127 F1 score 80.11 87.86 95.51 Table 4: The three domains and their basic information (number of training samples, number of samples in the test set and number of different slots). The MIT Restaurant and MIT Movie datasets contain user queries about restaurant and movie information. The Airline Travel Information Services (ATIS) dataset mainly contains questions about flight booking and transport information that, for example, F (a∅) + F (b{a}) (cid:54)= F (b∅) + F (a{b}), which already makes the definition of F ({a, b}) ambiguous. Nevertheless, the above expression (6) satisfies the submodu- larity condition by being decreasing in X. Figure 2: The position of the top forty points in the 2-dimensional t-SNE projection of the cloud corresponding to the MIT Restaurant dataset according to two different rankings pick candidates that cover much of the space, but could be very similar to each other. In order to deal with this prob- lem, an additional penalty or diversity reward term is usually introduced and the marginal gain takes the form of D(sX) = sim(s, y) − α sim(s, x) (5) (cid:88) x∈X (cid:88) y∈V where α is a parameter that measures the trade-off between the coverage of s and its similarity to the set of already chosen sentences X. The additional term makes the function D sub- modular as D(sX) is decreasing in X. However, D features an additional parameter that needs to be tuned and moreover, experiments with both C and D (see Figure 6 in the results section) yielded mediocre results. In the next section, we in- troduce our new selection method that features a non-linear penalization and does not have any additional parameters. 3.4 Ratio-Penalty Marginal Gain We propose a direct definition of a marginal gain of an ele- ment with respect to a set. This is an alternative to providing a submodular function for which we derive the marginal gain expression and then use it to find the maximizing set of a given size. We then use this marginal gain to rank and select the sentences that are likely the most valuable for labeling. We call it the ratio-penalty marginal gain and define it as: F (sX) = y∈V sim(s, y) x∈X sim(s, x) . (6) We cannot uniquely define a submodular function that gen- erates the ratio-penalty marginal gain. To see this, notice (cid:80) 1 +(cid:80) The ratio-penalty marginal gain is again a trade-off be- tween the coverage score of a sentence and its similarity to those already chosen. An important change is that the penalty is introduced by division, instead of by subtraction as in D(sX) from the previous section. To gain more intu- ition, notice that, as the logarithm function is increasing, the induced ranking πF is the same as the ranking π F produced by F (sX), where we define F (sX) = log F (sX), i.e., F (sX) = log sim(s, y) − log 1 + sim(s, x) . (7) In summary, we start with the Euclidean distance between the embeddings of the sentences, we re-scale it by dividing it by the average distance 1/β and squash it exponentially. This defines our similarity metric. Then, we do an aggregate computation in this new space by summing the similarities, and we revert to the original scale by taking the logarithm. (cid:88) y∈V (cid:18) (cid:88) x∈X (cid:19) 4 Experiments 4.1 Datasets and Method We experiment with three different publicly available datasets whose details are shown in Table 4. Each one contains few thousand training samples, out of which we select, follow- ing some selection criteria π, only a few dozen. More pre- cisely, we are interested in the model's performance when it is trained only with k = 10, 20, 30, ..., 100 labeled sentences. This selection simulates the behaviour of a system that needs to be trained for a newly available domain. We measure the performance by the best achieved F1 score during training on a separate test set that we have for each domain. The final col- umn of Table 4 shows the performance of our adopted model trained on the full datasets. These are the best results that we can hope to achieve when training with a proper subset of training samples. We will denote by Tn = {x1, x2, ..., xn} the full training set of a particular domain, assuming that each xi is a (sentence, tags) pair. The training set comprising the subset of k training samples that we select using the ranking π will be denoted by T π k = {xπ(1), xπ(2), ..., xπ(k)}. 4.2 Baselines To the best of our knowledge, data selection techniques have not yet been applied to the slot filling problem. As a result, there is no direct benchmark to which we can compare our method. Instead, we use three baselines that were used in similar situations: random data selection, classic active learn- ing and an adaptation of a state-of-the-art selection method – randomized active learning [Angeli et al., 2014]. Random Selection of Data To select k sentences out of the total n, we uniformly pick a random permutation σ ∈ Sn and take as our training set T σ k = {xσ(1), xσ(2), ..., xσ(k)}. Although random data se- lection occasionally picks irrelevant sentences, it guarantees diversity, thus leading to a reasonable performance. We show that some complex methods either fail to outperform the ran- dom baseline or they improve upon it only by a small margin. Classic Active Learning Framework For our second baseline, we choose the standard active learn- ing selection procedure. We iteratively train the model and select new data based on the model's uncertainty about new unlabeled points. To calculate the uncertainty for a sen- tence x = (w1, w2, ..., wk) containing k word tokens, we adapt the least confidence (LC) measure [Fu et al., 2013; Culotta and McCallum, 2005]. We define the uncertainty of a trained model Θ for the sample x as the average least con- fidence uncertainty across the labels k(cid:88) i=1 u(x) = 1 k (1 − pΘ(ywix)) (8) Figure 3: Comparison between the ratio-penalty and the three base- line selection methods for the MIT Restaurant dataset where yw is the most likely tag for the word w predicted by Θ and pΘ(ywx) is its softmax-normalized score output by the dense layer of the model network. We proceed by selecting batches of ten sentences, thus per- forming a mini-batch adaptive active learning [Wei et al., 2015] as follows. The first ten sentences T10 used for the initial training of the model Θ are picked randomly. Then, at each iteration k ∈ [20, 30, 40, ..., 100], we pick a new batch of ten sentences N for which Θ is the most uncertain and retrain the model with the augmented training set Tk = Tk−10 ∪ N . Randomized Active Learning In the text processing scenario, the classic active learning al- gorithm has the drawback of choosing sentences that are not good representatives of the whole dataset. The model is often the least certain about samples that lie in sparsely populated regions and this blindness to the input space density often leads to a poor performance. To address this problem, data is usually selected by a weighted combination of the uncer- tainty about a sample and its correlation to the other samples [Fu et al., 2013; Culotta and McCallum, 2005]. However, this approach requires finding a good correlation metric and also tuning a trade-off parameter of confidence versus rep- resentativeness. The latter is not applicable in our scenario because we would need to access a potential validation set, which deviates from our selection principle of labeling the Figure 4: Comparison between the ratio-penalty and the three base- line selection methods for the MIT Movie dataset bility u(x)/(cid:80) least data possible. Instead, we adapt a well-performing tech- nique proposed by [Angeli et al., 2014] in which samples are selected randomly proportionally to the model's uncertainty. More precisely, a sample sentence x is selected with proba- y∈V u(y). Although uncertainty will again be the highest for the poor samples, as their number is small, they will contain only a tiny percent of the total uncertainty mass across the whole dataset. Consequently, they will have very little chance of being selected. 5 Results Figures 3, 4 and 5 show the resulting curves of the three baselines and the ratio-penalty selection (RPS) for the MIT Restaurant, the MIT Movie and the ATIS dataset, respec- tively. The x-axis shows the number of samples used for training and the y-axis shows the best F1 score obtained dur- Figure 5: Comparison between the ratio-penalty and the three base- line selection methods for the ATIS dataset Figure 6: Comparison of various selection techniques applied on the MIT Restaurant dataset ing training on a separate test set. As the three baselines rely on random sampling, we repeat the procedure five times and plot the mean together with a 90% confidence interval. As ex- pected, the classic active learning (ALC) algorithm performs poorly because it tends to choose uninformative samples at the boundary of the cloud. The randomized active learning (ALR) gives a much better score, but surprisingly, it remains comparable to the random data selection strategy. Finally, the ratio-penalty selection (RPS) yields the best results, outper- forming the baselines by a significant margin across all three domains. For example, in the MIT Restaurant domain, the average gap between RPS and the best performing baseline, ALR, is around 6 points in F1 score. The best result is ob- tained for k = 10 samples, where we observe approximately 55% relative improvement of RPS over ALR. Both in the MIT Restaurant and MIT Movie domains, RPS needs, on average, 20 labeled sentences less to match the performance of ALR. Figure 6 presents the resulting curves of different selection strategies for the MIT Restaurant dataset. The results were similar for the remaining two domains. The linear penalty se- lection, introduced in Section 3.3 and shown only for the best parameter α, yields results that are better than the random choice and, in some regions, comparable to RPS. However, the disadvantage of this method is the requirement to tune an additional hyper-parameter that differs from one domain to another. We also present the performance when we train the model with the top k longest sentences (Length Score). It is fairly well in the very low data regimes, but it soon starts to degrade, becoming worse than all the other methods. 6 Conclusion In this paper, we have explored the utility of existing data se- lection approaches in the scenario of slot filling. We have in- troduced a novel submodularity-inspired selection technique, showing that a good choice of selection criteria can have a strong influence on the model's performance in the low-data regime. Moreover, we have shown that it is not necessary to limit this search to properly defined submodular functions. As they are efficiently optimized in practice by using the de- rived maximal gain, defining only the latter is sufficient to produce the rankings of the sentences. In addition, we have also defined a similarity metric between pairs of sentences using their continuous vector representations produced by a recent novel technique, sent2vec. Finally, we have shown that the space of raw samples already contains much infor- mation that can be exploited. This information is potentially more useful than the output space information used in the ac- tive learning paradigm. Acknowledgements We would like to thank Patrick Thiran (EPFL), for sharing his valuable ideas and insights during the course of this research. A Adopted Model Specifications Our adopted model uses pre-trained GloVe embeddings on both word (dw = 300) and character level (dc = 50). The final word representation is a concatenation of its GloVe em- bedding and its character representation obtained by a sep- arate mini-BiLSTM network. The hidden layer sizes of the main and the character BiLSTM are hw = 200 and hc = 100, respectively. Both the word and the character embeddings are fine-tuned during the training phase. Gradients are clipped to a maximum norm of 5 and the learning rate of the Adam optimizer, which starts at 0.005, is geometrically decayed at every epoch by a factor of 0.95, until it reaches the minimum set value of 0.001. Mini-batch size is equal to 20. References [Angeli et al., 2014] Gabor Angeli, Sonal Gupta, Melvin Jose, Christopher D Manning, Christopher R´e, Julie Tib- shirani, Jean Y Wu, Sen Wu, and Ce Zhang. Stanford's 2014 slot filling systems. TAC KBP, 695, 2014. [Bahdanau et al., 2014] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [Culotta and McCallum, 2005] Aron Culotta and Andrew McCallum. Reducing labeling effort for structured pre- diction tasks. In AAAI, volume 5, pages 746–751, 2005. [Fu et al., 2013] Yifan Fu, Xingquan Zhu, and Bin Li. A sur- vey on instance selection for active learning. Knowledge and information systems, pages 1–35, 2013. [Hakkani-Tur et al., 2016] Dilek Hakkani-Tur, Gokhan Tur, Asli Celikyilmaz, Yun-Nung Chen, Jianfeng Gao, Li Deng, and Ye-Yi Wang. Multi-domain joint semantic In INTER- frame parsing using bi-directional rnn-lstm. SPEECH, pages 715–719, 2016. [Huang et al., 2015] Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015. [Jaech et al., 2016] Aaron Jaech, Larry Heck, and Mari Os- tendorf. Domain adaptation of recurrent neural net- works for natural language understanding. arXiv preprint arXiv:1604.00117, 2016. [Kirchhoff and Bilmes, 2014] Katrin Kirchhoff and Jeff Bilmes. Submodularity for data selection in statistical ma- chine translation. In 2014 Conference on Empirical Meth- ods in Natural Language Processing (EMNLP), pages 131–141, 2014. [Krause and Golovin, 2014] Andreas Krause and Daniel Golovin. Submodular function maximization., 2014. [Kurata et al., 2016] Gakuto Kurata, Bing Xiang, Bowen Zhou, and Mo Yu. Leveraging sentence-level information with encoder lstm for semantic slot filling. arXiv preprint arXiv:1601.01530, 2016. [Lample et al., 2016] Guillaume Lample, Miguel Balles- teros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recog- nition. arXiv preprint arXiv:1603.01360, 2016. [Lin and Bilmes, 2011] Hui Lin and Jeff Bilmes. A class of submodular functions for document summarization. In Proceedings of the 49th Annual Meeting of the Associ- ation for Computational Linguistics: Human Language Technologies-Volume 1, pages 510–520. Association for Computational Linguistics, 2011. [Lin and Bilmes, 2012] Hui Lin and Jeff A Bilmes. Learn- ing mixtures of submodular shells with application to doc- ument summarization. arXiv preprint arXiv:1210.4871, 2012. [Liu and Lane, 2016] Bing Liu and Ian Lane. Attention- based recurrent neural network models for joint intent de- tection and slot filling. arXiv preprint arXiv:1609.01454, 2016. [Liu et al., 2013a] Jingjing Liu, Panupong Pasupat, Scott Cyphers, and Jim Glass. Asgard: A portable architecture In Acoustics, Speech for multilingual dialogue systems. and Signal Processing (ICASSP), 2013 IEEE International Conference on, pages 8386–8390. IEEE, 2013. [Liu et al., 2013b] Jingjing Liu, Panupong Pasupat, Yining Wang, Scott Cyphers, and Jim Glass. Query understand- In Au- ing enhanced by hierarchical parsing structures. tomatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on, pages 72–77. IEEE, 2013. [Ma and Hovy, 2016] Xuezhe Ma and Eduard Hovy. End- to-end sequence labeling via bi-directional lstm-cnns-crf. arXiv preprint arXiv:1603.01354, 2016. [McCallum et al., 1998] Andrew McCallum, Kamal Nigam, et al. Employing em and pool-based active learning for text classification. In ICML, volume 98, pages 350–358, 1998. [Mesnil et al., 2015] Gr´egoire Mesnil, Yann Dauphin, Kaisheng Yao, Yoshua Bengio, Li Deng, Dilek Hakkani- Tur, Xiaodong He, Larry Heck, Gokhan Tur, Dong Yu, et al. Using recurrent neural networks for slot filling in spoken language understanding. IEEE/ACM Transactions on Audio, Speech and Language Processing (TASLP), 23(3):530–539, 2015. [Nemhauser et al., 1978] George L Nemhauser, Laurence A Wolsey, and Marshall L Fisher. An analysis of approxima- tions for maximizing submodular set functions-i. Math- ematical Programming, 14(1):265–294, 1978. [Pagliardini et al., 2017] Matteo Pagliardini, Prakhar Gupta, and Martin Jaggi. Unsupervised learning of sentence embeddings using compositional n-gram features. arXiv preprint arXiv:1703.02507, 2017. [Wei et al., 2014] Kai Wei, Yuzong Liu, Katrin Kirchhoff, Chris Bartels, and Jeff Bilmes. Submodular subset se- lection for large-scale speech training data. In Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE Inter- national Conference on, pages 3311–3315. IEEE, 2014. [Wei et al., 2015] Kai Wei, Rishabh Iyer, and Jeff Bilmes. Submodularity in data subset selection and active learning. In International Conference on Machine Learning, pages 1954–1963, 2015. [Zhai et al., 2017] Feifei Zhai, Saloni Potdar, Bing Xiang, and Bowen Zhou. Neural models for sequence chunking. In AAAI, pages 3365–3371, 2017. [Zhang and Wang, 2016] Xiaodong Zhang and Houfeng Wang. A joint model of intent determination and slot fill- ing for spoken language understanding. In IJCAI, pages 2993–2999, 2016. [Zhu and Yu, 2017] Su Zhu and Kai Yu. Encoder-decoder with focus-mechanism for sequence labelling based spo- ken language understanding. In Acoustics, Speech and Sig- nal Processing (ICASSP), 2017 IEEE International Con- ference on, pages 5675–5679. IEEE, 2017.
1907.09190
1
1907
2019-07-22T09:01:35
ELI5: Long Form Question Answering
[ "cs.CL" ]
We introduce the first large-scale corpus for long-form question answering, a task requiring elaborate and in-depth answers to open-ended questions. The dataset comprises 270K threads from the Reddit forum ``Explain Like I'm Five'' (ELI5) where an online community provides answers to questions which are comprehensible by five year olds. Compared to existing datasets, ELI5 comprises diverse questions requiring multi-sentence answers. We provide a large set of web documents to help answer the question. Automatic and human evaluations show that an abstractive model trained with a multi-task objective outperforms conventional Seq2Seq, language modeling, as well as a strong extractive baseline. However, our best model is still far from human performance since raters prefer gold responses in over 86% of cases, leaving ample opportunity for future improvement.
cs.CL
cs
ELI5: Long Form Question Answering Angela Fan1,2 Yacine Jernite∗1 Ethan Perez∗3 David Grangier4 Jason Weston1 Michael Auli1 1Facebook AI Research 2LORIA 3NYU ‡ 4Google AI ‡ 9 1 0 2 l u J 2 2 ] L C . s c [ 1 v 0 9 1 9 0 . 7 0 9 1 : v i X r a [angelafan,yjernite,jase,michaelauli]@fb.com, [email protected], [email protected] Abstract We introduce the first large-scale corpus for long-form question answering, a task requir- ing elaborate and in-depth answers to open- ended questions. The dataset comprises 270K threads from the Reddit forum "Explain Like I'm Five" (ELI5) where an online community provides answers to questions which are com- prehensible by five year olds. Compared to ex- isting datasets, ELI5 comprises diverse ques- tions requiring multi-sentence answers. We provide a large set of web documents to help answer the question. Automatic and human evaluations show that an abstractive model trained with a multi-task objective outper- forms conventional Seq2Seq, language mod- eling, as well as a strong extractive baseline. However, our best model is still far from hu- man performance since raters prefer gold re- sponses in over 86% of cases, leaving ample opportunity for future improvement.1 1 Introduction Existing question answering datasets have enabled significant progress in models that provide ex- tractive or unambigious short answers. However, less attention has been paid to open-ended ques- tions that require explanations. In this work, we present ELI5: a Long Form Question Answer- ing dataset that emphasizes the dual challenges of isolating relevant information within long source documents and generating paragraph-length ex- planations in response to complex, diverse ques- tions (see illustrations in Figures 1 and 2). The first challenge of ELI5 is the length and di- versity of answers that span multiple sentences: ∗ Equal contribution ‡ Work done while at Facebook AI Research 1Dataset, Pretrained Models, and Additional Informa- https://facebookresearch. https://github.com/ tion is available: github.io/ELI5, facebookresearch/ELI5 Question: How do Jellyfish function without brains or ner- vous systems? [...] (60 words) Answer: Jellyfish may not have a brain, but they have a rough nervous system and innate behaviours. However, they are very simple creatures. They're invertebrate: creatures with- out a backbone. Most jellyfish have really short life spans. Sometimes just a couple of hours. [...] As their name im- plies, they are largely composed of basically jelly inside a thin membrane. They're over 95% water. (327 words) Documents: Jellyfish do not have brains, and most barely have nervous systems. They have primitive nerve cells that help them orient themselves in the water and sense light and touch. [...] While they dont possess brains, the animals still have neurons that send all sorts of signals throughout their body. [...] They may accomplish this through the as- sistance of their nerve rings. Jellyfish don't have brains, and that's just where things begin. They don't have many of the body parts that are typical in other animals. [...] (1070 words) [...] Figure 1: ELI5 example. Models must write multi-sentence answers given questions and supporting web documents. questions are complex and cannot be easily ad- dressed by a short response (Nguyen et al., 2016) or by extracting a word or phrase from an evidence document (Rajpurkar et al., 2016). Answers also represent one of several valid ways of addressing the query. Many state-of-the-art question answer- ing models perform well compared to human per- formance for extractive answer selection (Radford et al., 2018; Devlin et al., 2018). However, their success does not directly carry over to our setting. The second challenge is the length and diversity of the content from knowledge sources required to answer our questions. We leverage evidence queried from the web for each question. In con- trast to previous datasets where the human written answer could be found with lexical overlap meth- ods (Weissenborn et al., 2017), ELI5 poses a sig- nificant challenge in siphoning out important in- formation, as no single sentence or phrase contains the full answer. While there are some datasets that do require multi-sentence supporting knowl- Figure 2: ELI5 questions by starting word, where box size represents frequency. Questions are open ended and diverse. edge such as TriviaQA (Joshi et al., 2017), their answers are still short. We benchmark the performance of several ex- tractive, retrieval, and generative models. Evalua- tion of our task, and of multi-sentence text genera- tion in general, is challenging. We draw upon sev- eral evaluation metrics that quantify performance on intermediary fill-in tasks that lead up to the full answer generation. The overall answer generation quality is measured with ROUGE (Lin, 2004) and various human evaluation studies. We develop a strong abstractive baseline by training a Seq2Seq model on multiple tasks over the same data: language modeling, masked word prediction (Devlin et al., 2018) and answer genera- tion. We show this approach outperforms conven- tional Seq2Seq and language modeling, as well as a strong extractive baseline based on BidAF (Seo et al., 2017) but generalized to multi-sentence out- put. However, our best-performing model is still far from the quality of human written answers, with raters preferring the gold answers 86% of the time. Further, we show that model performance is strongly limited by the ability to comprehend long multi-document input and generate long out- puts to form a comprehensive answer, leaving this challenge for future research. 2 Related Work Various QA datasets have been proposed in roughly two categories: extractive answers and short abstractive answers (see Table 1). Extractive QA Extractive an- swering datasets such as TREC (Voorhees, 2003), SQuAD (Rajpurkar et al., 2016, 2018), NewsQA (Trischler et al., 2017), SearchQA (Dunn et al., 2017), and QuAC (Choi et al., 2018) con- question strain the answer to a word or short phrase from the input and evaluate using exact match or F1 with the ground truth span. HotpotQA (Yang et al., 2018) extends this approach by building questions which challenge models to conduct multi-hop reasoning across multiple paragraphs, but the answer is still a short span. Further, the answer must be straightforward, as it needs to be copied from the supporting evidence -- precluding most "how" or "why" type questions. Abstractive QA Abstractive datasets include NarrativeQA (Kocisky et al., 2018), a dataset of movie and book summaries and CoQA (Reddy et al., 2018), a multi-domain dialogue dataset. Both collect responses with crowdworkers and find that written answers are mostly extractive and short. MS MARCO (Nguyen et al., 2016), a dataset of crowdsourced responses to Bing queries, has written answers around 1 sentence long with short input passages. TriviaQA (Joshi et al., 2017) contains longer multi-document web input, collected using Bing and Wikipedia. As the dataset is built from trivia, most questions can be answered with a short extractive span. Multi-document summarization The ELI5 task of writing a paragraph length response from multiple supporting documents can be seen as a form of query-based multi-document summarization (Tombros and Sanderson, 1998). Summarization tasks such as DUC 20042 involve long input and multi-sentence generation, but contain much less training data compared to ELI5. WikiSum (Liu et al., 2018) proposes writing Wikipedia articles as a multi-document summarization task. ELI5 requires more directed 2https://duc.nist.gov/duc2004/ Dataset ELI5 MS MARCO v2 (Nguyen et al., 2016) TriviaQA (Joshi et al., 2017) NarrativeQA (Kocisky et al., 2018) CoQA (Reddy et al., 2018) SQuAD (2.0) (Rajpurkar et al., 2018) HotpotQA (Yang et al., 2018) Average # of Words 1st Question Word Frequency (%) Question Document(s) Answer Why How What When Where Who Which OTHER # Q-A Pairs 42.2 6.4 14 9.8 5.5 9.9 17.8 857.6 (212K) 56 2895 656 271 116.6 917 130.6 13.8 2.0 4.7 2.7 3.2 2.2 44.8 1.7 0.2 9.8 2 1.4 0.1 27.1 16.8 3.9 10.7 5 8.9 2.6 18.3 35.0 32.6 38.0 27 45.3 37.2 11.3 2.7 2.0 1.7 2 6.0 2.8 2.0 3.5 2.1 7.5 5 3.6 2.2 1.8 3.3 16.8 23.4 15 9.6 13.8 0.8 1.8 41.8 2.2 1 4.4 28.5 6.1 35.3 0.6 6.8 43 17.6 12.8 272K 183K 110K 47K 127K 150K 113K Table 1: Comparing large-scale QA datasets. ELI5 has answers an order of magnitude longer and more open-ended questions. text generation to answer a question, rather than to write about a general topic. In addition, ELI5 contains a diverse set of questions which can involve more than one Wikipedia concept. 3 Making a Long Form QA Dataset 3.1 Creating the Dataset from ELI5 There are several websites which provide forums to ask open-ended questions such as Yahoo An- swers, Quora, as well as numerous Reddit forums, or subreddits. We focus on the subreddit Explain Like I'm Five (ELI5) where users are encouraged to provide answers which are comprehensible by a five year old.3 ELI5 is appealing because answers are supposed to be entirely self contained, and thus rely less on pre-existing knowledge of the world and use simpler language that is easier to model. Questions and answers. We select a set of ques- tions and answers from the ELI5 forum up to July 2018 and then filter it based on how users rated these pairs. First, we only retain questions which have a score of at least two, that is two more 'up- votes' than 'down-votes'. Second, there must be at least one answer with a score of at least two. This yields a final number of 272K questions, and en- sures that at least one person other than the author has read the thread and deemed it appropriate. For each thread, we select the answer with the high- est voting score as the reference. Note that 63% have one or more other valid answers by our up- vote criteria, potentially doubling the size of the available training data. Preparing supporting information. Next, we collect web sources for every question to pro- vide relevant information that a system can draw upon when generating an answer. Wikipedia has been found effective for factoid-oriented questions (Joshi et al., 2017; Chen et al., 2017). However, 3https://www.reddit.com/r/ explainlikeimfive early experiments in our setting showed it to be in- sufficient to cover the wide range of topics present in ELI5 and to address the open-ended nature of the questions. Instead, we use web data pro- vided by Common Crawl.4 Specifically, we con- sider each of the individual pages in the July 2018 archive (roughly one per URL) as a single docu- ment. The data is tokenized with Spacy5 and we select English documents with FastText language identification (Bojanowski et al., 2017). Finally, we index the data with Apache Lucene.6 Creating support documents. We query the in- dex for the 272K questions and gather the 100 most relevant web sources for each question, ex- cluding Reddit. Each web source is the extracted text of one page in Common Crawl. This leads to supporting text for each question of a few hundred thousand words. There is a good chance that the supporting text contains the necessary information to answer the question, but the sheer amount of data is far beyond the scope of what many mod- ern models can handle. We therefore filter the 100 web sources by selecting specific passages using a simple heuristic: we split each web source into sentences, find sentences with the highest TFIDF similarity with respect to the question, add some local context for each of these, and concatenate the result into a single support document, with special tokens indicating non-contiguous passages and document shifts. Each support document is the result of this processing to concatenate rele- vant information from the web sources. We find that extracting 15 passages with a con- text of one sentence before and after the initial se- lection provides the best trade-off between support document length and likelihood of containing rel- evant information, where relevance is measured as the likelihood of containing a sentence which has 4http://commoncrawl.org 5https://spacy.io 6http://lucene.apache.org % Correct Human Answers % Correct Human Answers with Explanation % Support Document contains Full Answer % Support Document contains Relevant Info 94.5 90.2 65.0 92.0 Table 2: Annotated subset of ELI5 to assess answerability. high ROUGE with the answer. We release all 100 Common Crawl IDs for each question and a script to create the support document so future research can use the support document or choose to further investigate the information retrieval problem. Finalizing the data set. If the training data con- tains questions that are too similar to the valida- tion and test data, a model may perform well on these examples by memorizing related examples. We prevent this by building the validation and test set to contain questions that are sufficiently differ- ent from the training data. We compute the TFIDF similarity between each pair of questions in the entire dataset and sample the validation and test set from the subset which has no close neighbor by TFIDF score. The final dataset contains 237K train examples, 10K for valid, and 25K for test. 3.2 Dataset Analysis Table 1 compares ELI5 to related datasets in terms of the length of the question, support document, answer, as well as statistics on the question types. First, ELI5 questions are much longer than in other datasets. This is because the initial question is often followed by a clarifying paragraph detail- ing what aspect of the general theme should be addressed or the question's starting assumptions, which need to be considered to answer well. To get a rough idea of the different questions, we cat- egorize them based on interrogative words. ELI5 focuses on open-ended queries which are less rep- resented in other extractive or abstractive datasets. Figure 2 shows examples of ELI5 questions split by type and Appendix Figure 11 displays random examples from the ELI5 training set. Interestingly, even What questions tend to require paragraph- length explanations (What is the difference. . . ). Support documents contain 22-60 sentences or on average 858 words, which puts ELI5 on the higher end of published datasets for document length. ELI5 contains long-form answers with an average length of 6.6 sentences, or 130 words. Next, we analyze a random subset of ELI5 to assess the feasability of answering the questions in the dataset. We judge if the question is answer- able by reading each question, the gold answer, and the support document we have created with TF-IDF extraction. Note that questions can have multiple parts and all parts of the question must be answered. We sample 500 randomly question- answer pairs from the training set and find that 94.5% of gold answers fully address the question (Table 2) based on the information in the support document. Figure 12 in Appendix F displays ex- amples of human answers that do not correctly an- swer the question. A small proportion of answers are correct but do not explain the answer. On the support document side, 65% of the support docu- ments we construct provide the complete answer to the question, and 92% of support documents provide information relevant to the question. 4 Evaluation Methods Evaluating long-form answers. There are sev- eral aspects to quality: answers should be topi- cal and accurate, fluent, and coherent from start to end. We judge the accuracy aspect by comparing to the gold answer. ROUGE (Lin, 2004) measures similarity between a model output and one or sev- eral references, and is often used in summariza- tion. While our task presents different challenges, such as the diversity of possible answers to a ques- tion, we still find the corpus-level metric to be use- ful to rank different related models (§6). We report F1 for ROUGE-1, ROUGE-2, and ROUGE-L. Abstractive model metrics. For generative models, perplexity (PPL) measures the ability to predict the next word in a sequence given its con- text. For a variant which focuses on semanti- cally important words, we report FILL-1, the ac- curacy at which models generate different Nouns, Verbs, and Adjectives given the correct preceding tokens in the first 2K examples of the test set. Fi- nally, ROUGE-20% measures the model's abil- ity to complete an answer given the first 80% of the reference answer, the question, and the sup- port document. Specifically, we generate a num- ber of tokens corresponding to 20% of the aver- age answer length in the validation set, and mea- sure ROUGE between these and the last 20% of the reference. We mentioned that there are several valid ways to answer most questions. This mea- sure abstracts away this variability and evaluates a system's ability to complete an answer. Extractive: But none of these hypotheses make much sense for a jellyfish because they do nt have brains at all. They just have a nerve net -- a loose ring of neurons that runs around the rim of their pulsating bells. They have an unusual nervous system, because jellyfish are not bilaterally symmetrical -- that is, they dont have a left side and a right side. Jellyfish don't have brains, but their nervous systems detect smells, light and other stimuli, and they coordinate their physical responses. Language Model: They don't have brains. They have a nervous system. They do not have a brain. They are not conscious. They can not move. They move. Their nervous system is not a muscle. They use their muscles to move. The nervous system does not have any nerves. They just have a nerve. They also have a muscle that is very similar to a muscle in that it is very much like a muscle, but instead of a muscle it is a muscle and it is like a nerve, but it is not muscle. The nerve is like the muscle, it is just a muscle but it has a nerve and it has nerves. The nerves are like the muscles, but they have nerves. Multi-task Seq2Seq: Jellyfish don't have brains. Jellyfish have a nervous system. They know how to swim, they don't even know what to do with their bodies. They have a "nervous system", which is basically a bunch of nerve cells that connect to the body. The nervous system is made up of neurons, neurons, nerves, etc. Each neuron doesn't have a specific set of "neurons", it just has a different set of nerves. It has a set of sensory neurons, which are all connected to each other. It just knows that it does react to the stimulus, and it knows that the stimulus is there. They have a bunch of nervous systems that act like a filter to get information back. Figure 3: Example answers from the extractive BidAF model, Question + Document + Answer language model, and Multi-task Seq2Seq model for the question "How do Jellyfish function without brains or nervous systems?" (cf. Figure 1). Human evaluation. We use crowdworkers to conduct three assessments. First, evaluators rate the fluency of human and model generated answers on a 5-point Likert Scale, from "very poorly writ- ten" to "easily readable" (500 evaluations). Sec- ond, evaluators are given question-answer pairs and are asked if the answer is correct (500 eval- uations) 7. We also evaluated a smaller subset ourselves while additionally looking at the support documents (100 evaluations) to assess answer ac- curacy. Lastly, crowdworkers are given the ques- tion and answers from two models and asked to decide which answer they prefer while consider- ing readability and accuracy (1000 evaluations). Each crowdworker assessment is made by 3 dif- ferent evaluators. The same questions are used for all models and must be at least 5 words long. 5 Models 5.1 Extractive and Retrieval Models Retrieval baseline and oracle. We report ROUGE for a retrieval system that returns the answer of the closest question in the training set. Specifically, we perform a nearest neigh- bor search (Johnson et al., 2017) over the aver- age word embeddings of the question using FAST- TEXT (Bojanowski et al., 2017). We also compute an approximate oracle score for extractive systems by using the reference answer to select similar sen- tences from the support document to maximize ROUGE. Computing ROUGE between the ref- erence and all sets of sentences from the source 7We experimented with a variant where crowdworkers were allowed to select a third I don't know option, but found it was used only around 8% of the time. is intractable. Instead, we perform a beam search that adds sentences maximizing TFIDF with re- spect to the answer. The final beam is re-ranked using ROUGE with respect to the reference an- swer. We run this algorithm on our support doc- ument and on the full set of web sources for each validation and test question, selecting up to 10 sen- tences with a beam of size 10. Extractive models. The first baseline we ex- plore simply returns the 7 sentences from the sup- port document which have the highest TFIDF sim- ilarity with the question. We also evaluate mod- els which score sentences from the support doc- ument based on the question and return the high- est scoring sentences in their original order (the number is tuned on the validation set to maximize ROUGE). We train a model based on BidAF (Seo et al., 2017). We create an extractive training set by finding the span of up to 5 contiguous sentences in the support document which have the highest ROUGE with respect to the reference answer, and sub-sample other support document sentences so that the final training document is shorter than 400 words. We then train a BidAF model to predict the extracted span in the sub-sampled support docu- ment based on the question. For test, we compute the span score for each individual sentence, and return the 5 with the highest score as it performed best compared to returning 3 or 7 sentences. 5.2 Abstractive Models Language and Seq2Seq models. We train sev- eral models based on the Transformer architec- ture (Vaswani et al., 2017), both in its language model and sequence-to-sequence (Seq2Seq) con- Model PPL - - - - - - Support Document Nearest Neighbor Extractive (TFIDF) Extractive (BidAF) Oracle support doc Oracle web sources LM Q + A 42.2 LM Q + D + A 33.9 Seq2Seq Q to A 52.9 Seq2Seq Q + D to A 55.1 Seq2Seq Multi-task 32.7 1 16.8 16.7 20.6 23.5 27.4 54.8 27.8 26.4 28.3 28.3 28.9 ROUGE 2 2.3 2.3 2.9 3.1 2.8 8.6 4.7 4.0 5.1 5.1 5.4 L 10.2 12.5 17.0 17.5 19.9 40.3 23.1 20.5 22.7 22.8 23.1 Table 3: Comparison of oracles, baselines, retrieval, extrac- tive, and abstractive models on the full proposed answers. V Model FILL-1 acc. N A 31.0 29.6 20.6 LM Q + A 30.9 28.9 19.9 LM Q + D + A S2S Q to A 21.7 23.0 15.5 S2S Q + D to A 27.6 26.3 19.4 S2S Multi-task 27.9 26.7 19.9 2 ROUGE-20% 1 L 26.5 7.0 21.1 26.3 7.8 21.3 33.6 11.5 29.5 32.7 10.7 28.6 37.2 14.6 33.0 Table 4: Intermediary fill-in tasks for sequential generation. figurations. To investigate how much information from the document the model uses, we train a lan- guage model on the concatenation of Question, Support Document, and Answer (Q + D + A) as well as on the Question and Answer (Q + A). Sim- ilarly, one Seq2Seq configuration goes from Q to A, and the other from Q + D to A. In all cases, Q, D, and A are separated by special tokens. Multi-task training. Language models are trained to predict all tokens in the question, web source, and answer. However, the standard Seq2Seq model only receives training signal from predicting the answer which is much less than the language model gets. This can contribute to learning poor quality representations compared to language models. To address this, we train a multi-task Seq2Seq model: during training, we multi-task between several generation tasks, including language modeling of Q + D + A by the decoder and variations of source/target pairs (see Appendix A). We add a masked word prediction task (Devlin et al., 2018) where 15% of tokens in the input are masked and must be recovered by the model in the correct order, and append a marker at the start of each sequence to indicate the task. Data processing. To reduce the vocabulary, we apply byte-pair encoding (Sennrich et al., 2016) to generate 40K codes which are applied to all datasets. We model a vocabulary of 52,863 to- kens for answer generation. We use the Trans- former implementation of fairseq-py (Gehring et al., 2017) and train with the big architecture fol- lowing the details in (Vaswani et al., 2017). Given our data length, we train with a large batch size by delaying gradient updates until a sufficient number of examples have been seen (Ott et al., 2018). Generation. We generate from abstractive mod- els using beam search with beam 5. We disal- low repeated trigrams to prevent repetition, a tech- nique commonly used in multi-sentence summa- rization (Paulus et al., 2017; Fan et al., 2018). For the full answer generation task, we tune a mini- mum and maximum length for generation on the valid set and apply these settings to the test set. 6 Results 6.1 Overview of Model Performance Full answer ROUGE. Table 3 shows that the nearest neighbor baseline performs similarly to simply returning the support document which in- dicates that memorizing answers from the train- ing set is insufficient. For extractive models, the oracle provides an approximate upper bound of 27.4 ROUGE-1. The BidAF model is the strongest (23.5), better than TFIDF between the question and the support document to select sen- tences. However, these approaches are limited by the support document, as an oracle computed on the full web sources achieves 54.8. Abstractive methods achieve higher ROUGE, likely because they can adapt to the domain shift between the web sources and the ELI5 subreddit. In general, Seq2Seq models perform better than language models and the various Seq2Seq settings do not show large ROUGE differences. Figure 3 shows an example of generation for the language model and the best Seq2Seq and extractive settings (see Appendix F for additional random examples). Perplexity and fill-in tasks. Tables 3 and 4 present metrics specific to sequential generation models: perplexity of the answer, accuracy of the model's FILL-1 word prediction for Nouns, Verbs, and Adjectives, and ROUGE of the con- ditional generation of the last 20% answer words. The language model perplexity is much lower than that of the standard Seq2Seq setting -- this is likely linked to the number of output tokens the system Figure 4: Human evaluation of answer fluency and accuracy -- with and without access to supporting evidence documents ers in selecting positive (scores 4 and 5), negative (1 and 2), or neutral (3) choices on the 5-point Likert scale, and find that 2 crowdworkers agree almost 100% of the time (Appendix E, Figure 10). In answer accuracy (Figure 4, middle), there is a large gap between human performance and all models. The language model is almost never accu- rate, while the extractive model is slightly more so than the multi-task model. Crowdworkers assess- ing accuracy do not have the support document. We evaluate accuracy ourselves with the support document in Figure 4, right. Similar to crowd- workers, we find 40% of extractive answers to be accurate. We find only 19% of multi-task model answers are fully accurate; even if the model out- put answers the question, it can generate a sen- tence with an incorrect statement. In contrast, the extractive model copies sentences from human- written text. However, the multi-task model is bet- ter at generating relevant answers (84% relevancy compared to 68% for extractive), as the extractive model is constrained by the support document. Figure 5 presents pairwise preference judg- ments of human annotators shown answers from two of the five systems. The reference answer is preferred over the output of all of our trained mod- els in at least 85.5% of cases, indicating there is substantial room for improvement. The multi-task abstractive setting comes next, closely followed by the extractive (multi-task is only preferred in 57% of comparisons), then the standard Seq2Seq and finally the language model, considered worse than any other setting in at least 91% of cases. We use a two-tailed binomial test to test statis- tical significance of the pairwise judgments and it shows that all judgments are statistically signifi- cant at p < 0.05. 6.2 Quantitative and Qualitative Analysis Discussion of the proposed metrics. We present a number of metrics which provide insight into various model behaviors. We recommend Figure 5: Human preferences for pairwise comparisons. The better model's % preference is bolded. * indicates statistical significance. is required to predict at training time. The multi- task Seq2Seq experiment, in which the Seq2Seq decoder is trained to predict the question and the document, in addition to the answer, can reach the same perplexity as the language model. ROUGE- 20% shows a much starker contrast between lan- guage modeling and Seq2Seq, as well as between standard Seq2Seq and multi-task training. The lat- ter achieves strong performance of 37.2 ROUGE- 1. However, both versions of the language model are still better at FILL-1. These results suggest that the Seq2Seq model is better than the language model in maintaining coherence and that Seq2Seq relies on information over many time steps. Human evaluation. Human answers are rated highest in terms of fluency (Figure 4, left). The ex- tractive model outputs human-written text which is likely fluent but with the failure mode of con- catenating unrelated sentences. The multi-task model performs similarly to the extractive model which indicates that abstractive methods can gen- erate coherent answers. The language model and standard Seq2Seq trail behind. To get a sense of the stability of our results, we analyzed the standard deviation of three indepen- dent fluency trials conducted on separate days and we find low variation (Appendix E, Figure 10). We also measure agreement between crowdwork- Figure 6: Attention over the question and supporting evidence for the Multi-task Seq2Seq model and Question + Document + Answer language model. Attention is shown for the first word of answer generation. future work to report full ROUGE and ROUGE- 20%. Perplexity and FILL-1 focus on local prediction and are poor indicators of overall appropriateness for the full task. Full answer ROUGE discriminates reasonably well between models with the same general architecture, but cannot rate an abstractive system against an extractive one. The ROUGE-20% measure abstracts away some variability and focuses on coherence between the beginning and end of an answer. This metric correlates with human judgments of quality but can only be reported for sequential generation. Analysis of extractive, LM and Seq2Seq models. Language models perform better than Seq2Seq in terms of perplexity and FILL-1, while being significantly worse at ROUGE-20% and human evaluations. To investigate this, we visu- alize the attention mechanism at the start of an- swer generation in Figure 6. The attention of the language model is strongly focused on nearby context when generating the first word of the an- swer, whereas the multi-task Seq2Seq model at- tends more evenly to relevant information in the question and the document. This validates our as- sumption that the language model's focus on local context is insufficient for high quality answers. In Figure 7 (left), we further investigate how the relevance and quality of the support document ex- traction step affects the answers provided by the extractive and abstractive setting. The ROUGE score is displayed for data subsets, partitioned by percentile of word overlap of the answer with the support document (e.g. how many answer words appear). While both models perform better for documents with higher ROUGE overlap between support document and human answer, the abstrac- tive setting is much better at compensating for when the support document has lower relevance. Data size and initial selection. There is a large difference between the extractive oracle ROUGE using our support document and the oracle on full Figure 7: (left) Model score by document-answer similarity. (right) Seq2Seq multi-task score by amount of training data. Figure 8: (left) TFIDF rank of source passage for oracle sen- tences. (right) Highest rank used per question. web sources. This suggests that the initial selec- tion of our support document severely limits ac- cess to relevant information. To assess the impact of support document size, we re-run the selection step for 1000 examples to extract 500 passages in- stead of 20, and run the oracle on these new inputs. Figure 8 shows the TFIDF rank of the passages from which sentences are selected. While slightly more sentences are extracted from the higher rank- ing passages, less than 9% come from the first 20, and most oracles have at least one sentence from the last 100. For a model to perform best, it would have to handle inputs tens of thousands of words long. In Table 3, we show an oracle computed on the full web sources has much higher ROUGE than an oracle computed on the support document. We analyze the impact of data size on perfor- mance in Figure 7. We train the multi-task model on 25%, 50%, and 75%, and the all of the data to compare performance. ROUGE increases as a function of the data used and even though ELI5 is one of the larger QA datasets (§3), this shows that collecting more still helps. While we only used one reference answer per question here, recall that over half of them have multiple answers, which could be leveraged to train better models. Combining challenges. Our task blends the inter-dependent challenges of retrieving informa- tion, reasoning, and writing long outputs. Study- ing each of these aspects in context is particularly important. For example, we show that the abstrac- tive model's ability to compensate for a (realisti- cally) imperfect support document is essential to its relative success over extractive methods. The fluency gap between the reference and the extrac- tive system in human evaluation also suggests that the latter may require sequential decision capabil- ities. This kind of decision making is necessary to address the dual challenges of reasoning over sev- eral supporting facts and generating long coherent outputs. We see our task's need to combine com- plementary systems as critical to gaining insights into their individual behaviors. 7 Conclusion We introduce the first large-scale long form ques- tion answering dataset of open-ended queries with explanatory multi-sentence answers. We show that abstractive models generate coherent answers and are competitive with extractive models in hu- man evaluation. Proposed models are far from human performance, in part due to the inability to exploit the long full web text. We hope ELI5 will inspire future work in all aspects of long-form QA, from the information extraction problem of obtaining information from long, multi-document input to generating more coherent and accurate paragraph-length answers. References Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. TACL, 5:135 -- 146. Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. 2017. Reading wikipedia to answer open- domain questions. In ACL. Eunsol Choi, He He, Mohit Iyyer, Mark Yatskar, Wen tau Yih, Yejin Choi, Percy Liang, and Luke Zettle- moyer. 2018. Quac: Question answering in context. In EMNLP. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understand- ing. CoRR, abs/1810.04805. Matthew Dunn, Levent Sagun, Mike Higgins, V. Ugur Guney, Volkan Cirik, and Kyunghyun Cho. 2017. Searchqa: A new q&a dataset augmented with con- text from a search engine. CoRR, abs/1704.05179. Angela Fan, David Grangier, and Michael Auli. 2018. In ACL Controllable abstractive summarization. Workshop on Neural Machine Translation and Gen- eration. Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. 2017. Convolutional Sequence to Sequence Learning. In Proc. of ICML. Jeff Johnson, Matthijs Douze, and Herv´e J´egou. 2017. Billion-scale similarity search with gpus. CoRR, abs/1702.08734. Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehen- sion. In ACL. Tomas Kocisky, Jonathan Schwarz, Phil Blunsom, Chris Dyer, Karl Moritz Hermann, Gabor Melis, and Edward Grefenstette. 2018. The narrativeqa reading comprehension challenge. TACL. Chin-Yew Lin. 2004. Rouge: a package for automatic evaluation of summaries. In ACL Workshop on Text Summarization Branches Out. Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. 2018. Generating wikipedia by summariz- ing long sequences. In ICLR. Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. Ms marco: A human generated machine read- ing comprehension dataset. CoRR. Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. 2018. Scaling neural machine trans- lation. In WMT, pages 1 -- 9. Association for Compu- tational Linguistics. Romain Paulus, Caiming Xiong, and Richard Socher. 2017. A deep reinforced model for abstractive sum- marization. arXiv preprint arXiv:1705.04304. Alec Radford, Karthik Narasimhan, Tim Salimans, and Improving language under- Ilya Sutskever. 2018. standing by generative pre-training. Pranav Rajpurkar, Robin Jia, and Percy Liang. 2018. Know what you don't know: Unanswerable ques- tions for squad. In ACL. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. In EMNLP. Siva Reddy, Danqi Chen, and Christopher D Manning. 2018. Coqa: A conversational question answering challenge. arXiv preprint arXiv:1808.07042. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In ACL. Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2017. Bidirectional attention flow for machine comprehension. In ICLR. Anastasios Tombros and Mark Sanderson. 1998. Ad- vantages of query biased summaries in information retrieval. In SIGIR. Adam Trischler, Tong Wang, Xingdi Yuan, Justin Har- ris, Alessandro Sordoni, Philip Bachman, and Ka- heer Suleman. 2017. Newsqa: A machine compre- hension dataset. In ACL Workshop on Representa- tion Learning for NLP. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. NIPS. Ellen M. Voorhees. 2003. Overview of the TREC 2003 question answering track. In TREC. Dirk Weissenborn, Georg Wiese, and Laura Seiffe. 2017. Making neural qa as simple as possible but not simpler. In CoNLL. Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Ben- gio, William W Cohen, Ruslan Salakhutdinov, and Christopher D Manning. 2018. Hotpotqa: A dataset for diverse, explainable multi-hop question answer- ing. arXiv preprint arXiv:1809.09600. A Details of Multitask Training The seq2seq multi-task model was trained on a va- riety of tasks at training time. Each task is spec- ified by a special token to delineate to the model which task it is. Tasks at training time include the following, in the form of (source, target) pairs. "+" represents a concatenation of inputs, separated by a special token. • (empty, question) • (empty, document) • (empty, answer) • (empty, question + document) • (empty, question + document + answer) • (question, answer) • (question, document) • (question + document, answer) • (question, document + answer) • masked word prediction: 15% of source words are replaced by a "[MASK]" token and the corresponding tokens must be predicted as the target in the correct order B Architectural Details B.1 Extractive BidAF The BidAF model is trained using the Al- lenNLP8 implementation, using the standard hyper-parameters (specified in the bidaf.jsonnet file9). We only change the batch size, since a 16GB GPU can only fit one example per batch, and as a result the Adam learning rate has to be changed to 5e − 5. We provide the code to se- lect the target span and sub-sample the input in our data, as well as to convert it to the SQUAD format required by the AllenNLP system. B.2 Abstractive Models Models are trained with the Adam optimizer with beta values (0.9, 0.98), initial learning rate 1e−07 with 4000 warmup steps to learning rate 0.0001. We follow the inverse square root learning rate scheduler described in (Vaswani et al., 2017). Models are trained with a label smoothing value of 0.1. 8https://allennlp.org/ 9https://github.com/allenai/allennlp/ blob/master/training_config/bidaf. jsonnet Sequence to sequence models are trained with following architecture from (Vaswani et al., 2017): 6 encoder layers, 6 decoder layers, FFN dimen- sion 4096, 16 attention heads, embedding dimen- sion 1024. Gradient updating is delayed until 32 updates have been processed. Models are regular- ized with dropout 0.1 and attention dropout 0.1. Language models are trained with same param- eters described for seq2seq above, with 6 decoder layers. We did not train with 12 decoder layers, as we found the deeper Transformer model was harder to optimize and we achieved worse results compared to a 6-layer language model. For generation, models generate a minimum of 200 words and a maximum of 500 words. C Comparison of Extractive and Abstractive Methods Figure 13 displays an example of a generated an- swer for an example where the source document is of poor quality but the abstractive answer still has strong ROUGE. In comparison, the extractive answer is heavily affected by the poor document quality and derails in topic. D Test/Valid Similarity with Train Figure 9 shows the performance of the Multi-task Seq2Seq and LM on Question + Document + An- swer by the similarity of the question in the valida- tion set to a question in the training set. The sim- ilarity is determined by TFIDF. There is very lit- tle effect of answer generation on a question more similar to a training question than less similar. Figure 9: ROUGE of full answer generation is not strongly affected by similarity of the questions in the validation set to questions in the training set. E Variance in Human Evaluation Studies We analyze the variation of our human evaluation study for answer generation fluency in Figure 10. We conduct 3 different trials of the same 100 ran- domly sampled question-answer pairs from the test set for the selected models. Each trial is con- ducted on a different day. Our results show that standard deviation across the trials is small and not statistically significant. Further, each answer is evaluated for fluency by 3 different crowdworkers. Figure 10 analyzes the agreement rate between crowdworkers that can choose on a scale of five options. We term "agree- ment" if all workers are positive, negative, or neu- tral about the answer fluency. We show that all three crowdworkers agree around 60% of the time for most models and almost 80% of the time for the language model. As the language model gen- eration is significantly less fluent than the other models, most crowdworkers are in agreement. The agreement of at least two of the annotators is al- most 100% for all of our evaluated systems. F Examples We display randomly sampled examples from the training set in Figure 11 and examples of answers that do not answer the question in Figure 12 (an estimated 5% of the dataset). To better understand the output of our models, we display example generations randomly sam- pled from the test set for the multi-task Seq2Seq model (Figure 14) and the Extractive BidAF model (Figure 15). We additionally show a set of poor generations for the multi-task Seq2Seq model (Figure 16) that display a representative set of problems for this abstractive model. Figure 10: Analysis of Human Fluency Study (a) We an- alyze the variation between three iterations of the same ex- periment, conducted on three different days. We evaluate the fluency rating given to the human answers, LM answers, and Multi-task model answers, and find low variation across mul- tiple trials. (b) We calculate the inter-annotator agreement between the three evaluators that score the fluency of each of the models, and find that the % of time all three annotators agree is high- est for the language model. Agreement is calculated using positive (Likert scale scores 4 and 5), neutral (3), and nega- tive (scores 1 and 2). (c) We calculate the inter-annotator agreement between at least two evaluators for the fluency of each of the models, and find that two annotators usually agree almost 100% of the time. Why do Oreos soften when they get stale, but most other foods (like bread) harden? It has to do with how much moisture is in the food compared to how much moisture is in the air. Oreo? Drier than air, they gain moisture and turn soft. Loaf of bread? More moist than air, it loses moisture and dries up. Kitchen hack: put a slice of bread in with cookies to keep the cookies fresher a little longer. Why is it that cracks seemingly spread on their own? Because of how the mechanics of the crack work. The stress in a material is related to the radius of corners, that is, rounded corners, like the bottom of the letter U, have less stress than sharp corners, like a V. Sharp corners are actually referred to in mechanical engineering as "stress raisers". And what's sharper than the edge of a crack? This means that even stress from thermal expansion of the material can be enough to cause the crack to spread. This is especially true of glass, whose brittle composition is quite susceptible to catastrophic failures. Discrete Math: reflexive, symmetric, antisymmetric, transitive A *binary relation* is a function of two variables that is either true or false. I'm going to use Rxy to notate the relation R applied to x and y in that order. A relation is *reflexive* if Rxx is true; that is, if both variables are the same the relation always holds. A relation is *symmetric* if Rxy = Ryx; that is, switching the order of the arguments doesn't change the value. A relation is *antisymmetric* if Rxy never equals Ryx for distinct x and y; that is, switching the order of the arguments always changes the value (unless the arguments are the same, in which case it obviously can't). A relation is *transitive* if Rxz is true whenever Rxy and Ryz are. Equality is the simplest example of this; if you have x = y and y = z, then you can conclude that x = z. Why does bashing my crt tv make it work? There are several reasons why "percussive maintenance" can work. The most likely is that there's simply a poor electrical connection somewhere, and banging on it gets it into contact. Once the electric- ity starts to flow, things heat up and expand a bit, maintaining the connection. Until you turn it off and everything cools off again. Is it more efficient to leave the AC running on auto at 74F (in 85 degree whether) or turning it off when leaving the house, and turning it back on when returning when the ambient temp in the apartment is 85? Turn it off, you will use less power. Thermodynamics tells us that heat loss is proportional to temperature difference, so if you let your house warm up the heat from outside enters more slowly. Essentially the product of time and temperature difference is your cooling energy. There is a minor subtlety with maintenance and life cycle, your AC unit may not be designed for continuous duty, so long cool down cycles could be hard on it. Not sure if that is the case in your unit, seems like a bad way to design anything but it could be. Edit: one non-thermodynamic factor is humidity and mold, which will be different at a constant temperature vs a cycling temperature. Figure 11: Examples of Question-Answer Pairs randomly sampled from the training set The differences between Wii, PS, Xbox, etc., and which is considered the best system. I'm 40, out of the loop, and have to buy one for Christmas. If he is 7 go for the Wii its /technically/ more kid friendly and has a more varied option of games for that age range... I think What is it when everything just looks really bright/your eyes white out for a moment, then goes back to normal? What is it? Time to see a doctor. Neurologically what happens someone becomes insane That is waaaaaaaay too broad a question to possibly answer since "insane" covers a multitude of different conditions and disorders, all with their own causes and that's even assuming that we know the causes in the first place. If my spaceship could withstand the pressures of Jupiter, what would a trip through the planet be like? Read the novel "2010" by Arthur C. Clarke. There's a chapter that explains this far better than I could. If person A saves person B's life through CPR but person B's rib gets broken during chest compressions, why is person B able to sue person A? Why doesn't the judge through the case out of court? I know Good Samaritan laws play into this somehow, but I can't remember how. I think that if you have the proper licensing, then they can't sue you. Or maybe it's the other way around. Sorry, this response has become useless Figure 12: Examples of Answers in the training set that do not answer the question Question: Why do TV shows hide logos ? Document: Why is that? Why do logos get blurred on television, or in film, or even in music videos? The answer, it turns out, is complicated, but is mostly about money in various forms. A whole lot of dysfunction here. Quick Pick: HBO TV Shows Pick the missing word in the title of these HBO shows. September is season premiere month so these logos should be fresh in your mind. TV Shows Venn Diagram II Can you click on the most accurate section of the Venn Diagram for each of the following TV Shows? [...] ELI5 Answer: nothing is free. In most cases, it is a prop for the show, but because apple did NOT pay them for the product placement, the show isn't going to give it away. In other cases, apple may not want their brand used in association with that media. Extractive: The answer, it turns out, is complicated, but is mostly about money in various forms. There is only one reason they do not trust it and that is fear of loosing their money. All the seals or say reassurance and credibility logos assure your user that a website is safe, protected and personal information is safe. A Lot Of New Disney TV Shows Disney is finally looking to break into the world of TV shows with this streaming service and that's reportedly going to include "episodic spinoffs" of beloved franchises like High School Musical (that's right, it's coming back. . . ), Monsters Inc., and The Muppets. Seq2Seq Multi-task: It's because they're paying for the right to use the show. If you're a TV show, you're paying to have the show shown for free, and you're not paying for a license to use that show for free. the reason they don't have to pay for the license is because the show doesn't want to be associated with the show, and the show isn't paying for it. It's not the show's fault, it's the company that makes the show pay for it, and it's not their fault. Figure 13: Example of document with low document-answer overlap where the abstractive system still achieves a high ROUGE score. The extractive baseline correctly identifies where the question is reformulated in the source document and selects the following sentence, but then goes on to confuse different types of logos and goes off topic entirely with the Disney analysis. Who controls what the president is allowed to do? But then who controls what they're allowed to do? Etc .. The president is the commander-in-chief of the armed forces. He is the head of the executive branch. He controls the military, the military and the military. The president controls the army, the navy, the air force, and the army. The President is the president. He has the authority to do whatever he wants, but he doesn't have the power to do all he wants. He doesn't want to do anything about it. He wants to do something about it, but it doesn't really matter what the president is doing. He's not the president, he's just a figurehead, and he's the president of the United States. It's not really a matter of who controls the government, it's the people who control the government. There are a lot of people who don't like the President, but they don't really like him. There's a lot more to it than that, but that's the basic gist of it. The US government is controlled by the US government, but not by the federal government. The federal government is the one that controls most of the US military, but there are a few that don't. They are the ones that control most of US military operations, and they are not the ones who control most. What makes the stomach "growl"? The sound of your stomach growling is caused by the movement of air in your stomach. The sound you hear when your stomach is empty is called peristalsis. This is the sound that your stomach makes when it is empty. When you are hungry your stomach will make the sound of the growling sound, but it will not be as loud as the sound you are making when you are not hungry. It is the same thing that makes your stomach growl when it's empty. You are not actually hungry, but you are actually contracting the muscles in your intestines to make the noise. The growling is the result of the muscles contracting and contracting to make a loud noise. It's the same reason why you feel the urge to eat when you're hungry. Your stomach is trying to empty itself, so it makes the noise as if you aren't hungry. The same thing happens with your stomach when you have a cold. The muscles in the stomach are contracting and making the noise, but they are not contracting. They are contracting, but not contracting, so they aren't contracting. The noise you feel when you feel it is the stomach making is your stomach making the sound. Source : I am a gastroenterologist, and I have a lot of experience with gastroenterology. How does a de-humidifier work? A humidifier works by heating the air in the room. When the air is warm, it cools down. When it is cold, it warms up. This cools the air around it, which cools it down. This is why you can see a lot of cool things in a room if you look at it from a distance. The air around the room is warmer than it is, so it rises. This causes it to rise, and cool down. The same thing happens with a humidifier. The water in the air condenses out of the air, and condenses back into liquid water. This water condenses back to liquid water, which is what you see when you blow on a hot air balloon. The cold air cools down, and the warm air condenses back out of it, making the air colder. It's the same thing as a humidifier, except that it doesn't have any water in it, it just has a bunch of tiny droplets in it that make up the air. It does have some water, but it has a lot more in it than it does with a cold air balloon, so the air gets colder. The downside to a humidifier is that it isn't as efficient as a regular humidifier, and it is much more efficient than a regular one. Could anyone explain the suffix nomenclature for diseases/conditions/ailments? Ex. -itis vs -osis vs -algia There are a few different types of suffix. -ous suffix comes from the Latin "-ary", which means "-ate". The suffix "-er" comes from a Latin root that means "something" or "something." "-ous" is a suffix that is used to refer to things that are related to something that is related to that thing. For example, "-es" means "a". So "-e" is the suffix that comes from "-ide", and "-o" is "-ic". In this case, the "-i" is from the Greek "-os", so "-ia" is just the Latin root of "-ian". It's the same way that "-s" is also the suffix for "-ies", but it 's not the same thing as "-y". A lot of the words that are used in the English language don't have the same suffix, so they are used differently. In English, the word "-us" has a different suffix than "-u". This means that the -ic suffix is more likely to be used in English than the -ian suffix . In other words, it's more likely that the suffix will be used more often than it is in English. How do live visualization websites work? I'm not sure what you're referring to, but I'll give it a shot. First of all, you have to understand what they mean by the term " visualization". Basically, they use a technique called "visualization." Basically, you take a picture of a room, look at it, and compare it to what it looks like to you. Then, you look at the room, and see what the room looks like, and then compare that to what you see in the room. You can then use the visualization to figure out what it actually looks like. For example, let's say you 're in a room with a camera, and you want to know what the camera looked like. You know that the camera looks like the camera, but you don't know what it looked like, so you use it to look at what it was like to see what you were looking at. Then you use the technique to find out what the person was looking at, and figure out how to use that to get a sense of what they were actually looking at at. The visualization is pretty simple, but it's a lot more complicated than that, so I'll try to explain it in a bit more detail. First, you need to understand how the visualization works. The first thing to understand is that it's very easy to use. Let's say that you're looking at a room and you're really interested in the camera. You want to be able to see how far away the camera is from you, so that you can figure out the distance between the camera and your camera. The second thing to remember is that the visualization isn't very accurate. It's just a way of looking at things that aren't directly related to each other. For instance, if you're interested in learning how to read a book, you might be interested in reading a book. You might also want to read the book in a way that is easy to understand, and it's easy to get used to it. Figure 14: Example Question-Generated Answer pairs from Seq2Seq multi-task model, randomly sampled from the test set Why doesn't the color red compress well in JPEGs? PNG will take longer to load on a website, but its sometimes simply worth it if it means the difference between a good or bad image. So with all this hate toward JPEGs, you might be asking yourself why the format continues to even exist when so many better options are available. Also important to note, JPEGs do more than compress the file, they also lose color and contrast range. These numbers and ratios are examples for the sake of easy explanation, but lets say a picture has 100 colors and 100 contrast points. Straight out of the camera, JPEGs often look much more vibrant than raw les, because the colors have been enhanced and sharpening applied in-camera. If you need to archive a large number then you could try placing them in a zip file, but you probably won't save more than 5%. When reading weather reports and it says 50% chance of rain, what does that actually mean and how is it calculated? I have always maintained this is a confusing concept and its the main reason that I will rarely if ever use a percent chance in a forecast. When they say there is a 50% chance of rain, does that mean that there is a 50% chance it is not going to rain? Then, why does it always rain when the chance of rain is 50%? So, maybe the 50% chance means that it will rain on only 50% of the land while the other 50% rains on the water. This is important to keep in mind because when making claims about the impact of global warming, you need to look at the big picture, not just the last 150 years. Well, there are two input variables you have to keep in mind: first, the geographic location -- where youre looking for a forecast, and second, the time window youre looking at. Why does my skin turn a paler white when pressed? Kinda random. Always wanted to know. There is a darker shade, but the shade Sunkissed is perfect for the lighter skin wearers. It doesn't irritate eyes, and it's gentler on skin than some of their other powders -- it's also very finely milled and thick enough that you can use it as a foundation and it covers even dark broken capillaries. What I don't like: This is very light peach when it starts out, and it doesn't turn paler on skin; it also oxidizes. It's a light peach when it starts out, and then it turns darker. If you are unsure if you have cool skin tone, check if you have bluish coloured veins inside your wrist (just under your forehand). Spots or a rash that do not fade under pressure will still be seen when the side of a clear drinking glass is pressed firmly against the skin. Can psychoactive drugs trigger schizophrenia in people who are at a genetic disposition to the disease already? If so, how high is the risk for different family members that have it? Do you have a higher chance if a parent has it or if a grandparent has it? What about cousins? Aunts and Uncles? The identical twin of a person with schizophrenia is most at risk, with a 40 to 65 percent chance of developing the disorder. Some doctors think that the brain may not be able to process information correctly; and it is believed that genetic factors appear to play a role , as people who have family members with schizophrenia may be more likely to get the disease themselves. As Schizophrenia has a tendency to run in families, scientists already know there is a genetic link but that doesnt mean that if you do have someone in your family that has Schizophrenia that you will too, neither does it mean that if you dont, you wont, so there are other factors involved too. At the moment people with Schizophrenia are usually prescribed anti-psychotic medication, some of which can carry unpleasant side effects. If you have a pre-existing risk for schizophrenia (which most people at risk are unaware of), theres a much higher chance that using cannabis will trigger a schizophrenic episode. Again, it is extremely important to note that this risk applies primarily to people who are already at risk of developing schizophrenia. Why has the Canadian dollar gone down in value over the few years? So far in 2016, the Canadian dollar has lost a lot of value. The days of the Canadian dollar at parity with the US dollar are long gone. A lot of that increase in book value is because of the loss of value of the Canadian dollar. What we have to remember however is that it is not really the Canadian dollar that has gone up in value, it is the American dollar which has gone down. Since the beginning of the Iraq War the American economy has stumbled and one could make the argument that it is because there is no one at the wheel. This means Canadians can now come into the US and get a great deal on just about anything , and they are buying up real estate, to the tune of more than $20 billion a year. How do they make Jello with pineapple bits in it if pineapple ruins Jello? I have a store-bought cup of generic Jello with pineapple bits in it. According to all my google searching and middle school science classes, this shouldn't be possible because pineapple enzyme just destroys Jello's jellystuff. So what is this thing in my cupboard? Enzymes: whats in your spit fruit and jello an hour before the lab begins it is possible to make jello with canned pineapple chunks but not fresh. Well, just as a little science experiment, I stuck a piece of fresh, uncooked pineapple in a cup of the jello, and this is what it looked like after about 20 minutes. In the cooking world, on the other hand, bromelain is regarded as the enemy of the gelatin dessert if you use fresh pineapple in gelatin, the enzyme eats the. Experiment demonstrates denaturation of an enzyme using an enzyme called catalase which is found in the pineapple and jelly experiment background. In this lab students will investigate a few of the different enzymes from our body pineapple contains the enzyme bromelain, and should break down the jello. Well, to begin with, it's not true you can't put any pineapples in jello jello is alive -- at least according to a 1974 experiment performed by dr. Figure 15: Example Question-Generated Answer pairs from the extractive BidAF model, randomly sampled from the test set Why is "PC Gamer" Hardware so Flashy? It's because they don't want to. They want to make sure that they have a decent amount of battery life, and that they can make a decent battery life. They also want to be able to make a small battery that will last for a very long time, and make sure they have enough power to last a long time. That said, there are a lot of people who don't know what they're talking about, and don't really know what's going on. There's also the fact that they're not going to make it to the end of the day, and it's going to be a lot harder for them to make the battery last longer than it is for the average person. It's not like they 're going to have to make their own battery last a lot longer than they are for a PC, but they're still going to get a lot more battery life than they're for a gaming PC, so it's a lot easier to make them last longer, and they're also going to need a lot less power than they were for a desktop PC, which means they'll need more power to run the game, and so they'll have to have more power for the game to last longer. That's why it's so important to keep in mind that there 's a ton of people out there who aren't very good at it, and there's no reason to be afraid of it. What are the benefits of an American city being it's own county? i.e. San Francisco There are a lot of benefits to an Amer- ican city being "own" a county. It's not like there's a whole lot of money to be made in a city, but it's a lot more complicated than that. There's also the fact that there are **lots*** of people who aren't part of the city, and there aren't **many** people who ** are part of that city. There are also **a lot** more people who don't want to be part of a city than there are people who just want to live there. There is also a **lot* of **money** in that city, so it's easier for them to get there than it is for the people who want to stay there. This is why there are so many people in San Francisco, and why it's so hard to find a city that doesn't have a whole bunch of people in it. **Edit:** [Here's a link] (URL 0) to an article that explains it better than I can. I'm not sure if this is the right place to ask this, but I'm sure someone else can give you a better answer than me, so I 'll give it a shot. How do cruise ships get wifi in the middle of the ocean? There are a couple of ways to do this. One is to turn on the radio and turn off the wifi. The other is to make sure that the wifi is turned on. If you turn the wifi on, the radio will turn on and the wifi will turn off. This is done by turning on the wifi and turning off the radio. If the WiFi is turned off, then the WiFi will turn back on, but the radio won't turn on. There are also other ways to turn off wifi, such as turning on wifi, or turning off wifi. I'm not sure how to explain this to a 5 year old, but I'll try to explain it to a five year old. I hope this helps! Edit: I forgot to mention that WiFi is not a wireless network, it is a network of wireless networks. WiFi networks are connected to the internet, but they are not connected to WiFi networks. The internet is connected to a WiFi network, but it isn't connected to Wifi networks. They are connected by WiFi networks, but WiFi networks can not be connected to wifi networks. So, if you turn on WiFi, the WiFi network will be turned on and off. The WiFi network can be turned off by turning off WiFi, but not by turning it back on. How do they know exactly how tall Mt. Everest is? There are a lot of different ways to measure the height of an object. For example, you can measure the distance from the top of a mountain to the bottom of the mountain, and you can calculate the distance between the top and the mountain. The easiest way to do this is by measuring the angle between the mountain and the ground, and then measuring the height between the ground and the top. You can also measure the angle of the ground from the bottom to the top, and the height from the ground to the ground. The most common method is to use a ruler, which is a ruler that measures the length of the base of a piece of paper. The height of the top is measured in meters, and it's measured in feet. The simplest way to measure height is by using a ruler. A ruler is a measure of the distance to the base, and a ruler measures the height at which the base is measured. A good ruler is also a good ruler, but it's not a good one. It's a good measure of how far away a mountain is, and how far it is away from the base. The same is true for measuring height, but you can't measure it with a ruler because it's too far away. How/where was the first language invented? It wasn't until the late 19th century that the first language was invented. It was just a way for people to communicate with each other and to communicate. For example, if you were to talk to someone, they would talk to yo , but you wouldn't know what they were talking about. If you were talking to them, they'd talk to each other, but they'd never know what you're talking about, so they wouldn't be able to tell you what they're talking to. The same thing happens with languages. For instance, you might say "I 'm talking to you", but if you're not talking to me, you won't know how to say it. You might say, "I want to know you," but you don't know where you're going to be talking to, so you might not know what to say. But you might also say "you want to understand me," and so on. And so on and so forth. Eventually, people started to learn how to communicate, and eventually, they started to figure out how to use their own language to communicate in a way that they couldn't understand, and then they developed a new language that they didn't understand. It's like how you can tell a friend that you're in the middle of a conversation, and you can't tell them how to tell them that they're in a conversation. Figure 16: Example poor quality Question-Generated Answer pairs from the Seq2Seq multi-task model
1911.01055
1
1911
2019-11-04T07:15:05
On the Effectiveness of the Pooling Methods for Biomedical Relation Extraction with Deep Learning
[ "cs.CL" ]
Deep learning models have achieved state-of-the-art performances on many relation extraction datasets. A common element in these deep learning models involves the pooling mechanisms where a sequence of hidden vectors is aggregated to generate a single representation vector, serving as the features to perform prediction for RE. Unfortunately, the models in the literature tend to employ different strategies to perform pooling for RE, leading to the challenge to determine the best pooling mechanism for this problem, especially in the biomedical domain. In order to answer this question, in this work, we conduct a comprehensive study to evaluate the effectiveness of different pooling mechanisms for the deep learning models in biomedical RE. The experimental results suggest that dependency-based pooling is the best pooling strategy for RE in the biomedical domain, yielding the state-of-the-art performance on two benchmark datasets for this problem.
cs.CL
cs
On the Effectiveness of the Pooling Methods for Biomedical Relation Extraction with Deep Learning Tuan Ngo Nguyen†, Franck Dernoncourt‡ and Thien Huu Nguyen† † Department of Computer and Information Science, University of Oregon ‡ Adobe Research {tnguyen, thien}@cs.uoregon.edu, [email protected] 9 1 0 2 v o N 4 ] L C . s c [ 1 v 5 5 0 1 0 . 1 1 9 1 : v i X r a Abstract Deep learning models have achieved state-of- the-art performances on many relation extrac- tion datasets. A common element in these deep learning models involves the pooling mechanisms where a sequence of hidden vec- tors is aggregated to generate a single rep- resentation vector, serving as the features to perform prediction for RE. Unfortunately, the models in the literature tend to employ differ- ent strategies to perform pooling for RE, lead- ing to the challenge to determine the best pool- ing mechanism for this problem, especially in the biomedical domain. In order to an- swer this question, in this work, we conduct a comprehensive study to evaluate the effective- ness of different pooling mechanisms for the deep learning models in biomedical RE. The experimental results suggest that dependency- based pooling is the best pooling strategy for RE in the biomedical domain, yielding the state-of-the-art performance on two bench- mark datasets for this problem. 1 Introduction In order to analyze the entities in text, it is crucial to understand how the entities are related to each other in the documents. In the literature, this prob- lem is formalized as relation extraction (RE), an important task in information extraction. RE aims to identify the semantic relationships between two entity mentions within the same sentences in text. Due to its important applications on many areas of natural language processing (e.g., question an- swering, knowledge base construction), RE has been actively studied in the last decade, featuring a variety of feature-based or kernel-based models for this problem (Zelenko et al., 2002; Zhou et al., 2005; Bunescu and Mooney, 2005; Sun et al., 2011; Chan and Roth, 2010; Nguyen et al., 2009). Recently, the introduction of deep learning has produced a new generation of models for RE with the state-of-the-art performance on many different benchmark datasets (Zeng et al., 2014; dos Santos et al., 2015; Xu et al., 2015; Liu et al., 2015; Zhou et al., 2016; Wang et al., 2016; Zhang et al., 2017, 2018b). The advan- tage of deep learning over the previous approaches for RE is the ability to automatically learn ef- fective features for the sentences from data via various network architectures. The same trend has also been observed for RE in the biomedi- cal domain where deep learning is gaining more and more attention from the research commu- nity (Mehryary et al., 2016; Bjorne and Salakoski, 2018; Nguyen and Verspoor, 2018; Verga et al., 2018). 2015; Lin et al., The typical deep learning models for RE have involved Convolutional Neural Networks (CNN) (Zeng et al., 2014; Nguyen and Grishman, 2015b; Zeng et al., 2016; Zeng et al., 2017), Recurrent Neural Networks (Miwa and Bansal, 2016; Zhang et al., (RNN), 2017), Transformer (self-attention) networks (Verga et al., 2018), and Graph Convolutional Neural Networks (GCNN) (Zhang et al., 2018b). There are two major common components in such deep learning models for RE, i.e., the represen- tation component and the pooling component. First, in the representation component, some deep learning architectures are employed to compute a sequence of vectors to represent an input sentence for RE for which each vector tends to capture the specific context information for a word in that sentence. Such word-specific representation sequence is then fed into the second pooling component (e.g., max pooling) that aggregates the representation vectors to obtain an overall vector to represent the whole input sentence for the classification problem in RE. While there have been many work in the liter- ature to compare different deep learning architec- tures for the representation component, the pos- sible methods for the pooling component of the deep learning models have not been systemati- cally benchmarked for RE in general and for the biomedical domain in particular. Specifically, the prior work on relation extraction with deep learn- ing has only assumed one form of pooling in the model without considering the possible alterna- tives for this component. In this work, we argue that the pooling mechanisms also have significant impact on the performance of the deep learning models for RE and it is important to understand how well different pooling methods perform in this case. Consequently, in this work, we conduct a comprehensive investigation on the effectiveness of different max pooling methods for the deep learning models of RE, focusing on the biomed- ical domain as the case study. Our goal is to deter- mine the best pooling methods for the deep learn- ing models in biomedical RE. We also want to em- phasize the experiments where the pooling meth- ods are compared in a compatible manner with the same representation components and resources for the biomedical RE models in this work. Such compatible comparison is unfortunately very rare in the current literature about deep learning for RE as new models are being intensively proposed, em- ploying a diversity of options and resources (i.e., pre-trained word embeddings, optimizers, etc.). Therefore, this is actually the first work to com- pare different pooling methods for deep relation extraction on the same setting. In the experiments, we find that syntactic in- formation (i.e., dependency parsing) can be ex- ploited to provide the best pooling strategies for biomedical RE. In fact, our experiments also sug- gest that it is more beneficial to apply the syntactic information in the pooling component of the deep learning models for biomedical RE than that in the representation component. This is different from most of the prior work on relation extraction that has only employed the syntactic information in the representation component of the deep learning models (Xu et al., 2016; Miwa and Bansal, 2016). Based on the syntax-based pooling mechanism, we achieve the state-of-the-art performance on two benchmark datasets for biomedical RE. 2 Model Relation Extraction can be seen as a multi-class classification problem that takes a sentence and two entity mentions of interest in that sentence as the input. The goal is to predict the semantic re- lation between these two entity mentions accord- ing to some predefined set of relations. Formally, let W = [w1, w2, . . . , wn] be the input sentence where n is the number of tokens and wi is the i- th word/token in W . As entity mentions can span multiple consecutive words/tokens, let [s1, e1] be the span of the first entity mention M1 where s1 and e1 are the indexes for the first and last token of M1 respectively. Similarly, we define [s2, e2] as the span for the second entity mention M2. For convenience, we assume that the entity mentions are not nested, i.e., 1 ≤ s1 ≤ e1 < s2 ≤ e2 ≤ n. 2.1 Input Vector Representation In order to encode the positions and the entity types of the two entity mentions in the input sen- tence, following (Zhang et al., 2018b), we first re- place the tokens in the entity mentions M1 and M2 with the special tokens of format M1-Type1 and M2-Type2 respectively (Type1 and Type2 represent the entity types of M1 and M2 respectively). The purpose of this replacement is to help the models to abstract from the specific tokens/words of the entity mentions and only focus on their positions and entity types, the two most important pieces of information of the entity mentions for RE. Given the enriched input sentence, the first step in the deep learning models for RE is to convert each word in the input sentence into a vector to fa- cilitate the real-valued computation of the models. In this work, the vector vi for wi is obtained by concatenating the following two vectors: 1. The word embeddings of wi: The embed- dings for the special tokens are initialized ran- domly while the embeddings for the other words are retrieved from the pre-trained word embedding table provided by the Word2Vec toolkit with 300 dimensions (Mikolov et al., 2013). 2. The embeddings for the part-of-speech (POS) tag of wi in W : We assign a POS tag for each word in the input sentence using the Stanford CoreNLP toolkit. The embedding for each POS tag is also randomly initialized in this case. Note that both the word embeddings and the POS embeddings are updated during the training time of the models in this work. The word-to- vector conversion transforms the input sentence W = [w1, w2, . . . , wn] into a sequence of vectors V = [v1, v2, . . . , vn] (respectively) that would be used as the input for all the deep learning mod- els considered in this work to ensure a compati- ble comparison. As mentioned in the introduction, the deep learning models for RE involves two ma- jor components, i.e., the representation component and the pooling component. We describe the op- tions for such components in the following sec- tions. 2.2 The Representation Component for RE Given the input sequence of vectors V = [v1, v2, . . . , vn], the next step in the deep learn- ing models for RE is to transform this vector se- quence into a more abstract vector sequence A = [a1, a2, . . . , an] so ai would capture the underly- ing representation for the context information spe- cific to the i-th word in the sentence. In this work, we examine the following typical architectures to obtain such an abstract sequence A for V : 1. CNN (Zeng et al., 2014; Nguyen and Grishman, 2015b; dos Santos et al., 2015): CNN is one of the early deep learning models for RE. It involves an 1D convolution layer over the input vector sequence V with mul- tiple window sizes for the filters. CNN produces a sequence of vectors in which each vector capture some n-grams specific to a word in the sentence. This sequence of vectors is used as A for our purpose. 2. BiLSTM (Nguyen and Grishman, 2015a): In BiLSTM, two Long-short Term Memory Networks (LSTM) are run over the input vector sequence V in the forward and backward direction. The hid- den vectors generated at the position i by the two networks are then concatenated to constitute the abstract vector ai for this position. Due to the recurrent nature, ai involves the context informa- tion over the whole input sentence W although a greater focus is put on the context of the current word. 3. BiLSTM-CNN: This models resembles the MASS model presented in (Le et al., 2018). It first applies a bidirectional LSTM layer over the input sequence V whose results are further processed by a Convolutional Neural Network (CNN) layer as in CNN. We also use the output of the CNN layer as the abstract vector sequence A for this model. 4. BiLSTM-GCNN (Zhang et al., 2018b): Simi- lar to BiLSTM-CNN, BiLSTM-GCNN also first em- ploys a bidirectional LSTM network to abstract the input vector sequence V . However, in the sec- ond step, different from BiLSTM-CNN, BiLSTM- GCNN introduces a Graph Convolutional Neural Network (GCNN) layer that consumes the LSTM hidden vectors and augments the representation for a word with the representation vectors of the surrounding words in the dependency trees. The output of the GCNN layer is also a sequence of vectors to represent the contexts for the words in the sentence and functions as the abstract sequence A in our case. BiLSTM-GCNN (Zhang et al., 2018b) is one of the current state-of-the-art mod- els for RE in the literature. Note that there are many other variants of such models for RE in the literature (Xu et al., 2016; Zhang et al., 2017; Verga et al., 2018). However, as our goal in this paper is to evaluate different pooling mechanisms for RE, we focus on these standard representation learning methods to avoid the confounding effect of the complicated models, thus better revealing the effectiveness of the pool- ing methods. 2.3 The Pooling Component for RE The goal of the pooling component is to ag- gregate the representation vectors in the abstract sequence A to constitute an overall vector F the whole input sentence W and to represent the two entity mentions of interest (i.e., F = aggregate(A)). The overall representation vec- tor should be able to capture the most impor- tant features induced in A. The typical method to achieve such aggregation in the RE models is to apply the element-wise max-pooling operation over subsets of vectors in A whose results are combined to obtain the overall representation vec- tor. While there are different methods to select the vector subsets for the max-pooling operation, the prior work for RE has only employed one particu- lar selection method in their deep learning mod- els (Nguyen and Grishman, 2015a; Zhang et al., 2018b; Le et al., 2018). This raises the ques- tion about the impact of the other subset selec- tion methods for such prior RE models. Can these methods benefit from different pooling mecha- nisms? What are the best pooling methods for the deep learning models in RE? In order to an- swer these questions, besides the architectures for the representation component in the previous sec- tion, we investigate the following subset selec- tion methods for the pooling component of the RE models in this work: 1. ENT-ONLY: In this pooling method, we use the subsets of the vectors corresponding to the words in the two entity mentions of interest in A for the max-pooling operations (i.e., M1 with the words in the range [s1, e1] and M2 with the words in the range [s2, e2]). This is motivated by the utmost importance of the two entity mentions of interest for RE and employed in some prior work (Nguyen and Grishman, 2015a; Zhang et al., 2018b): FM1 = max-pool (as1 , as1+1, . . . , ae1) FM2 = max-pool (as2 , as2+1, . . . , ae2) FEN T −ON LY = [FM1 , FM2 ] 2. ENT-SENT: Besides the entity mentions, the other context words in the sentence might also involve important information for the rela- tion prediction in RE. For instance, in the sentence "Acetazolamide can elevate cyclosporine levels.", the context word "elevate" is crucial to deter- mine the semantic relations between the two en- tity mentions of interest "Acetazolamide and "cy- closporine". In order to capture such important contexts for pooling, the typical approach in the prior work for RE is to perform the max-pooling operation over the abstract vectors for every word in the sentence (i.e., the whole set A) (Zeng et al., 2014; dos Santos et al., 2015; Le et al., 2018). The rationale is to select the features of the abstract vectors in A with the highest values in each di- mension to reveal the most important context for RE. The max-pooled vector over the whole set A is combined with the FEN T −ON LY vector in this method: FSEN T = max-pool (a1, a2, . . . , an) FEN T −SEN T = [FEN T −ON LY , FSEN T ] 3. ENT-DYM: Similar to ENT-SENT, this method also seeks the important context informa- tion beyond the two entity mentions of interest. However, instead of taking the whole vector se- quence A for the pooling, ENT-DYM divides A into three separate vector subsequences based on the start and end indexes of the first and second entity mentions (i.e., s1 and e2) respectively. The max-pooling operation is then applied over these three subsequences and the resulting vectors are combined to form an overall vector (i.e., dynamic pooling) (Zeng et al., 2015): FLEF T = max-pool (a1, a2, . . . , as1−1) FM IDDLE = max-pool (as1 , as1+1, . . . , ae2) FRIGHT = max-pool (ae2+1, ae2+2, . . . , an) FEN T −DY M = [FLEF T , FM IDDLE, FRIGHT , FEN T −ON LY ] 4. ENT-DEP0: The previous pooling methods have only relied on the sequential structures of the sentence where the chosen subsets of A for pooling always contain vectors for the consecu- tive words in the sentence. Unfortunately, such se- quential pooling might introduce irrelevant words into the selected subsets of A, potentially caus- ing noise in the pooling features and impeding the performance of the RE models. For instance, in the previous sentence example "Acetazolamide can elevate cyclosporine levels.", the ENT-SENT and ENT-DYM methods woulds also include the word "levels" in the pooling subsets that is not very important for the relation prediction in this case. Consequently, in ENT-DEP0, we explore the possibility to use the dependency parse tree of the input sentence W to filter out the irrele- vant words for the pooling operation. In particu- lar, instead of considering every word in the input sentence, ENT-DEP0 only pools over the abstract vectors in A that correspond to the words along the shortest dependency path (SDP) between the two entity mentions M1 and M2 in the dependency tree for W (called SDP 0(M1, M2)). Note that the shortest dependency paths have been shown to be able to select the important context words for RE in many previous work (Zhou et al., 2005; Chan and Roth, 2010; Xu et al., 2016). Similar to ENT-SENT and ENT-DYM, we also include FEN T −ON LY in this method: FDEP 0 = max-poolai∈SDP 0(M1,M2)(ai) FEN T −DEP 0 = [FDEP 0, FEN T −ON LY ] 5. ENT-DEP1: This method is similar to ENT-DEP0. However, instead of directly pool- ing over the words in the shortest dependency path SDP 0(M1, M2), ENT-DEP1 extends this path to also include every word that is connected to some word in SDP 0(M1, M2) via an edge in the de- pendency tree for W (i.e., one edge distance from SDP 0(M1, M2)). We denote this extended word set by SDP 1(M1, M2) for which the correspond- ing abstract vectors in A would be chosen for the max-pooling operation. The motivation for SDP 1(M1, M2) is that the representations of the words close to the shortest dependency path be- tween M1 and M2 might also provide useful infor- mation to improve the performance for RE. In our experiments, we find that one edge is the optimal distance to enlarge the shortest dependency paths. Using larger distance for the pooling mechanism would hurt the performance of the deep learning models for RE: FDEP 1 = max-poolai∈SDP 1(M1,M2)(ai) FEN T −DEP 1 = [FDEP 1, FEN T −ON LY ] Once the overall representation vector F for the input sentence W and the two entity men- tions of interest has been produced, we feed it into a feed-forward neural network with a softmax layer in the end to obtain the probability distribu- tion P (yW, M1, M2) = feed-forward(F ) over the possible relation types for our RE problem. This probability distribution would then be used for both making prediction (i.e., by taking the re- lation type with the highest probability) and train- ing models (i.e., by optimizing the negative log- likelihood function). 3 Experiments 3.1 Datasets In order to evaluate the performance of the models in this work, we employ the following biomedical datasets for RE in the experiments: DDI-2013 (Herrero-Zazo et al., 2013): This dataset contains 730 documents from the Drug- bank database, involving about 25,000 examples for the training and test sets (each example con- sists of a sentence and two entity mentions of in- terest for classification). There are 4 entity types (i.e., drug, brand, group and brand n) and 5 rela- tion types (i.e., mechanism, advise, effect, int, and no relation) in this dataset. The no relation is to indicate any example that does not belong to any relation types of interest. This dataset is severely imbalanced, containing 85% negative examples in the training dataset. In order to deal with such im- balanced data, we employ weighted sampling that equally distributes the selection probability for the positive and negative examples. BB3 (Del´eger et al., 2016). This dataset con- tains 95 documents; each of them involves a title and abstract from a document from the PubMed database. There are 800 examples in this dataset divided into two separate sets (i.e., the training set and the validation set). BB3 also include a test set; however, the relation types for the examples in this test set are not provided. In order to obtain the performance of the models on the test set, the performers need to submit their system outputs to an official API that would evaluate the output and return the model performance. We train the mod- els in this work on the training data and employ the official API to obtain their test set performance to be reported in the experiments for this dataset. Following the prior work on these datasets (Chowdhury and Lavelli, 2013; Lever and Jones, 2016; Zhou et al., 2018; Le et al., 2018), we use the micro-averaged F1 scores as the performance measure in the experiments to ensure a compatible comparison. 3.2 Parameters and Resources As the DDI-2013 dataset does not involve a de- velopment set, we tune the parameters for the models in this work based on the validation data of the BB3 dataset and use the selected param- eters for both datasets in the experiments. The best parameters from this tuning process include the learning rate of 0.5 and momentum of 0.8 for the stochastic gradient descent (SGD) optimizer with nesterov's momentum to optimize the mod- els. In order to regularize the models, we ap- ply dropout between layers with the drop rate for word embeddings set to 0.7 and other drop rates set to 0.5. We also employ the weight dropout DropConnect in (Wan et al., 2013) to regularize the hidden-to-hidden transition matrix within each bidirectional LSTM in the models (Merity et al., 2017). involve bidi- rectional LSTMs (i.e., BiLSTM, BiLSTM-CNN, and BiLSTM-GCNN), two layers of bidirectional LSTMs are utilized with 300 hidden units for each LSTM network. For the models with CNN com- ponents (i.e., CNN and BiLSTM-CNN), we use one CNN layer with multiple window sizes of 2, 3, 4, and 5 for the filters (200 filters for each window size). For the BiLSTM-GCN model, two GCNN layers are employed with 300 hidden units in each layer. Finally, for the final feed-forward neural network to compute the probability distribution (i.e., feed-forward), we utilize two hidden layers for which 1000 hidden units are used for the first layer and the number of hidden units for the sec- the models that For all ond layer is determined by the number of relation types in the datasets. 3.3 Evaluating the Pooling Methods for RE This section evaluates the performance of different pooling methods when they are applied to the deep learning models for RE on the two datasets DDI- 2013 and BB3. In particular, we integrate each of the pooling methods in Section 2.3 (i.e., ENT- ONLY, ENT-SENT, ENT-DYM, END-DEP0, and END-DEP1) into each of the deep learning models in Section 2.2 (i.e., CNN, BiLSTM, BiLSTM-CNN, and BiLSTM-GCN), resulting 20 different model combinations to be investigated in this section. For each model combination, we train five versions of the model with different random seeds for param- eter initialization over the training datasets. The performance of such versions over the test sets is averaged to serve as the overall model perfor- mance on the corresponding dataset. Tables 1 and 2 report the performance of the models on the DDI-2013 dataset and BB3 dataset respectively. Model CNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM-CNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM-GCNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 P R F1 54.2 55.0 54.6 55.9 55.7 58.9 60.7 50.2 51.6 54.7 56.4 53.6 47.1 55.9 54.1 62.7 58.4 56.8 55.6 54.4 65.7 62.5 53.3 65.8 67.7 59.6 59.2 66.0 78.0 72.6 66.2 69.2 78.0 71.4 74.7 56.1 58.7 58.4 67.4 71.1 59.1 59.1 53.5 60.6 61.1 59.2 59.9 56.9 61.9 62.4 60.8 60.5 58.7 62.5 62.4 58.9 58.5 56.6 60.8 61.5 Table 2: Results on BioNLP BB3 Model CNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM-CNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 BiLSTM-GCNN + ENT-ONLY + ENT-SENT + ENT-DYM + ENT-DEP0 + ENT-DEP1 P R F1 52.7 75.8 66.5 59.8 67.6 74.0 74.8 71.5 72.8 71.6 69.6 69.4 71.0 72.2 71.0 69.3 72.2 69.7 70.1 72.7 43.1 60.7 70.6 61.5 65.1 69.4 71.7 73.4 69.4 76.4 72.3 74.9 69.7 69.5 74.3 71.4 71.9 73.9 71.1 72.9 47.4 67.3 68.5 60.6 66.3 71.6 73.1 72.4 71.1 73.9 70.9 72.0 71.8 70.8 72.6 70.4 72.0 71.7 70.6 72.8 Table 1: Results on DDI 2013 From the tables, we have the following observa- tions about the effectiveness of the pooling meth- ods for RE with deep learning: 1. Comparing ENT-SENT, ENT-DYM and ENT- ONLY, we see that the pooling methods over the whole sentence (i.e., ENT-SENT and ENT-DYM) are significantly better than ENT-ONLY that only focuses on the two entity mentions of interest in the DDI-2013 dataset. This is true across differ- ent deep learning models in this work. However, this comparison is reversed for the BB3 dataset where ENT-ONLY is in general better or compa- rable to ENT-SENT and ENT-DYM over different deep learning models. We attribute such phenom- ena to the fact that the BB3 dataset often contains many entity mentions and relations within a single sentence (i.e., overlapping contexts) while the sen- tences in DDI-2013 tend to involve only a single relation with few entity mentions. This make ENT- SENT and ENT-DYM) ineffective for BB3 as the pooling mechanisms over the whole sentence are likely to involve the contexts for the other entity mentions and relations in the sentences, causing the low quality of the resulting representations and the confusion of the model for the relation predic- tion. This problem is less severe in DDI-2013 as the context of the whole sentence (with a single re- lation) is more aligned with the important context for the relation prediction. We call the many entity mentions and relations in a single single sentence of BB3 as the multiple relation effect for conve- nient discussion in this paper. 2. Comparing ENT-SENT and ENT-DYM, their performance are comparable in DDI-2013 (except for CNN where ENT-DYM is better); however, in the BB3 dataset, ENT-SENT singificantly outper- forms ENT-DYM over all the models. This sug- gests the amplification of the multiple relation ef- fect in BB3 due to ENT-DYM where the separation of the sentence context for pooling encourages the emergence of context information for multiple re- lations in the final representation vector and in- creases the confusion of the models. 3. Comparing the syntax-based pooling meth- ods and the non-syntax pooling methods, the pooling based on dependency paths (i.e., ENT- DEP0) is worse than the non-syntax pooling meth- ods (i.e., ENT-SENT and ENT-DYM) and perform comparably with ENT-ONLY in the DDI-2013 dataset over all the models (except for the CNN model where ENT-ONLY is much worse). These evidences suggest that the dependency paths them- selves are not able to capture effective contexts for the pooling operation beyond the entity mentions for biomedical RE in DDI-2013. However, when we switch to the BB3 dataset, it turns out that ENT-DEP0 is significantly better than all the non- syntax pooling methods (i.e., ENT-ONLY, ENT- SENT and ENT-DYM) for all the comparing mod- els. This can be explained by the multiple relation effect in BB3 for which the dependency paths help to identify the most related context words for the two given entity mentions and filter out the con- fusing context words for the other relations in the sentences. The models would thus become less confused with different contexts for multiple re- lations as those in ENT-SENT and ENT-DYM for better performance in this case. 4. Finally, among all the pooling methods, we find that ENT-DEP1 significantly outperforms the other pooling methods across different models and datasets (except the CNN model on DDI-2013 and BiLSTM on BB3). In particular, the perfor- mance improvement is substantial over the non- syntax pooling methods in BB3 where ENT-DEP1 is up to 2% better than ENT-SENT, ENT-DYM and ENT-ONLY on the absolute F1 scores. This helps to demonstrate the benefits of ENT-DEP1 for biomedical RE to both recognize the impor- tant context words for pooling in DDI-2013 and reduce the confusion effect of the multiple rela- tions in single sentences for the models in BB3. 3.4 Comparing the Deep Learning Models for RE Regarding the comparison among different deep learning models, the major observations from from Tables 1 and 2 include: 1. The performance of CNN is in general worse that the other models with the bidirectional LSTM components (i.e., BiLSTM, BiLSTM-CNN and BiLSTM-GCN) over different pooling meth- ods and datasets. This illustrates the importance of bidirectional LSTMs to capture the effective fea- ture representations for biomedical RE. 2. Comparing BiLSTM and BiLSTM-CNN, we find that BiLSTM is better in DDI-2013 while BiLSTM-CNN achieves better performance in BB3 (over different pooling methods). In other words, the CNN layer is only helpful for the BiLSTM model in the BB3 dataset. This can also be at- tributed to the multiple relation effect in BB3 where the CNN layer helps to further abstract the representations from BiLSTM to better reveal the underlying structures in such confusing and com- plicated contexts in the sentences of BB3 for RE. 3. Graph convolutions over the dependency trees are not effective for biomedical RE as in- corporating it into the BiLSTM model hurts the performance significantly. In particular, BiLSTM- GCNN is significantly worse than BiLSTM no mat- ter which pooling methods are applied and which datasets are used for evaluation. 4. Interestingly, comparing the BiLSTM model with the ENT-DEP1 pooling method (i.e., BiL- STM + ENT-DEP1) and the BiLSTM-GCN model with the non-syntax pooling methods (i.e., ENT- ONLY, ENT-SENT and ENT-DYM), we see that BiLSTM + ENT-DEP1 is significantly better with large performance gaps over both datasets DDI- 2013 and BB3. For example, BiLSTM + ENT- DEP1 is 1.9% better than BiLSTM-GCNN + ENT- SENT in the DDI-2013 dataset and 3.5% better than BiLSTM-GCNN + ENT-ONLY in BB3 with respect to the absolute F1 scores. In fact, BiL- STM + ENT-DEP1 also achieves the best perfor- mance among the compared models in this sec- tion for both datasets. The major difference be- tween BiLSTM + ENT-DEP1 and BiLSTM-GCN with the non-syntax pooling methods lies at the specific component of the models where the syn- tactic information (i.e., the dependency trees) is applied. In BiLSTM-GCN with the non-syntax pooling methods, the syntactic information is em- ployed in the representation learning component while in BiLSTM + ENT-DEP, the application of the syntactic information is postponed all the way to the pooling component. Our experiments thus demonstrate that it is more effective to utilize the syntactic information in the pooling component than in the representation learning component of the deep learning models for biomedical RE. This is an interesting and unique observation given that the prior work for RE has only focused on us- ing the syntactic information in the representation component and never explicitly investigated the effectiveness of the syntactic information for the pooling component of the deep learning models. 3.5 Comparing to the State-of-the-art Models In order to further demonstrate the advantage of the syntactic information for the pooling com- ponent for biomedical RE, this section compares BiLSTM + ENT-DEP1 (i.e., the best model with the ENT-DEP1 pooling in this work) with the best reported models on the two datasets DDI-2013 and BB3. For a fair comparison between models, we select the previous single (non-ensemble) models for the comparison in this section. Tables 3 and 4 presents the model performance. Models (Raihani and Laachfoubi, 2017) (Zhang et al., 2018a) (Zhou et al., 2018) (Bjorne and Salakoski, 2018) BiLSTM + ENT-DEP1 P 73.6 74.1 75.8 75.3 71.6 R 70.1 71.8 70.3 66.3 76.4 F1 71.8 72.9 73.0 70.5 73.9 Table 3: Comparison with the state-of-the-art systems on the DDI-2013 test set Models (Lever and Jones, 2016) (Mehryary et al., 2016) (Li et al., 2016) (Le et al., 2018) BiLSTM + ENT-DEP1 P 51.0 62.3 56.3 59.8 54.7 R 61.5 44.8 58.0 51.3 72.6 F1 55.8 52.1 57.1 55.2 62.4 Table 4: Comparison with the state-of-the-art systems on the BB3 test set The most important observation from the tables is that the BiLSTM model, once combined with the ENT-DEP1 pooling method, significantly outper- forms the previous models on DDI-2013 and BB3, establishing new state-of-the-art performance for these datasets. in the DDI-2013 dataset, BiLSTM + ENT-DEP1 is 0.9% better than the current state-of-the-art model in (Zhou et al., 2018) while the performance improvement over the best reported model for BB3 in (Li et al., 2016) is 5.3% (over the absolute F1 scores). Such sub- stantial improvement clearly demonstrates the ad- In particular, vantages of the syntactic information and its de- layed application in the pooling component of the deep learning models for biomedical RE. 4 Related Work Traditional work on RE has mostly used feature engineering with syntactical information for sta- tistical or kernel based classifiers (Zelenko et al., 2002; Zhou et al., 2005; Bunescu and Mooney, 2005; Sun et al., 2011; Chan and Roth, 2010). Re- cently, deep learning has been shown to advance many benchmark datasets for this RE problem due to its representation learning capacity. The typical architectures for such deep learning models in- volve CNN, LSTM, the attention mechanism and their variants (Zeng et al., 2014; dos Santos et al., 2015; Zhou et al., 2016; Wang et al., 2016; Nguyen and Grishman, 2015a; Miwa and Bansal, 2016; Zhang et al., 2017, 2018b). Deep learn- ing has also been applied to biomedical RE in the last couple of years and started to demonstrate much potentials area (Mehryary et al., 2016; Bjorne and Salakoski, 2018; Nguyen and Verspoor, 2018; Verga et al., 2018). this for Pooling is a common and crucial component in most of the deep learning models for RE. (Nguyen and Grishman, 2015b; dos Santos et al., 2015) apply the pooling operation over the whole sentence for RE while Zeng et al. (2015) proposes the dynamic pooling mechanism in the CNN mod- els. However, none of these prior work systemat- ically examines different pooling mechanisms for deep learning in RE as we do in this work. 5 Conclusion We conduct a comprehensive study on the effec- tiveness of different pooling mechanisms for the deep learning models in biomedical relation ex- traction. Our experiments suggest that the pooling mechanisms have a significant impact on the per- formance of the deep learning models and a care- ful evaluation should be done to decide the appro- priate pooling mechanism for the biomedical RE problem. From the experiments, we also find that syntactic information (i.e., dependency parsing) provides the best pooling methods for the mod- els and biomedical RE datasets we investigate in this work (i.e., ENT-DEP1). We achieve the state- of-the-art performance for biomedical RE over the two datasets DDI-2013 and BB3 with such syntax- based pooling methods. Yang Liu, Furu Wei, Sujian Li, Heng Ji, Ming Zhou, and Houfeng Wang. 2015. A dependency-based neural network for relation classification. arXiv preprint arXiv:1507.04646. References Farrokh Mehryary, Jari Bjorne, Sampo Pyysalo, 2016. Filip Ginter. and Salakoski, Tapio Deep Learning with Minimal Training Data: TurkuNLP Entry in the BioNLP Shared Task 2016. In Proceedings of pages 73 -- 81. the BioNLP 2016 Workshop, Jari Bjorne and Tapio Salakoski. 2018. Biomedical Event Extraction Using Convolutional Neural Net- works and Dependency Parsing. In Proceedings of the BioNLP 2018 Workshop, pages 98 -- 108. Razvan Bunescu and Raymond Mooney. 2005. A Shortest Path Dependency Kernel for Relation Ex- traction. In Proceedings of the EMNLP-HLT 2005, pages 724 -- 731. Yee S. Chan and Dan Roth. 2010. Exploiting back- ground knowledge for relation extraction. In COL- ING. Md Faisal Mahbub Chowdhury and Alberto Lavelli. 2013. FBK-irst : A Multi-Phase Kernel Based Approach for Drug-Drug Interaction Detection and Classification that Exploits Linguistic Information. In Proceedings of the Seventh International Work- shop on Semantic Evaluation, pages 351 -- 355. Louise Del´eger, Robert Bossy, Estelle Chaix, Mouhamadou Ba, Arnaud Ferr´e, Philippe Bessi`eres, and Claire N´edellec. 2016. Overview of the Bacte- ria Biotope Task at BioNLP Shared Task 2016. In Proceedings of the BioNLP 2016 Workshop, pages 12 -- 22. Cicero dos Santos, Bing Xiang, and Bowen Zhou. 2015. Classifying Relations by Ranking with Con- volutional Neural Networks. In Proceedings of the IJCNLP 2015, pages 626 -- 634. Stephen Nitish Merity, and Keskar, Regularizing and Optimizing LSTM Language Models. In Proceedings of the ICLR 2018. Richard Socher. Shirish 2017. Tomas Mikolov, and Kai Jeffrey rado, Efficient Estimation of Word Representations in Vector Space. arXiv:1301.3781 [cs]. Dean. Chen, Greg Cor- 2013. Makoto Miwa and Mohit Bansal. 2016. End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures. In Proceedings of the ACL 2016, pages 1105 -- 1116. Dat Quoc Nguyen and Karin Verspoor. 2018. Convolu- tional neural networks for chemical-disease relation extraction are improved with character-based word embeddings. In Proceedings of the BioNLP 2018 Workshop, pages 129 -- 136. Thien Huu Nguyen and Ralph Grishman. 2015a. Combining neural networks and log-linear mod- els to improve relation extraction. arXiv preprint arXiv:1511.05926. Thien Huu Nguyen and Ralph Grishman. 2015b. Re- lation Extraction: Perspective from Convolutional Neural Networks. In Proceedings of the 1st Work- shop on Vector Space Modeling for Natural Lan- guage Processing, pages 39 -- 48. Truc-Vien T. Nguyen, Alessandro Moschitti, and Giuseppe Riccardi. 2009. Convolution kernels on constituent, dependency and sequential structures for relation extraction. In EMNLP. Mar´ıa Herrero-Zazo, Segura-Bedmar, Paloma Mart´ınez, and Thierry Declerck. 2013. The DDI corpus: An annotated corpus with pharmacological substances and drug -- drug interactions. Journal of Biomedical Informatics, 46(5):914 -- 920. Isabel Hoang-Quynh Le, Duy-Cat Can, Sinh T. Vu, Thanh Hai Dang, Mohammad Taher Pilehvar, and Nigel Col- lier. 2018. Large-scale Exploration of Neural Rela- tion Classification Architectures. In Proceedings of the EMNLP 2018, pages 2266 -- 2277. Jake Lever and Steven JM Jones. 2016. VERSE: Event and Relation Extraction in the BioNLP 2016 Shared Task. In Proceedings of the BioNLP 2016 Work- shop, pages 42 -- 49. Anass Raihani and Nabil Laachfoubi. 2017. A Rich Feature-based Kernel Approach for Drug- Drug Interaction Extraction. In In Proceedings of the IJACSA 2017, volume 8. Ang Sun, Ralph Grishman, and Satoshi Sekine. 2011. Semi-supervised relation extraction with large-scale word clustering. In ACL. L. Li, and, and D. Huang McCallum. Biomedical event extraction via Long Short Term Memory networks along dynamic extended tree. In Proceedings of the IEEE-BIBM 2016, pages 739 -- 742. Patrick and Simultaneously Self-Attending to All Mentions for Full-Abstract Biological Relation Extraction. In Proceedings of the NAACL-HLT 2018, pages 872 -- 884. Strubell, 2018. Verga, Andrew Emma 2016. and. Yankai Lin, Shiqi Shen, Huanbo Luan, Neural Relation Extraction with Selective Attention over Instances. In Proceedings of the ACL 2016, pages 2124 -- 2133. and Maosong Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. 2013. Regularization of Neural Networks using DropConnect. In Proceedings of the ICML 2013, pages 1058 -- 1066. Zhiyuan Sun. Liu, 2016. Linlin Wang, Zhu Cao, de Melo, Relation Classification via Multi-Level Attention CNNs. In Proceedings of the ACL 2016, pages 1298 -- 1307. Zhiyuan Liu. and Gerard 2016. Peng Zhou, Wei Shi, Jun Tian, Zhenyu Qi, Bingchen Li, Hongwei Hao, and Bo Xu. 2016. Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification. In Proceedings of the ACL 2016, pages 207 -- 212. Yan Xu, Ran Jia, Lili Mou, Ge Li, Yunchuan Chen, Yangyang Lu, and Zhi Jin. 2016. Improved relation classification by deep recurrent neural networks with data augmentation. In Proceedings of the COLING 2016, pages 1461 -- 1470. Yan Xu, Lili Mou, Ge Li, Yunchuan 2015. Hao Peng, Chen, Classifying Relations via Long Short Term Memory Networks along Shortest Dependency Paths. In Proceedings of the EMNLP 2015, pages 1785 -- 1794. and Jin. Zhi Zelenko, Anthony Dmitry and Kernel Methods for Relation Extraction. Proceedings of the EMNLP 2002, pages 71 -- 78. Chinatsu Richardella. Aone, 2002. In Zeng, and Daojian Chen, Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks. In Proceedings of the EMNLP 2015, pages 1753 -- 1762. Liu, Zhao. Yubo 2015. Kang Jun Daojian Zeng, Kang Liu, Siwei Lai, Guangyou Zhou, and Jun Zhao. 2014. Relation Classification via Convolutional Deep Neural Network. In Proceed- ings of the COLING 2014, pages 2335 -- 2344. Wenyuan Zeng, and Yankai Maosong Lin, Zhiyuan 2017. Liu, Incorporating Relation Paths in Neural Relation Extraction. In Proceedings of the EMNLP 2017, pages 1768 -- 1777. Sun. Yijia Zhang, Wei Zheng, Hongfei Lin, Jian Wang, and Michel Dumontier. 2018a. Zhihao Yang, Drug-Drug Interaction Extraction Via Hierarchical Rnns on Sequence and Shortest Dependency Paths. Bioinformatics, 34(5):828 -- 835. Yuhao Zhang, Peng Qi, and Christopher D. Manning. 2018b. Graph Convolution over Pruned Depen- dency Trees Improves Relation Extraction. In Pro- ceedings of the EMNLP 2018, pages 2205 -- 2215. Yuhao Zhang, Victor Zhong, Danqi Chen, Ga- bor Angeli, and Christopher D. Manning. 2017. Position-aware Attention and Supervised Data Improve Slot Filling. In Proceedings of the EMNLP 2017, pages 35 -- 45. Deyu Zhou, Lei Miao, and Yulan He. 2018. Position-Aware Deep Multi-Task Learning for Drug -- Drug Interaction Extraction. Journal of Artificial Intelligence in Medicine, 87:1 -- 8. Zhou, and Guodong Zhang, Exploring Various Knowledge in Relation Extraction. In Proceedings of the ACL 2005, pages 427 -- 434. Su, Zhang. Jie 2005. Min Jian
1607.01149
1
1607
2016-07-05T08:51:21
Target-Side Context for Discriminative Models in Statistical Machine Translation
[ "cs.CL" ]
Discriminative translation models utilizing source context have been shown to help statistical machine translation performance. We propose a novel extension of this work using target context information. Surprisingly, we show that this model can be efficiently integrated directly in the decoding process. Our approach scales to large training data sizes and results in consistent improvements in translation quality on four language pairs. We also provide an analysis comparing the strengths of the baseline source-context model with our extended source-context and target-context model and we show that our extension allows us to better capture morphological coherence. Our work is freely available as part of Moses.
cs.CL
cs
Target-Side Context for Discriminative Models in Statistical Machine Translation Ales Tamchyna1,2, Alexander Fraser1, Ondrej Bojar2 and Marcin Junczys-Dowmunt3 1LMU Munich, Munich, Germany 2Charles University in Prague, Prague, Czech Republic 3Adam Mickiewicz University in Pozna´n, Pozna´n, Poland {tamchyna,bojar}@ufal.mff.cuni.cz [email protected] [email protected] 6 1 0 2 l u J 5 ] L C . s c [ 1 v 9 4 1 1 0 . 7 0 6 1 : v i X r a Abstract Discriminative translation models utiliz- ing source context have been shown to help statistical machine translation perfor- mance. We propose a novel extension of this work using target context information. Surprisingly, we show that this model can be efficiently integrated directly in the de- coding process. Our approach scales to large training data sizes and results in con- sistent improvements in translation qual- ity on four language pairs. We also pro- vide an analysis comparing the strengths of the baseline source-context model with our extended source-context and target- context model and we show that our ex- tension allows us to better capture mor- phological coherence. Our work is freely available as part of Moses. 1 Introduction Discriminative lexicons address some of the core challenges of phrase-based MT (PBMT) when translating to morphologically rich languages, such as Czech, namely sense disambiguation and morphological coherence. The first issue is se- mantic: given a source word or phrase, which of its possible meanings (i.e., which stem or lemma) should we choose? Previous work has shown that this can be addressed using a discriminative lex- icon. The second issue has to do with morphol- ogy (and syntax): given that we selected the cor- rect meaning, which of its inflected surface forms is appropriate? In this work, we integrate such a model directly into the SMT decoder. This enables our classifier to extract features not only from the full source sentence but also from a limited target- side context. This allows the model to not only help with semantics but also to improve morpho- logical and syntactic coherence. For sense disambiguation, source context is the main source of information, as has been shown in previous work (Vickrey et al., 2005), (Carpuat and Wu, 2007), (Gimpel and Smith, 2008) inter alia. Consider the first set of examples in Figure 1, pro- duced by a strong baseline PBMT system. The English word "shooting" has multiple senses when translated into Czech: it may either be the act of firing a weapon or making a film. When the cue word "film" is close, the phrase-based model is able to use it in one phrase with the ambiguous "shooting", disambiguating correctly the transla- tion. When we add a single word in between, the model fails to capture the relationship and the most frequent sense is selected instead. Wider source context information is required for correct disam- biguation. While word/phrase senses can usually be in- ferred from the source sentence, the correct se- lection of surface forms requires also information from the target. Note that we can obtain some information from the source. For example, an English subject is often translated into a Czech subject; in which case the Czech word should be in nominative case. But there are many deci- sions that happen during decoding which deter- mine morphological and syntactic properties of words -- verbs can have translations which differ in valency frames, they may be translated in either active or passive voice (in which case subject and object would be switched), nouns may have dif- ferent possible translations which differ in gender, etc. The correct selection of surface forms plays a crucial role in preserving meaning in morpho- logically rich languages because it is morphol- ogy rather than word order that expresses rela- tions between words. (Word order tends to be Input shooting of the film . shooting of the expensive film . the man saw a cat . the man saw a black cat . the man saw a yellowish cat . PBMT Output nat´acen´ı filmu . shootingcamera of film . strelby na drah´y film . shootingsgun at expensive film . muz uvidel kocku . man saw catacc . muz spatril cernou kocku . man saw blackacc catacc . muz spatril nazloutl´a kocka . man saw yellowishnom catnom .      Figure 1: Examples of problems of PBMT: lexical selection and morphological coherence. Each trans- lation has a corresponding gloss in italics. relatively free and driven more by semantic con- straints rather than syntactic constraints.) The language model is only partially able to capture this phenomenon. It has a limited scope and perhaps more seriously, it suffers from data sparsity. The units captured by both the phrase ta- ble and the LM are mere sequences of words. In order to estimate their probability, we need to ob- serve them in the training data (many times, if the estimates should be reliable). However, the num- ber of possible n-grams grows exponentially as we increase n, leading to unrealistic requirements on training data sizes. This implies that the current models can (and often do) miss relationships be- tween words even within their theoretical scope. The second set of sentences in Figure 1 demon- strates the problem of data sparsity for morpho- logical coherence. While the phrase-based sys- tem can correctly transfer the morphological case of "cat" and even "black cat", the less usual "yellowish cat" is mistranslated into nominative case, even though the correct phrase "yellowish nazloutlou" exists in the phrase table. A model with a suitable representation of two preceding words could easily infer the correct case in this example. Our contributions are the following: • We show that the addition of a feature-rich discriminative model significantly improves translation quality even for large data sizes and that target-side context information con- sistently further increases this improvement. • We provide an analysis of the outputs which confirms that source-context features indeed help with semantic disambiguation (as is well known). Importantly, we also show that our novel use of target context improves morpho- logical and syntactic coherence. • In addition to extensive experimentation on translation from English to Czech, we also evaluate English to German, English to Pol- ish and English to Romanian tasks, with im- provements on translation quality in all tasks, showing that our work is broadly applicable. • We describe several optimizations which al- low target-side features to be used efficiently in the context of phrase-based decoding. • Our implementation is freely available in the widely used open-source MT toolkit Moses, enabling other researchers to explore dis- criminative modelling with target context in MT. 2 Discriminative Model with Target-Side Context Several different ways of using feature-rich mod- els in MT have been proposed, see Section 6. We describe our approach in this section. 2.1 Model Definition Let f be the source sentence and e its translation. We denote source-side phrases (given a particular phrasal segmentation) ( ¯f1, . . . , ¯fm) and the indi- vidual words (f1, . . . , fn). We use a similar nota- tion for target-side words/phrases. For simplicity, let eprev, eprev−1 denote the words preceding the current target phrase. As- suming target context size of two, we model the following probability distribution: P (ef ) ∝ (cid:89) ( ¯ei, ¯fi)∈(e,f ) P ( ¯ei ¯fi, f, eprev, eprev−1) (1) The probability of a translation is the product of phrasal translation probabilities which are condi- tioned on the source phrase, the full source sen- tence and several previous target words. Let GEN( ¯fi) be the set of possible translations of the source phrase ¯fi according to the phrase table. We also define a "feature vector" function fv( ¯ei, ¯fi, f, eprev, eprev−1) which outputs a vector of features given the phrase pair and its context information. We also have a vector of feature weights w estimated from the training data. Then our model defines the phrasal translation probabil- ity simply as follows: P ( ¯ei ¯fi, f, eprev, eprev−1) exp(w · fv( ¯ei, ¯fi, f, eprev, eprev−1)) exp(w · fv( ¯e(cid:48), ¯fi, f, eprev, eprev−1)) (cid:80) = ¯e(cid:48)∈GEN( ¯fi) (2) This definition implies that we have to locally normalize the classifier outputs so that they sum to one. In PBMT, translations are usually scored by a log-linear model. Our classifier produces a single score (the conditional phrasal probability) which we add to the standard log-linear model as an addi- tional feature. The MT system therefore does not have direct access to the classifier features, only to the final score. 2.2 Global Model We use the Vowpal Wabbit (VW) classifier1 in this work. Tamchyna et al. (2014) already integrated VW into Moses. We started from their implemen- tation in order to carry out our work. Classifier features are divided into two "namespaces": • S. Features that do not depend on the current phrasal translation (i.e., source- and target- context features). • T. Features of the current phrasal translation. We make heavy use of feature processing avail- able in VW, namely quadratic feature expansions 1http://hunch.net/vw/ and label-dependent features. When generating features for a particular set of translations, we first create the shared features (in the namespace S). These only depend on (source and target) context and are therefore constant for all possible transla- tions of a given phrase. (Note that target-side con- text naturally depends on the current partial trans- lation. However, when we process the possible translations for a single source phrase, the target context is constant.) Then for each translation, we extract its features and store them in the namespace T . Note that we do not provide a label (or class) to VW -- it is up to these translation features to describe the target phrase. (And this is what is referred to as "label- dependent features" in VW.) Finally, we add the Cartesian product between the two namespaces to the feature set: every shared feature is combined with every translation feature. This setting allows us to train only a single, global model with powerful feature sharing. For example, thanks to the label-dependent format, we can decompose both the source phrase and the tar- get phrase into words and have features such as s cat t kocka which capture phrase-internal word translations. Predictions for rare phrase pairs are then more robust thanks to the rich statistics collected for these word-level feature pairs. 2.3 Extraction of Training Examples Discriminative models in MT are typically trained by creating one training instance per extracted phrase from the entire training data. The target side of the extracted phrase is a positive label, and all other phrases observed aligned to the extracted phrase (anywhere in the training data) are the neg- ative labels. We train our model in a similar fashion: for each sentence in the parallel training data, we look at all possible phrasal segmentations. Then for each source span, we create a training example. We ob- tain the set of possible translations GEN( ¯f ) from the phrase table. Because we do not have actual classes, each translation is defined by its label- dependent features and we associate a loss with it: 0 loss for the correct translation and 1 for all others. Because we train both our model and the stan- dard phrase table on the same dataset, we use leaving-one-out in the classifier training to avoid Feature Type Source Indicator Source Internal Source Context Target Context Czech f, l, l+t, t f, f+a, f+p, l, l+t, t, a+p f (-3,3), l (-3,3), t (-5,5) f (2), l (2), t (2), l+t (2) Bilingual Context -- Target Indicator Target Internal f, l, t f, l, l+t, t Configurations German f, l, l+t, t f, f+a, f+p, l, l+t, t, a+p f (-3,3), l (-3,3), t (-5,5) f (2), l (2), t (2), l+t (2) l+t/l+t (2) f, l, t f, l, l+t, t Polish, Romanian l, t l, l+a, l+p, t, a+p l (-3,3), t (-5,5) l (2), t (2) l+t/l+t (2) l, t l, t Table 1: List of used feature templates. Letter abbreviations refer to word factors: f (form), l (lemma), t (morphological tag), a (analytical function), p (lemma of dependency parent). Numbers in parentheses indicate context size. over-fitting. We look at phrase counts and co- occurrence counts in the training data, we subtract one from the number of occurrences for the cur- rent source phrase, target phrase and the phrase pair. If the count goes to zero, we skip the train- ing example. Without this technique, the classifier might learn to simply trust very long phrase pairs which were extracted from the same training sen- tence. For target-side context features, we simply use the true (gold) target context. This leads to train- ing which is similar to language model estima- tion; this model is somewhat similar to the neural joint model for MT (Devlin et al., 2014), but in our case implemented using a linear (maximum- entropy-like) model. 2.4 Training We use Vowpal Wabbit in the --csoaa ldf mc setting which reduces our multi-class problem to one-against-all binary classification. We use the logistic loss as our objective. We experimented with various settings of L2 regularization but were not able to get an improvement over not using reg- ularization at all. We train each model with 10 iterations over the data. We evaluate all of our models on a held-out set. We use the same dataset as for MT system tuning because it closely matches the domain of our test set. We evaluate model accuracy after each pass over the training data to detect over-fitting and we select the model with the highest held-out accu- racy. 2.5 Feature Set Our feature set requires some linguistic process- ing of the data. We use the factored MT setting (Koehn and Hoang, 2007) and we represent each type of information as an individual factor. On the source side, we use the word surface form, its lemma, morphological tag, analytical function (such as Subj for subjects) and the lemma of the parent node in the dependency parse tree. On the target side, we only use word lemmas and mor- phological tags. Table 1 lists our feature sets for each language pair. We implemented indicator features for both the source and target side; these are simply con- catenations of the words in the current phrase into a single feature. Internal features describe words within the current phrase. Context features are extracted either from a window of a fixed size around the current phrase (on the source side) or from a limited left-hand side context (on the tar- get side). Bilingual context features are concatena- tions of target-side context words and their source- side counterparts (according to word alignment); these features are similar to bilingual tokens in bilingual LMs (Niehues et al., 2011). Each of our feature types can be configured to look at any in- dividual factors or their combinations. The features in Table 1 are divided into three sets. The first set contains label-independent (=shared) features which only depend on the source sentence. The second set contains shared features which depend on target-side context; these can only be used when VW is applied dur- ing decoding. We use target context size two in all our experiments.2 Finally, the third set con- tains label-dependent features which describe the currently predicted phrasal translation. 2In preliminary experiments we found that using a single word was less effective and larger context did not bring im- provements, possibly because of over-fitting. Going back to the examples from Figure 1, our model can disambiguate the translation of "shoot- ing" based on the source-context features (either the full form or lemma). For the morphologi- cal disambiguation of the translation of "yellow- ish cat", the model has access to the morpholog- ical tags of the preceding target words which can disambiguate the correct morphological case. We used slightly different subsets of the full fea- ture set for different languages. In particular, we left out surface form features and/or bilingual fea- tures in some settings because they decreased per- formance, presumably due to over-fitting. 3 Efficient Implementation Originally, we assumed that using target-side con- text features in decoding would be too expen- sive, considering that we would have to query our model roughly as often as the language model. In preliminary experiments, we therefore focused on n-best list re-ranking. We obtained small gains but all of our results were substantially worse than with the integrated model, so we omit them from the paper. We find that decoding with a feature-rich target- context model is in fact feasible. In this section, we describe optimizations at different stages of our pipeline which make training and inference with our model practical. 3.1 Feature Extraction We implemented the code for feature extraction only once; identical code is used at training time and in decoding. At training time, the generated features are written into a file whereas at test time, they are fed directly into the classifier via its li- brary interface. This design decision not only ensures consis- tency in feature representation but also makes the process of feature extraction efficient. In training, we are easily able to use multi-threading (already implemented in Moses) and because the process- ing of training data is a trivially parallel task, we can also use distributed computation and run sep- arate instances of (multi-threaded) Moses on sev- eral machines. This enables us to easily produce training files from millions of parallel sentences within a short time. 3.2 Model Training VW is a very fast classifier by itself, however for very large data, its training can be further sped up by using parallelization. We take advantage of its implementation of the AllReduce scheme which we utilize in a grid engine environment. We shuf- fle and shard the data and then assign each shard to a worker job. With AllReduce, there is a master job which synchronizes the learned weight vector with all workers. We have compared this approach with the standard single-threaded, single-process training and found that we obtain identical model accuracy. We usually use around 10-20 training jobs. This way, we can process our large training files quickly and train the full model (using multi- ple passes over the data) within hours; effectively, neither feature extraction nor model training be- come a significant bottleneck in the full MT sys- tem training pipeline. 3.3 Decoding In phrase-based decoding, translation is generated from left to right. At each step, a partial transla- tion (initially empty) is extended by translating a previously uncovered part of the source sentence. There are typically many ways to translate each source span, which we refer to as translation op- tions. The decoding process gradually extends the generated partial translations until the whole source sentence is covered; the final translation is then the full translation hypothesis with the high- est model score. Various pruning strategies are ap- plied to make decoding tractable. Evaluating a feature-rich classifier during de- coding is a computationally expensive operation. Because the features in our model depend on target-side context, the feature function which computes the classifier score cannot evaluate the translation options in isolation (independently of the partial translation). Instead, similarly to a lan- guage model, it needs to look at previously gener- ated words. This also entails maintaining a state which captures the required context information. A naive integration of the classifier would sim- ply generate all source-context features, all target- context features and all features describing the translation option each time a partial hypothesis is evaluated. This is a computationally very expen- sive approach. We instead propose several technical solutions which make decoding reasonably fast. Decoding a single sentence with the naive approach takes 13.7 seconds on average. With our optimization, this average time is reduced to 2.9 seconds, i.e. almost by 80 per cent. The baseline system produces a translation in 0.8 seconds on average. Separation of source-context and target- context evaluation. Because we have a linear model, the final score is simply the dot product be- tween a weight vector and a (sparse) feature vec- tor. It is therefore trivial to separate it into two components: one that only contains features which depend on the source context and the other with target context features. We can pre-compute the source-context part of the score before decoding (once we have all translation options for the given sentence). We cache these partial scores and when the translation option is evaluated, we add the par- tial score of the target-context features to arrive at the final classifier score. Caching of feature hashes. VW uses feature hashing internally and it is possible to obtain the hash of any feature that we use. When we en- counter a previously unseen target context (=state) during decoding, we store the hashes of extracted features in a cache. Therefore for each context, we only run the expensive feature extraction once. Similarly, we pre-compute feature hash vectors for all translation options. Caching of final results. Our classifier locally normalizes the scores so that the probabilities of translations for a given span sum to one. This cannot be done without evaluating all translation options for the span at the same time. Therefore, when we get a translation option to be scored, we fetch all translation options for the given source span and evaluate all of them. We then normalize the scores and add them to a cache of final results. When the other translation options come up, their scores are simply fetched from the cache. This can also further save computation when we get into a previously seen state (from the point of view of our classifier) and we evaluate the same set of transla- tion options in that state; we will simply find the result in cache in such cases. When we combine all of these optimizations, we arrive at the query algorithm shown in Figure 2. 4 Experimental Evaluation We run the main set of experiments on English to Czech translation. To verify that our method is function EVALUATE(t, s) span = t.getSourceSpan() if not resultCache.has(span, s) then scores = () if not stateCache.has(s) then stateCache[s] = CtxFeatures(s) end if for all t(cid:48) ← span.tOpts() do srcScore = srcScoreCache[t(cid:48)] c.addFeatures(stateCache[s]) c.addFeatures(translationCache[t(cid:48)]) tgtScore = c.predict() scores[t(cid:48)] = srcScore + tgtScore end for normalize(scores) resultCache[span, s] = scores end if return resultCache[span, s][t] end function Figure 2: Algorithm for obtaining classifier pre- dictions during decoding. The variable t stands for the current translation, s is the current state and c is an instance of the classifier. applicable to other language pairs, we also present experiments in English to German, Polish, and Ro- manian. In all experiments, we use Treex (Popel and Zabokrtsk´y, 2010) to lemmatize and tag the source data and also to obtain dependency parses of all English sentences. 4.1 English-Czech Translation As parallel training data, we use (subsets of) the CzEng 1.0 corpus (Bojar et al., 2012). For tuning, we use the WMT13 test set (Bojar et al., 2013) and we evaluate the systems on the WMT14 test set (Bojar et al., 2014). We lemmatize and tag the Czech data using Morphodita (Strakov´a et al., 2014). Our baseline system is a standard phrase-based Moses setup. The phrase table in both cases is fac- tored and outputs also lemmas and morphological tags. We train a 5-gram LM on the target side of parallel data. We evaluate three settings in our experiments: • baseline -- vanilla phrase-based system, • +source -- our classifier with source-context features only, • +target -- our classifier with both source- context and target-context features. For each of these settings, we vary the size of the training data for our classifier, the phrase ta- ble and the LM. We experiment with three dif- ferent sizes: small (200 thousand sentence pairs), medium (5 million sentence pairs), and full (the whole CzEng corpus, over 14.8 million sentence pairs). For each setting, we run system weight opti- mization (tuning) using minimum error rate train- ing (Och, 2003) five times and report the aver- age BLEU score. We use MultEval (Clark et al., 2011) to compare the systems and to determine whether the differences in results are statistically significant. We always compare the baseline with +source and +source with +target. Table 2 shows the obtained results. Statisti- cally significant differences (α=0.01) are marked in bold. The source-context model does not help in the small data setting but brings a substantial im- provement of 0.7-0.8 BLEU points for the medium and full data settings, which is an encouraging re- sult. Target-side context information allows our model to push the translation quality further: even for the small data setting, it brings a substantial improvement of 0.5 BLEU points and the gain re- mains significant as the data size increases. Even in the full data setting, target-side features improve the score by roughly 0.2 BLEU points. Our results demonstrate that feature-rich mod- els scale to large data size both in terms of techni- cal feasibility and of translation quality improve- ments. Target side information seems consistently beneficial, adding further 0.2-0.5 BLEU points on top of the source-context model. data size baseline +source +target small medium full 16.7 10.7 17.3 10.7 11.2 17.5 15.2 16.0 16.4 Table 2: BLEU scores obtained on the WMT14 test set. We report the performance of the baseline, the source-context model and the full model. Intrinsic Evaluation. For completeness, we report intrinsic evaluation results. We evaluate the classifier on a held-out set (WMT13 test set) by extracting all phrase pairs from the test in- put aligned with the test reference (similarly as we would in training) and scoring each phrase pair (along with other possible translations of the source phrase) with our classifier. An instance is classified correctly if the true translation obtains the highest score by our model. A baseline which always chooses the most frequent phrasal trans- lation obtains accuracy of 51.5. For the source- context model, the held-out accuracy was 66.3, while the target context model achieved accuracy of 74.8. Note that this high difference is some- what misleading because in this setting, the target- context model has access to the true target context (i.e., it is cheating). 4.2 Additional Language Pairs We experiment with translation from English into German, Polish, and Romanian. Our English-German system is trained on the data available for the WMT14 translation task: Europarl (Koehn, 2005) and the Common Crawl corpus,3 roughly 4.3 million sentence pairs alto- gether. We tune the system on the WMT13 test set and we test on the WMT14 set. We use Tree- Tagger (Schmid, 1994) to lemmatize and tag the German data. English-Polish has not been included in WMT shared tasks so far, but was present as a language pair for several IWSLT editions which concentrate on TED talk translation. Full test sets are only available for 2010, 2011, and 2012. The refer- ences for 2013 and 2014 were not made public. We use the development set and test set from 2010 as development data for parameter tuning. The remaining two test sets (2011, 2012) are our test data. We train on the concatenation of Europarl and WIT3 (Cettolo et al., 2012), ca. 750 thousand sentence pairs. The Polish half has been tagged using WCRFT (Radziszewski, 2013) which pro- duces full morphological tags compatible with the NKJP tagset (Przepi´orkowski, 2009). English-Romanian was added in WMT16. We train our system using the available parallel data -- Europarl and SETIMES2 (Tiedemann, 2009), roughly 600 thousand sentence pairs. We tune the English-Romanian system on the official develop- ment set and we test on the WMT16 test set. We use the online tagger by Tufis et al. (2008) to pre- process the data. Table 3 shows the obtained results. Similarly to English-Czech experiments, BLEU scores are av- 3http://commoncrawl.org/ input: baseline: +source: +target: the most intensive mining took place there from 1953 to 1962 . nejv´ıce intenzivn´ı tezba doslo tam z roku 1953 , aby 1962 . the most intensive miningnom there occurred there from 1953 , in order to 1962 . nejv´ıce intenzivn´ı tezby m´ısto tam z roku 1953 do roku 1962 . the most intensive mininggen place there from year 1953 until year 1962 . nejv´ıce intenzivn´ı tezba prob´ıhala od roku 1953 do roku 1962 . the most intensive miningnom occurred from year 1953 until year 1962 . Figure 3: An example sentence from the test set. Each translation has a corresponding gloss in italics. Errors are marked in bold. language baseline +target de 15.7 16.2 pl (2011) pl (2012) 12.8 13.4 10.4 11.1 ro 19.6 20.2 Table 3: BLEU scores of the baseline and of the full model for English to German, Polish, and Ro- manian. eraged over 5 independent optimization runs. Our system outperforms the baseline by 0.5-0.7 BLEU points in all cases, showing that the method is ap- plicable to other languages with rich morphology. 5 Analysis We manually analyze the outputs of English- Czech systems. Figure 3 shows an example sen- tence from the WMT14 test set translated by all the system variants. The baseline system makes an error in verb valency; the Czech verb "doslo" could be used but this verb already has an (im- plicit) subject and the translation of "mining" ("tezba") would have to be in a different case and at a different position in the sentence. The second error is more interesting, however: the baseline system fails to correctly identify the word sense of the particle "to" and translates it in the sense of purpose, as in "in order to". The source-context model takes the context (span of years) into con- sideration and correctly disambiguates the trans- lation of "to", choosing the temporal meaning. It still fails to translate the main verb correctly, though. Only the full model with target-context information is able to also correctly translate the verb and inflect its arguments according to their roles in the valency frame. The translation pro- duced by this final system in this case is almost flawless. In order to verify that the automatically mea- sured results correspond to visible improvements in translation quality, we carried out two annota- tion experiments. We took a random sample of 104 sentences from the test set and blindly ranked two competing translations (the selection of sen- tences was identical for both experiments). In the first experiment, we compared the baseline sys- tem with +source. In the other experiment, we compared the baseline with +target. The instruc- tions for annotation were simply to compare over- all translation quality; we did not ask the annota- tor to look for any specific phenomena. In terms of automatic measures, our selection has similar characteristics as the full test set: BLEU scores obtained on our sample are 15.08, 16.22 and 16.53 for the baseline, +source and +target respectively. In the first case, the annotator marked 52 trans- lations as equal in quality, 26 translations pro- duced by +source were marked as better and in the remaining 26 cases, the baseline won the rank- ing. Even though there is a difference in BLEU, human annotation does not confirm this measure- ment, ranking both systems equally. In the second experiment, 52 translations were again marked as equal. In 34 cases, +target pro- duced a better translation while in 18 cases, the baseline output won. The difference between the baseline and +target suggests that the target- context model may provide information which is useful for translation quality as perceived by hu- mans. Our overall impression from looking at the sys- tem outputs was that both the source-context and target-context model tend to fix many morpho- syntactic errors. Interestingly, we do not observe as many improvements in the word/phrase sense disambiguation, though the source context does help semantics in some sentences. The target- context model tends to preserve the overall agree- ment and coherence better than the system with a source-context model only. We list several such examples in Figure 4. Each of them is fully cor- input: +source: +target: input: +source: +target: input: +source: +target: destruction of the equipment means that Syria can no longer produce new chemical weapons . znicen´ım zar´ızen´ı znamen´a , ze S´yrie jiz nemuze vytv´aret nov´e chemick´e zbrane . destruction ofinstr equipment means , that Syria already cannot produce new chemical weapons . znicen´ı zar´ızen´ı znamen´a , ze S´yrie jiz nemuze vytv´aret nov´e chemick´e zbrane . destruction ofnom equipment means , that Syria already cannot produce new chemical weapons . nothing like that existed , and despite that we knew far more about each other . nic takov´eho neexistovalo , a presto jsme vedeli daleko v´ıc o jeden na druh´eho . nothing like that existed , and despite that we knew far more about onenom on other . nic takov´eho neexistovalo , a presto jsme vedeli daleko v´ıc o sobe navz´ajem . nothing like that existed , and despite that we knew far more about each other . the authors have been inspired by their neighbours . autori byli inspirov´ani sv´ych sousedu . the authors have been inspired theirgen neighboursgen . autori byli inspirov´ani sv´ymi sousedy . the authors have been inspired theirinstr neighboursinstr . Figure 4: Example sentences from the test set showing improvements in morphological coherence. Each translation has a corresponding gloss in italics. Errors are marked in bold. rected by the target-context model, producing an accurate translation of the input. 6 Related Work Discriminative models in MT have been proposed before. Carpuat and Wu (2007) trained a maxi- mum entropy classifier for each source phrase type which used source context information to disam- biguate its translations. The models did not cap- ture target-side information and they were inde- pendent; no parameters were shared between clas- sifiers for different phrases. They used a strong feature set originally developed for word sense disambiguation. Gimpel and Smith (2008) also used wider source-context information but did not train a classifier; instead, the features were in- cluded directly in the log-linear model of the de- coder. Mauser et al. (2009) introduced the "dis- criminative word lexicon" and trained a binary classifier for each target word, using as features only the bag of words (from the whole source sen- tence). Training sentences where the target word occurred were used as positive examples, other sentences served as negative examples. Jeong et al. (2010) proposed a discriminative lexicon with a rich feature set tailored to translation into mor- phologically rich languages; unlike our work, their model only used source-context features. Subotin (2011) included target-side context in- formation in a maximum-entropy model for the prediction of morphology. The work was done within the paradigm of hierarchical PBMT and as- sumes that cube pruning is used in decoding. Their algorithm was tailored to the specific problem of passing non-local information about morphologi- cal agreement required by individual rules (such as explicit rules enforcing subject-verb agreement). Our algorithm only assumes that hypotheses are constructed left to right and provides a general way for including target context information in the classifier, regardless of the type of features. Our implementation is freely available and can be fur- ther extended by other researchers in the future. 7 Conclusions We presented a discriminative model for MT which uses both source and target context infor- mation. We have shown that such a model can be used directly during decoding in a relatively efficient way. We have shown that this model consistently significantly improves the quality of English-Czech translation over a strong baseline with large training data. We have validated the ef- fectiveness of our model on several additional lan- guage pairs. We have provided an analysis show- ing concrete examples of improved lexical selec- tion and morphological coherence. Our work is available in the main branch of Moses for use by other researchers. Acknowledgements This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements no. 644402 (HimL) and 645452 (QT21), from the European Research Council (ERC) under grant agreement no. 640550, and from the SVV project num- ber 260 333. This work has been using lan- guage resources stored and distributed by the LIN- DAT/CLARIN project of the Ministry of Edu- cation, Youth and Sports of the Czech Republic (project LM2015071). References Ondrej Bojar, Zdenek Zabokrtsk´y, Ondrej Dusek, Pe- tra Galusc´akov´a, Martin Majlis, David Marecek, Jir´ı Mars´ık, Michal Nov´ak, Martin Popel, and Ales Tam- chyna. 2012. The Joy of Parallelism with CzEng 1.0. In Proc. of LREC, pages 3921 -- 3928. ELRA. Ondrej Bojar, Christian Buck, Chris Callison-Burch, Christian Federmann, Barry Haddow, Philipp Koehn, Christof Monz, Matt Post, Radu Soricut, and Lucia Specia. 2013. Findings of the 2013 Work- In Pro- shop on Statistical Machine Translation. ceedings of the Eighth Workshop on Statistical Ma- chine Translation, pages 1 -- 44, Sofia, Bulgaria, Au- gust. Association for Computational Linguistics. Ondrej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Ales Tamchyna. 2014. Findings of the 2014 workshop on statistical machine translation. In Proceedings of the Ninth Workshop on Statistical Machine Transla- tion, pages 12 -- 58, Baltimore, MD, USA. Associa- tion for Computational Linguistics. Marine Carpuat and Dekai Wu. 2007. Improving sta- tistical machine translation using word sense dis- ambiguation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), Prague, Czech Republic. Mauro Cettolo, Christian Girardi, and Marcello Fed- erico. 2012. Wit3: Web inventory of transcribed and translated talks. In Proceedings of the 16th Con- ference of the European Association for Machine Translation (EAMT), pages 261 -- 268, Trento, Italy, May. Jonathan H. Clark, Chris Dyer, Alon Lavie, and Noah A. Smith. 2011. Better hypothesis testing for statistical machine translation: Controlling for opti- mizer instability. In Proceedings of the 49th Annual Meeting of the Association for Computational Lin- guistics: Human Language Technologies: Short Pa- pers - Volume 2, HLT '11, pages 176 -- 181, Strouds- burg, PA, USA. Association for Computational Lin- guistics. Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard M. Schwartz, and John Makhoul. 2014. Fast and robust neural network joint models In Proceedings for statistical machine translation. of the 52nd Annual Meeting of the Association for Computational Linguistics, ACL 2014, June 22-27, 2014, Baltimore, MD, USA, Volume 1: Long Papers, pages 1370 -- 1380. K. Gimpel and N. A. Smith. 2008. Rich Source-Side Context for Statistical Machine Translation. Colum- bus, Ohio. Minwoo Jeong, Kristina Toutanova, Hisami Suzuki, and Chris Quirk. 2010. A discriminative lexicon model for complex morphology. In The Ninth Con- ference of the Association for Machine Translation in the Americas. Association for Computational Lin- guistics, November. Philipp Koehn and Hieu Hoang. 2007. Factored trans- In Proceedings of the 2007 Joint lation models. Conference on Empirical Methods in Natural Lan- guage Processing and Computational Natural Lan- guage Learning (EMNLP-CoNLL), pages 868 -- 876, Prague, Czech Republic, June. Association for Com- putational Linguistics. Philipp Koehn. 2005. Europarl: A Parallel Corpus for Statistical Machine Translation. In Conference Proceedings: the tenth Machine Translation Sum- mit, pages 79 -- 86, Phuket, Thailand. AAMT, AAMT. Arne Mauser, Sasa Hasan, and Hermann Ney. 2009. Extending Statistical Machine Translation with Dis- criminative and Trigger-Based Lexicon Models. pages 210 -- 218, Suntec, Singapore. Jan Niehues, Teresa Herrmann, Stephan Vogel, and Alex Waibel. 2011. Wider Context by Using Bilin- gual Language Models in Machine Translation. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pages 198 -- 206, Edinburgh, Scotland, July. Association for Computational Lin- guistics. Franz Josef Och. 2003. Minimum Error Rate Training in Statistical Machine Translation. In Proc. of ACL, pages 160 -- 167, Sapporo, Japan. ACL. Martin Popel and Zdenek Zabokrtsk´y. 2010. Tec- toMT: Modular NLP Framework. In Hrafn Lofts- son, Eirikur Rognvaldsson, and Sigrun Helgadottir, editors, IceTAL 2010, volume 6233 of Lecture Notes in Computer Science, pages 293 -- 304. Iceland Cen- tre for Language Technology (ICLT), Springer. Adam Przepi´orkowski. 2009. A comparison of two morphosyntactic tagsets of Polish. In Violetta Koseska-Toszewa, Ludmila Dimitrova, and Roman Roszko, editors, Representing Semantics in Digital Lexicography: Proceedings of MONDILEX Fourth Open Workshop, pages 138 -- 144, Warsaw. Adam Radziszewski. 2013. A tiered CRF tagger for Polish. In Robert Bembenik, Lukasz Skonieczny, Henryk Rybinski, Marzena Kryszkiewicz, and Intelligent Tools for Marek Niezgodka, editors, Building a Scientific Information Platform, volume 467 of Studies in Computational Intelligence, pages 215 -- 230. Springer. Helmut Schmid. 1994. Probabilistic part-of-speech tagging using decision trees. In International Con- ference on New Methods in Language Processing, pages 44 -- 49, Manchester, UK. Jana Strakov´a, Milan Straka, and Jan Hajic. 2014. Open-Source Tools for Morphology, Lemmatiza- tion, POS Tagging and Named Entity Recognition. In Proceedings of 52nd Annual Meeting of the As- sociation for Computational Linguistics: System Demonstrations, pages 13 -- 18, Baltimore, Mary- land, June. Association for Computational Linguis- tics. Michael Subotin. 2011. An exponential translation model for target language morphology. In The 49th Annual Meeting of the Association for Computa- tional Linguistics: Human Language Technologies, Proceedings of the Conference, 19-24 June, 2011, Portland, Oregon, USA, pages 230 -- 238. Ales Tamchyna, Fabienne Braune, Alexander Fraser, Marine Carpuat, Hal Daum´e III, and Chris Quirk. Integrating a discriminative clas- sifier into phrase-based and hierarchical decoding. The Prague Bulletin of Mathematical Linguistics, 101:29 -- 41. 2014. Jorg Tiedemann. 2009. News from OPUS - A col- lection of multilingual parallel corpora with tools and interfaces. In N. Nicolov, K. Bontcheva, G. Angelova, and R. Mitkov, editors, Recent Advances in Natural Language Processing, vol- ume V, pages 237 -- 248. John Benjamins, Amster- dam/Philadelphia, Borovets, Bulgaria. Dan Tufis, Radu Ion, Alexandru Ceausu, and Dan Ste- 2008. Racai's linguistic web services. fanescu. In Proceedings of the International Conference on Language Resources and Evaluation, LREC 2008, 26 May - 1 June 2008, Marrakech, Morocco. D. Vickrey, L. Biewald, M. Teyssier, and D. Koller. 2005. Word-Sense Disambiguation for Machine In Conference on Empirical Methods Translation. in Natural Language Processing (EMNLP), Vancou- ver, Canada, October.
1906.03088
1
1906
2019-06-07T13:31:09
Improving Relation Extraction by Pre-trained Language Representations
[ "cs.CL" ]
Current state-of-the-art relation extraction methods typically rely on a set of lexical, syntactic, and semantic features, explicitly computed in a pre-processing step. Training feature extraction models requires additional annotated language resources, which severely restricts the applicability and portability of relation extraction to novel languages. Similarly, pre-processing introduces an additional source of error. To address these limitations, we introduce TRE, a Transformer for Relation Extraction, extending the OpenAI Generative Pre-trained Transformer [Radford et al., 2018]. Unlike previous relation extraction models, TRE uses pre-trained deep language representations instead of explicit linguistic features to inform the relation classification and combines it with the self-attentive Transformer architecture to effectively model long-range dependencies between entity mentions. TRE allows us to learn implicit linguistic features solely from plain text corpora by unsupervised pre-training, before fine-tuning the learned language representations on the relation extraction task. TRE obtains a new state-of-the-art result on the TACRED and SemEval 2010 Task 8 datasets, achieving a test F1 of 67.4 and 87.1, respectively. Furthermore, we observe a significant increase in sample efficiency. With only 20% of the training examples, TRE matches the performance of our baselines and our model trained from scratch on 100% of the TACRED dataset. We open-source our trained models, experiments, and source code.
cs.CL
cs
Automated Knowledge Base Construction (2019) Conference paper Improving Relation Extraction by Pre-trained Language Representations Christoph Alt∗ Marc Hubner∗ Leonhard Hennig German Research Center for Artificial Intelligence (DFKI) Speech and Language Technology Lab, Alt-Moabit 91c, 10559 Berlin, Germany [email protected] [email protected] [email protected] Abstract Current state-of-the-art relation extraction methods typically rely on a set of lexical, syntactic, and semantic features, explicitly computed in a pre-processing step. Training feature extraction models requires additional annotated language resources, which severely restricts the applicability and portability of relation extraction to novel languages. Simi- larly, pre-processing introduces an additional source of error. To address these limitations, we introduce TRE, a Transformer for Relation Extraction, extending the OpenAI Gener- ative Pre-trained Transformer [Radford et al., 2018]. Unlike previous relation extraction models, TRE uses pre-trained deep language representations instead of explicit linguistic features to inform the relation classification and combines it with the self-attentive Trans- former architecture to effectively model long-range dependencies between entity mentions. TRE allows us to learn implicit linguistic features solely from plain text corpora by unsuper- vised pre-training, before fine-tuning the learned language representations on the relation extraction task. TRE obtains a new state-of-the-art result on the TACRED and SemEval 2010 Task 8 datasets, achieving a test F1 of 67.4 and 87.1, respectively. Furthermore, we observe a significant increase in sample efficiency. With only 20% of the training examples, TRE matches the performance of our baselines and our model trained from scratch on 100% of the TACRED dataset. We open-source our experiments and code1. 1. Introduction Relation extraction aims to identify the relationship between two nominals, typically in the context of a sentence, making it essential to natural language understanding. Consequently, it is a key component of many natural language processing applications, such as information extraction [Fader et al., 2011], knowledge base population [Ji and Grishman, 2011], and question answering [Yu et al., 2017]. Table 1 lists exemplary relation mentions. State-of-the-art relation extraction models, traditional feature-based and current neu- ral methods, typically rely on explicit linguistic features: prefix and morphological fea- tures [Mintz et al., 2009], syntactic features such as part-of-speech tags [Zeng et al., 2014], and semantic features like named entity tags and WordNet hypernyms [Xu et al., 2016]. Most recently, Zhang et al. [2018] combined dependency parse features with graph con- volutional neural networks to considerably increase the performance of relation extraction systems. ∗. equal contribution 1. https://github.com/DFKI-NLP/TRE 9 1 0 2 n u J 7 ] L C . s c [ 1 v 8 8 0 3 0 . 6 0 9 1 : v i X r a Alt, Hubner, & Hennig Sentence Mr. Scheider played the police chief of a resort town menaced by a shark. The measure included Aerolineas's domestic subsidiary, Austral. Yolanda King died last May of an apparent heart attack. The key was in a chest. The car left the plant. Branches overhang the roof of this house. Subject Scheider Object police chief Relation per:title Aerolineas Austral org:subsidiaries Yolanda King heart attack per:cause of death key car roof chest plant house Content-Container Entity-Origin Component-Whole Table 1: Relation extraction examples, taken from TACRED (1-3) and SemEval 2010 Task 8 (4-6). TACRED relation types mostly focus on named entities, whereas SemEval contains semantic relations between concepts. However, relying on explicit linguistic features severely restricts the applicability and portability of relation extraction to novel languages. Explicitly computing such features requires large amounts of annotated, language-specific resources for training; many un- available in non-English languages. Moreover, each feature extraction step introduces an additional source of error, possibly cascading over multiple steps. Deep language representa- tions, on the other hand, have shown to be a very effective form of unsupervised pre-training, yielding contextualized features that capture linguistic properties and benefit downstream natural language understanding tasks, such as semantic role labeling, coreference resolution, and sentiment analysis [Peters et al., 2018]. Similarly, fine-tuning pre-trained language rep- resentations on a target task has shown to yield state-of-the-art performance on a variety of tasks, such as semantic textual similarity, textual entailment, and question answering [Rad- ford et al., 2018]. In addition, classifying complex relations requires a considerable amount of annotated training examples, which are time-consuming and costly to acquire. Howard and Ruder [2018] showed language model fine-tuning to be a sample efficient method that requires fewer labeled examples. Besides recurrent (RNN) and convolutional neural networks (CNN), the Transformer [Vaswani et al., 2017] is becoming a popular approach to learn deep language representa- tions. Its self-attentive structure allows it to capture long-range dependencies efficiently; demonstrated by the recent success in machine translation [Vaswani et al., 2017], text gen- eration [Liu et al., 2018], and question answering [Radford et al., 2018]. In this paper, we propose TRE: a Transformer based Relation Extraction model. Un- like previous methods, TRE uses deep language representations instead of explicit linguistic features to inform the relation classifier. Since language representations are learned by un- supervised language modeling, pre-training TRE only requires a plain text corpus instead of annotated language-specific resources. Fine-tuning TRE, and its representations, directly Improving Relation Extraction by Pre-trained Language Representations to the task minimizes explicit feature extraction, reducing the risk of error accumulation. Furthermore, an increased sample efficiency reduces the need for distant supervision meth- ods [Mintz et al., 2009, Riedel et al., 2010], allowing for simpler model architectures without task-specific modifications. The contributions of our paper are as follows: • We describe TRE, a Transformer based relation extraction model that, unlike previous methods, relies on deep language representations instead of explicit linguistic features. • We are the first to demonstrate the importance of pre-trained language representations in relation extraction, by outperforming state-of-the-art methods on two supervised datasets, TACRED and SemEval 2010 Task 8. • We report detailed ablations, demonstrating that pre-trained language representations prevent overfitting and achieve better generalization in the presence of complex entity mentions. Similarly, we demonstrate a considerable increase in sample efficiency over baseline methods. • We make our trained models, experiments, and source code available to facilitate wider adoption and further research. 2. TRE This section introduces TRE and its implementation. First, we cover the model architec- ture (Section 2.1) and input representation (Section 2.2), followed by the introduction of unsupervised pre-training of deep language model representations (Section 2.3). Finally, we present supervised fine-tuning on the relation extraction task (Section 2.4). 2.1 Model Architecture TRE is a multi-layer Transformer-Decoder [Liu et al., 2018], a decoder-only variant of the original Transformer [Vaswani et al., 2017]. As shown in Figure 1, the model repeat- edly encodes the given input representations over multiple layers (i.e., Transformer blocks), consisting of masked multi-headed self-attention followed by a position-wise feedforward operation: h0 = T We + Wp hl = transf ormer block(hl−1) ∀ l ∈ [1, L] (1) Where T = (t1, . . . , tk) is a sequence of token indices in a sentence2. We is the token embedding matrix, Wp is the positional embedding matrix, L is the number of Transformer blocks, and hl is the state at layer l. Since the Transformer has no implicit notion of token positions, the first layer adds a learned positional embedding ep ∈ Rd to each token t ∈ Rd at position p in the input sequence. The self-attentive architecture embedding ep allows an output state hp l of a block to be informed by all input states hl−1, which is key to efficiently model long-range dependencies. For language modeling, however, self-attention 2. In this work a "sentence" denotes an arbitrary span of contiguous text, rather than an actual linguistic sentence. For pre-training the input consists of multiple linguistic sentences, whereas relation extraction is applied to a single one. A "sequence" refers to the input token sequence. Alt, Hubner, & Hennig must be constrained (masked) not to attend to positions ahead of the current token. For a more exhaustive description of the architecture, we refer readers to Vaswani et al. [2017] and the excellent guide "The Annotated Transformer"3. Figure 1: (left) Transformer-Block architecture and training objectives. A Transformer- Block is applied at each of the L layers to produce states h1 to hL. (right) Rela- tion extraction requires a structured input for fine-tuning, with special delimiters to assign different meanings to parts of the input. 2.2 Input Representation Our input representation (see also Figure 1) encodes each sentence as a sequence of tokens. To make use of sub-word information, we tokenize the input text using byte pair encoding (BPE) [Sennrich et al., 2016]. The BPE algorithm creates a vocabulary of sub-word tokens, starting with single characters. Then, the algorithm iteratively merges the most frequently co-occurring tokens into a new token until a predefined vocabulary size is reached. For each token, we obtain its input representation by summing over the corresponding token embedding and positional embedding. While the model is pre-trained on plain text sentences, the relation extraction task requires a structured input, namely a sentence and relation arguments. To avoid task- specific changes to the architecture, we adopt a traversal-style approach similar to Radford et al. [2018]. The structured, task-specific input is converted to an ordered sequence to be directly fed into the model without architectural changes. Figure 1 provides a visual illustration of the input format. It starts with the tokens of both relation arguments a1 and a2, separated by delimiters, followed by the token sequence of the sentence containing the relation mention, and ends with a special classification token. The classification token signals the model to generate a sentence representation for relation classification. Since our 3. http://nlp.seas.harvard.edu/2018/04/03/attention.html Improving Relation Extraction by Pre-trained Language Representations model processes the input left-to-right, we add the relation arguments to the beginning, to bias the attention mechanism towards their token representation while processing the sentence's token sequence. 2.3 Unsupervised Pre-training of Language Representations Relation extraction models benefit from efficient representations of long-term dependencies [Zhang et al., 2018] and hierarchical relation types [Han et al., 2018]. Generative pre- training via a language model objective can be seen as an ideal task to learn deep language representations that capture important lexical, syntactic, and semantic features without supervision [Linzen et al., 2016, Radford et al., 2018, Howard and Ruder, 2018], before fine-tuning to the supervised task -- in our case relation extraction. Given a corpus C = {c1, . . . , cn} of tokens ci, the language modeling objective maximizes the likelihood L1(C) = log P (cici−1, . . . , ci−k; θ) (2) i where k is the context window considered for predicting the next token ci via the conditional probability P . TRE models the conditional probability by an output distribution over target tokens: P (c) = sof tmax(hLW T e ), (3) where hL is the sequence of states after the final layer L, We is the embedding matrix, and θ are the model parameters that are optimized by stochastic gradient descent. 2.4 Supervised Fine-tuning on Relation Extraction After pre-training with the objective in Eq. 2, the language model is fine-tuned on the relation extraction task. We assume a labeled dataset D = ([x1 i , ri), where each instance consists of an input sequence of tokens x1, . . . , xm, the positions of both relation arguments a1 and a2 in the sequence of tokens, and a corresponding relation label r. The input sequence is fed to the pre-trained model to obtain the final state representation hL. To compute the output distribution P (r) over relation labels, a linear layer followed by a softmax is applied to the last state hm L , which represents a summary of the input sequence: i , . . . , xm i ], a1 i , a2 (cid:88) P (rx1, . . . , xm) = sof tmax(hm L Wr) During fine-tuning we optimize the following objective: D(cid:88) i=1 L2(D) = log P (rix1 i , . . . , xm i ) According to Radford et al. [2018], introducing language modeling as an auxiliary objective during fine-tuning improves generalization and leads to faster convergence. Therefore, we adopt a similar objective: L(D) = λ ∗ L1(D) + L2(D), where λ is the language model weight, a scalar, weighting the contribution of the language model objective during fine-tuning. (4) (5) (6) Alt, Hubner, & Hennig 3. Experiment Setup We run experiments on two supervised relation extraction datasets: The recently published TACRED dataset [Zhang et al., 2017] and the SemEval dataset [Hendrickx et al., 2010]. We evaluate the PCNN implementation of Zeng et al. [2015]4 on the two datasets and use it as a state-of-the-art baseline in our analysis section. In the following we describe our experimental setup. 3.1 Datasets Table 2 shows key statistics of the TACRED and SemEval datasets. While TACRED is approximately 10x the size of SemEval 2010 Task 8, it contains a much higher fraction of negative training examples, which makes classification more challenging. Dataset TACRED SemEval 2010 Task 8 relation types 42 19 examples negative examples 106,264 10,717 79.5% 17.4% Table 2: Comparison of the datasets used for evaluation TACRED: The TAC Relation E xtraction Dataset [Zhang et al., 2017] contains 106k sentences with entity mention pairs collected from the TAC KBP evaluations5 2009 -- 2014, with the years 2009 to 2012 used for training, 2013 for evaluation, and 2014 for testing. Sentences are annotated with person- and organization-oriented relation types, e.g. per:title, org:founded, and no relation for negative examples. In contrast to the SemEval dataset the entity mentions are typed, with subjects classified into person and organization, and objects categorized into 16 fine-grained classes (e.g., date, location, title). As per convention, we report our results as micro-averaged F1 scores. Following the evaluation strategy of Zhang et al. [2017], we select our best model based on the median validation F1 score over 5 independent runs and report its performance on the test set. SemEval 2010 Task 8: The SemEval 2010 Task 8 dataset [Hendrickx et al., 2010] is a standard benchmark for binary relation classification, and contains 8,000 sentences for training, and 2,717 for testing. Sentences are annotated with a pair of untyped nominals and one of 9 directed semantic relation types, such as Cause-Effect, Entity-Origin, as well as the undirected Other type to indicate no relation, resulting in 19 distinct types in total. We follow the official convention and report macro-averaged F1 scores with directionality taken into account by averaging over 5 independent runs. The dataset is publicly available6 and we use the official scorer to compute our results. 3.2 Pre-training Since pre-training is computationally expensive, and our main goal is to show its effective- ness by fine-tuning on the relation extraction task, we reuse the language model7 published 4. https://github.com/thunlp/OpenNRE 5. https://tac.nist.gov/2017/KBP/index.html 6. https://drive.google.com/file/d/0B_jQiLugGTAkMDQ5ZjZiMTUtMzQ1Yy00YWNmLWJlZDYtOWY1ZDMwY2U4YjFk 7. https://github.com/openai/finetune-transformer-lm Improving Relation Extraction by Pre-trained Language Representations by Radford et al. [2018] for our experiments. The model was trained on the BooksCor- pus [Zhu et al., 2015], which contains around 7,000 unpublished books with a total of more than 800M words of different genres. It consists of L = 12 layers (blocks) with 12 attention heads and 768 dimensional states, and a feed-forward layer of 3072 dimensional states. We reuse the model's byte pair encoding vocabulary, containing 40,000 tokens, but extend it with task-specific ones (i.e., start, end, and delimiter tokens). Also, we use the learned positional embeddings with supported sequence lengths of up to 512 tokens. 3.3 Entity Masking We employ four different entity masking strategies. Entity masking allows us to investi- gate the model performance while providing limited information about entities, in order to prevent overfitting and allow for better generalization to unseen entities. It also enables us to analyze the impact of entity type and role features on the model's performance. For the simplest masking strategy UNK, we replace all entity mentions with a special unknown token. For the NE strategy, we replace each entity mention with its named entity type. Similarly, GR substitutes a mention with its grammatical role (subject or object). NE + GR combines both strategies. 3.4 Hyperparameter Settings and Optimization During our experiments we found the hyperparameters for fine-tuning, reported in [Radford et al., 2018], to be very effective. Therefore, unless specified otherwise, we used the Adam optimization scheme [Kingma and Ba, 2015] with β1 = 0.9, β2 = 0.999, a batch size of 8, and a linear learning rate decay schedule with warm-up over 0.2% of training updates. We apply residual, and classifier dropout with a rate of 0.1. Also, we experimented with token dropout, but did not find that it improved performance. Table 3 shows the best performing hyperparameter configuration for each dataset. On SemEval 2010 Task 8, we first split 800 examples of the training set for hyperparameter selection and retrained on the entire training set with the best parameter configuration. Epochs Learning Rate Warmup Learning Rate TACRED SemEval 3 3 5.25e-5 6.25e-5 2e-3 1e-3 λ Attn. Dropout 0.5 0.7 0.1 0.15 Table 3: Best hyperparameter configuration for TACRED and SemEval 4. Results This section presents our experimental results. We compare our TRE model to other works on the two benchmark datasets, demonstrating that it achieves state-of-the-art performance even without sophisticated linguistic features. We also provide results on model ablations and the effect of the proposed entity masking schemes. Alt, Hubner, & Hennig 4.1 TACRED On the TACRED dataset, TRE outperforms state-of-the-art single-model systems and achieves an F1 score of 67.4 (Table 4). Compared to SemEval, we observe methods to perform better that are able to model complex syntactic and long-range dependencies, such as PA-LSTM [Zhang et al., 2017] and C-GCN [Zhang et al., 2018]. Outperforming these methods highlights our model's ability to implicitly capture patterns similar to complex syntactic features, and also capture long-range dependencies. We would like to point out that the result was produced by the same "entity masking" strategy used in previous work [Zhang et al., 2017, 2018]. Similar to our NE + GR masking strategy, described in Section 3.3, we replace each entity mention by a special token; a combination of its named entity type and grammatical role. While we achieve state-of-the- art results by providing only named entity information, unmasked entity mentions decrease the score to 62.8, indicating overfitting and, consequently, difficulties to generalize to specific entity types. In Section 5.3, we analyze the effect of entity masking on task performance in more detail. System LR† Zhang et al. [2017] CNN† Zhang et al. [2017] Tree-LSTM† Zhang et al. [2018] PA-LSTM† Zhang et al. [2018] C-GCN† Zhang et al. [2018] TRE (ours) P 72.0 72.1 66.0 65.7 69.9 70.1 R F1 47.8 57.5 50.3 59.2 59.2 62.4 64.5 65.1 63.3 66.4 65.0 67.4 Table 4: TACRED single-model test set performance. We selected the hyperparameters using the validation set, and report the test score of the run with the median validation score among 5 randomly initialized runs. † marks results reported in the corresponding papers. 4.2 SemEval On the SemEval 2010 Task 8 dataset, the TRE model outperforms the best previously reported models, establishing a new state-of-the-art score of 87.1 F1 (Table 5). The result indicates that pre-training via a language modeling objective allows the model to implicitly capture useful linguistic properties for relation extraction, outperforming methods that rely on explicit lexical features (SVM [Rink and Harabagiu, 2010], RNN [Zhang and Wang, 2015]). Similarly, our model outperforms approaches that rely on explicit syntactic features such as the shortest dependency path and learned distributed representations of part-of- speech and named entity tags (e.g., BCRNN [Cai et al., 2016], DRNN [Xu et al., 2016], CGCN [Zhang et al., 2018]). Similar to Zhang et al. [2018], we observe a high correlation between entity mentions and relation labels. According to the authors, simplifying SemEval sentences in the training and validation set to just "subject and object", where "subject" and "object" are the actual entities, already achieves an F1 score of 65.1. To better evaluate our model's ability to Improving Relation Extraction by Pre-trained Language Representations System SVM† Rink and Harabagiu [2010] PA-LSTM† Zhang et al. [2018] C-GCN† Zhang et al. [2018] DRNN† Xu et al. [2016] BRCNN† Cai et al. [2016] PCNN Zeng et al. [2015] TRE (ours) P -- -- -- -- -- 86.7 88.0 F1 82.2 82.7 84.8 86.1 86.3 86.6 R -- -- -- -- -- 86.7 86.2 87.1 (±0.16) Table 5: SemEval single-model test set performance. † marks results reported in the corre- sponding papers. We report the mean and standard deviation across 5 randomly initialized runs. generalize beyond entity mentions, we substitute the entity mentions in the training set with a special unknown (UNK) token. The token simulates the presence of unseen entities and prevents overfitting to entity mentions that strongly correlate with specific relations. Our model achieves an F1 score of 79.1 (Table 6), an improvement of 2.6 points F1 score over System PA-LSTM† Zhang et al. [2018] C-GCN† Zhang et al. [2018] TRE (ours) P -- -- 80.3 F1 75.3 76.5 R -- -- 78.0 79.1 ( ± 0.37) Table 6: SemEval single-model test set performance with all entity mentions masked by an unknown (UNK) token. † marks results reported in the corresponding papers. Due to the small test set size, we report the mean and standard deviation across 5 randomly initialized runs. the previous state-of-the-art. The result suggests that pre-trained language representations improve our model's ability to generalize beyond the mention level when predicting the relation between two previously unseen entities. 5. Analysis & Ablation Studies Although we demonstrated strong empirical results, we have not yet isolated the contri- butions of specific parts of TRE. In this section, we perform ablation experiments to un- derstand the relative importance of each model component, followed by experiments to validate our claim that pre-trained language representations capture linguistic properties useful to relation extraction and also improve sample efficiency. We report our results on the predefined TACRED validation set and randomly select 800 examples of the SemEval training set as a validation set. Alt, Hubner, & Hennig 5.1 Effect of Pre-training Pre-training affects two major parts of our model: language representations and byte pair embeddings. In Table 7, we first compare a model that was fine-tuned using pre-trained representations to one that used randomly initialized language representations. On both datasets we observe fine-tuning to considerably benefit from pre-trained language represen- tations. For the SemEval dataset, the validation F1 score increases to 85.6 when using a pre-trained language model and no entity masking, compared to 75.6 without pre-training. We observe even more pronounced performance gains for the TACRED dataset, where us- ing a pre-trained language model increases the validation F1 score by 20 to 63.3. With entity masking, performance gains are slightly lower, at +8 on the SemEval dataset and +9.4 (UNK) respectively +3.8 (NE+GR) on the TACRED dataset. The larger effect of pre- training when entity mentions are not masked suggests that pre-training has a regularizing effect, preventing overfitting to specific mentions. In addition, the contextualized features allow the model to better adapt to complex entities. Our observations are consistent with the results of Howard and Ruder [2018], who observed that language model pre-training considerably improves text classification performance on small and medium-sized datasets, similar to ours. Best model -- w/o pre-trained LM -- w/o pre-trained LM and BPE SemEval None UNK 76.9 85.6 75.6 68.2 60.9 55.3 TACRED None UNK NE + GR 63.3 43.3 38.5 68.0 64.2 60.8 51.0 41.6 38.4 Table 7: Ablation with and without masked entities for SemEval (left) and TACRED val- idation set (right). We report F1 scores over 5 independent runs. In addition, we train a model from scratch without pre-trained byte pair embeddings. We keep the vocabulary of sub-word tokens fixed and randomly initialize the embeddings. Again, we observe both datasets to benefit from pre-trained byte-pair embeddings. Because of its small size, SemEval benefits more from pre-trained embeddings, as these can not be learned reliably from the small corpus. This increases the risk of overfitting to entity mentions, which can be seen in the lower performance compared to UNK masking, where entity mentions are not available. For the TACRED dataset, model performance drops by approximately 3 − 5% with and without entity masking when not using pre-trained byte pair embeddings. 5.2 Which Information is captured by Language Representations? Undoubtedly, entity type information is crucial to relation extraction. This is confirmed by the superior performance on TACRED (Table 7) when entity and grammatical role informa- tion is provided (NE+GR). The model achieves a validation F1 score of 68.0, compared to 63.3 without entity masking. Without pre-trained language representations, the model with NE+GR masking still manages to achieve a F1 score of 64.2. This suggests that pre-trained Improving Relation Extraction by Pre-trained Language Representations language representations capture features that are as informative as providing entity type and grammatical role information. This is also suggested by the work of Peters et al. [2018], who show that a language model captures syntactic and semantic information useful for a variety of natural language processing tasks such as part-of-speech tagging and word sense disambiguation. 5.3 Effect of Entity Masking Entity masking, as described in Section 3.3, can be used to limit the information about entity mentions available to our model and it is valuable in multiple ways. It can be used to simulate different scenarios, such as the presence of unseen entities, to prevent overfitting to specific entity mentions, and to focus more on context. Table 8 shows F1 scores on the TACRED validation dataset for different entity masking strategies. As we saw previously, masking with entity and grammatical role information yields the best overall performance, yielding a F1 score of 68.0. We find that using different masking strategies mostly impacts the recall, while precision tends to remain high, with the exception of the UNK masking strategy. When applying the UNK masking strategy, which does not provide any information about the entity mention, the F1 score drops to 51.0. Using grammatical role information considerably increases performance to an F1 score of 56.1. This suggests that either the semantic role type is a very helpful feature, or its importance lies in the fact that it provides robust information on where each argument entity is positioned in the input sentence. When using NE masking, we observe a significant increase in recall, which intuitively suggests a better generalization ability of the model. Combining NE masking with grammatical role information yields only a minor gain in recall, which increases from 65.3% to 67.2%, while precision stays at 68.8%. Entity Masking None UNK GR NE NE + GR Precision Recall 58.1 46.3 50.1 65.3 67.2 69.5 56.9 63.8 68.8 68.8 F1 63.3 51.0 56.1 67.0 68.0 Table 8: TACRED validation F1 scores for TACRED with different entity masking strate- gies. 5.4 Sample Efficiency We expect a pre-trained language model to allow for a more sample efficient fine-tuning on the relation extraction task. To assess our model's sample efficiency, we used stratified subsampling splits of the TACRED training set with sampling ratios from 10% to 100%. We trained the previously presented model variants on each split, and evaluated them on the complete validation set using micro-averaged F1 scores, averaging the scores over 5 runs. Alt, Hubner, & Hennig Figure 2: Micro-averaged F1 score on the validation set over increasing sampling ratios of the training set The results are shown in Figure 2. The best performing model uses a pre-trained language model combined with NE+GR masking, and performs consistently better than the other models. There is a steep performance increase in the first part of the curve, when only a small subset of the training examples is used. The model reaches an F1 score of more than 60 with only 20% of the training data, and continues to improve with more training data. The next best models are the TRE model without a pre-trained language model, and the TRE model without NE+GR masking. They perform very similar, which aligns well with our previous observations. The PCNN baseline performs well when masking is applied, but slightly drops in performance compared to the TRE models after 30% of training data, slowly approaching a performance plateau of around 61 F1 score. The PCNN baseline without masking performs worse, but improves steadily due to its low base score. The TRE model without a language model seems to overfit early and diminishes in performance with more than 70% training data. Interestingly, the performance of several models drops or stagnates after about 80% of the training data, which might indicate that these examples do not increase the models' regularization capabilities. Improving Relation Extraction by Pre-trained Language Representations 6. Related Work Relation Extraction Providing explicit linguistic features to inform the relation classi- fication is a common approach in relation extraction. Initial work used statistical classifiers or kernel based methods in combination with discrete syntactic features [Zelenko et al., 2003, Mintz et al., 2009, Hendrickx et al., 2010], such as part-of-speech and named entities tags, morphological features, and WordNet hypernyms. More recently, these methods have been superseded by neural networks, applied on a sequence of input tokens to classify the relation between two entities. Sequence based methods include recurrent [Socher et al., 2012, Zhang and Wang, 2015] and convolutional [Zeng et al., 2014, 2015] neural networks. With neural models, discrete features have been superseded by distributed representations of words and syntactic features [Turian et al., 2010, Pennington et al., 2014]. Xu et al. [2015a,b] integrated shortest dependency path (SDP) information into a LSTM-based rela- tion classification model. Considering the SDP is useful for relation classification, because it focuses on the action and agents in a sentence [Bunescu and Mooney, 2005, Socher et al., 2014]. Zhang et al. [2018] established a new state-of-the-art for relation extraction on the TACRED dataset by applying a combination of pruning and graph convolutions to the de- pendency tree. Recently, Verga et al. [2018] extended the Transformer architecture [Vaswani et al., 2017] by a custom architecture for biomedical named entity and relation extraction. In comparison, our approach uses pre-trained language representations and no architectural modifications between pre-training and task fine-tuning. Language Representations and Transfer Learning Deep language representations have shown to be a very effective form of unsupervised pre-training. [Peters et al., 2018] introduced embeddings from language models (ELMo), an approach to learn contextualized word representations by training a bidirectional LSTM to optimize a language model objec- tive. Peters et al. [2018] results show that replacing static pre-trained word vectors [Mikolov et al., 2013, Pennington et al., 2014] with contextualized word representations significantly improves performance on various natural language processing tasks, such as semantic simi- larity, coreference resolution, and semantic role labeling. Howard and Ruder [2018] showed language representations learned by unsupervised language modeling to significantly im- prove text classification performance, to prevent overfitting, and to also increase sample efficiency. [Radford et al., 2018] demonstrated that general-domain pre-training and task- specific fine-tuning, which our model is based on, achieves state-of-the-art results on several question answering, text classification, textual entailment, and semantic similarity tasks. 7. Conclusion We proposed TRE, a Transformer based relation extraction method that replaces explicit linguistic features, required by previous methods, with implicit features captured in pre- trained language representations. We showed that our model outperformes the state-of- the-art on two popular relation extraction datasets, TACRED and SemEval 2010 Task 8. We also found that pre-trained language representations drastically improve the sample efficiency of our approach. In our experiments we observed language representations to capture features very informative to the relation extraction task. Alt, Hubner, & Hennig While our results are strong, important future work is to further investigate the linguis- tic features that are captured by TRE. One question of interest is the extent of syntactic structure that is captured in language representations, compared to information provided by dependency parsing. Furthermore, our generic architecture enables us to integrate ad- ditional contextual information and background knowledge about entities, which could be used to further improve performance. Acknowledgments This research was partially supported by the German Federal Ministry of Education and Research through the projects DEEPLEE (01IW17001) and BBDC2 (01IS18025E), and by the German Federal Ministry of Transport and Digital Infrastructure through the project DAYSTREAM (19F2031A). References Razvan C. Bunescu and Raymond J. Mooney. A Shortest Path Dependency Kernel for Re- lation Extraction. In Proceedings of the Conference on Human Language Technology and Empirical Methods in Natural Language Processing, HLT '05, pages 724 -- 731. Associa- tion for Computational Linguistics, 2005. URL http://dx.doi.org/10.3115/1220575. 1220666. Rui Cai, Xiaodong Zhang, and Houfeng Wang. Bidirectional recurrent convolutional neural network for relation classification. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 756 -- 765. Association for Computational Linguistics, 2016. URL http://aclweb.org/anthology/ P16-1072. Anthony Fader, Stephen Soderland, and Oren Etzioni. Identifying relations for open in- formation extraction. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 1535 -- 1545. Association for Computational Linguis- tics, 2011. URL http://aclweb.org/anthology/D11-1142. Xu Han, Pengfei Yu, Zhiyuan Liu, Maosong Sun, and Peng Li. Hierarchical relation ex- traction with coarse-to-fine grained attention. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2236 -- 2245. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/D18-1247. Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid ´O S´eaghdha, Sebastian Pad´o, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. Semeval- 2010 task 8: Multi-way classification of semantic relations between pairs of nominals. In Proceedings of the 5th International Workshop on Semantic Evaluation, pages 33 -- 38. Association for Computational Linguistics, 2010. URL http://aclweb.org/anthology/ S10-1006. Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classi- fication. In Proceedings of the 56th Annual Meeting of the Association for Computational Improving Relation Extraction by Pre-trained Language Representations Linguistics (Volume 1: Long Papers), pages 328 -- 339. Association for Computational Lin- guistics, 2018. URL http://aclweb.org/anthology/P18-1031. Heng Ji and Ralph Grishman. Knowledge base population: Successful approaches and challenges. In Proceedings of the 49th Annual Meeting of the Association for Compu- tational Linguistics: Human Language Technologies, pages 1148 -- 1158. Association for Computational Linguistics, 2011. URL http://aclweb.org/anthology/P11-1115. Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In- ternational Conference on Learning Representations, abs/1412.6980, 2015. URL http: //arxiv.org/abs/1412.6980. Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntax-sensitive dependencies. Transactions of the Association for Computational Linguistics, pages 521 -- 535, 2016. URL http://aclweb.org/anthology/Q16-1037. Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. In Interna- tional Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id=Hyg0vbWC-. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. URL https: //arxiv.org/abs/1301.3781. Mike Mintz, Steven Bills, Rion Snow, and Daniel Jurafsky. Distant supervision for relation extraction without labeled data. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP, pages 1003 -- 1011. Association for Computational Linguistics, 2009. URL http://aclweb.org/anthology/P09-1113. Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532 -- 1543. Association for Computational Linguistics, 2014. URL http://aclweb.org/anthology/D14-1162. Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 2227 -- 2237. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/ N18-1202. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. language understanding by generative pre-training. proving 2018. https://s3-us-west-2.amazonaws.com/openai-assets/research-covers/ language-unsupervised/language_understanding_paper.pdf. Im- URL Alt, Hubner, & Hennig Sebastian Riedel, Limin Yao, and Andrew McCallum. Modeling relations and their mentions without labeled text. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 148 -- 163, 2010. Bryan Rink and Sanda Harabagiu. Utd: Classifying semantic relations by combining lexical and semantic resources. In Proceedings of the 5th International Workshop on Semantic Evaluation, pages 256 -- 259. Association for Computational Linguistics, 2010. URL http: //aclweb.org/anthology/S10-1057. Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715 -- 1725. Association for Computational Linguistics, 2016. URL http://aclweb.org/anthology/P16-1162. Richard Socher, Brody Huval, Christopher D. Manning, and Andrew Y. Ng. Semantic compositionality through recursive matrix-vector spaces. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 1201 -- 1211. Association for Computational Linguistics, 2012. URL http://aclweb.org/anthology/D12-1110. Richard Socher, Andrej Karpathy, Quoc V. Le, Christopher D. Manning, and Andrew Y. Ng. Grounded compositional semantics for finding and describing images with sentences. Transactions of the Association for Computational Linguistics, 2:207 -- 218, 2014. URL http://aclweb.org/anthology/Q14-1017. Joseph Turian, Lev-Arie Ratinov, and Yoshua Bengio. Word representations: A simple and general method for semi-supervised learning. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 384 -- 394. Association for Computational Linguistics, 2010. URL http://aclweb.org/anthology/P10-1040. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, In Ad- vances in Neural Information Processing Systems, pages 5998 -- 6008, 2017. URL https: //papers.nips.cc/paper/7181-attention-is-all-you-need.pdf. (cid:32)Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Patrick Verga, Emma Strubell, and Andrew McCallum. Simultaneously self-attending to all mentions for full-abstract biological relation extraction. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 872 -- 884. Association for Computational Linguistics, 2018. doi: 10.18653/v1/N18-1080. URL http://aclweb.org/anthology/N18-1080. Kun Xu, Yansong Feng, Songfang Huang, and Dongyan Zhao. Semantic relation clas- sification via convolutional neural networks with simple negative sampling. In Pro- ceedings of the 2015 Conference on Empirical Methods in Natural Language Process- ing, pages 536 -- 540. Association for Computational Linguistics, 2015a. URL http: //aclweb.org/anthology/D15-1062. Improving Relation Extraction by Pre-trained Language Representations Yan Xu, Lili Mou, Ge Li, Yunchuan Chen, Hao Peng, and Zhi Jin. Classifying relations via long short term memory networks along shortest dependency paths. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1785 -- 1794. Association for Computational Linguistics, 2015b. doi: 10.18653/v1/D15-1206. URL http://aclweb.org/anthology/D15-1206. Yan Xu, Ran Jia, Lili Mou, Ge Li, Yunchuan Chen, Yangyang Lu, and Zhi Jin. Improved relation classification by deep recurrent neural networks with data augmentation. In Proceedings of COLING 2016, the 26th International Conference on Computational Lin- guistics: Technical Papers, pages 1461 -- 1470. The COLING 2016 Organizing Committee, 2016. URL http://aclweb.org/anthology/C16-1138. Improved neural relation detection for knowledge base question answering. Mo Yu, Wenpeng Yin, Kazi Saidul Hasan, Cicero dos Santos, Bing Xiang, and Bowen Zhou. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 571 -- 581. Association for Computational Linguistics, 2017. doi: 10.18653/v1/P17-1053. URL http://aclweb.org/anthology/P17-1053. Dmitry Zelenko, Chinatsu Aone, and Anthony Richardella. Kernel Methods for Relation ISSN 1532-4435. URL http: Extraction. J. Mach. Learn. Res., 3:1083 -- 1106, 2003. //dl.acm.org/citation.cfm?id=944919.944964. Daojian Zeng, Kang Liu, Siwei Lai, Guangyou Zhou, and Jun Zhao. Relation classifica- tion via convolutional deep neural network. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Technical Papers, pages 2335 -- 2344. Dublin City University and Association for Computational Linguistics, 2014. URL http://aclweb.org/anthology/C14-1220. Daojian Zeng, Kang Liu, Yubo Chen, and Jun Zhao. Distant supervision for relation extrac- tion via piecewise convolutional neural networks. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1753 -- 1762. Association for Computational Linguistics, 2015. URL http://aclweb.org/anthology/D15-1203. Dongxu Zhang and Dong Wang. Relation classification via recurrent neural network. arXiv preprint arXiv:1508.01006, 2015. Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 35 -- 45. Association for Computational Linguistics, 2017. URL http://aclweb.org/anthology/ D17-1004. Yuhao Zhang, Peng Qi, and Christopher D. Manning. Graph convolution over pruned dependency trees improves relation extraction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2205 -- 2215. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/D18-1244. Alt, Hubner, & Hennig Yukun Zhu, Ryan Kiros, Richard S. Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual expla- nations by watching movies and reading books. 2015 IEEE International Conference on Computer Vision (ICCV), pages 19 -- 27, 2015.
1605.02945
2
1605
2016-05-11T17:20:26
The Yahoo Query Treebank, V. 1.0
[ "cs.CL", "cs.IR" ]
A description and annotation guidelines for the Yahoo Webscope release of Query Treebank, Version 1.0, May 2016.
cs.CL
cs
The Yahoo Query Treebank, V. 1.0 May 2016 Yuval Pinter Yahoo Research Roi Reichart Yahoo Research & Technion IIT Idan Szpektor Yahoo Research [email protected] [email protected] [email protected] 6 1 0 2 y a M 1 1 ] L C . s c [ 2 v 5 4 9 2 0 . 5 0 6 1 : v i X r a 1 General dataset release This accompanies Pinter et al. (2016) which describes the moti- vation and grammatical theory1. Please cite that paper when referencing the dataset. The dataset may be accessed via the Yahoo Webscope homepage2 under Linguistic Data as dataset L-28. The description in Section 2 is in- cluded within the dataset as a Readme. The dataset is sure to have annotation errors which are not covered by the special cases spec- ified in this document. Please approach the first author for any corrections and they will appear in the next release. See Section 4 for known errors. 2 Dataset Description User queries annotated for syntactic dependency parsing, version 1.0. These queries were issued on all search engines between 2012 and 2014 and led the searcher to click on a result link to a question page on the Yahoo Answers site3. 2.1 Full description This dataset contains two files: ydata-search-parsed-queries-dev-v1 0.txt 1,000 queries, 5,344 tokens ydata-search-parsed-queries-test-v1 0.txt 4,000 queries, 26,015 tokens These files differ in their level of annotation, but share the schema. They contain tab-delimited lines, each representing a single token in a Web query. The tokens in each query are given sequentially, and queries are given in order of an arbitrarily-selected numeric ID (with no empty lines between queries). The field schema is detailed in Table 1. 1This dataset is presented there in section 3.3. 2http://webscope.sandbox.yahoo.com 3http://answers.yahoo.com 183 183 183 183 - NN 2 1 SEG charter NN 0 2 school 3 SEG graduate VB 0 4 RB 3 early - nn root root advmod Table 2: A sample query (#183 in test set). root root nn advmod NN RB charter school graduate early NN VB Figure 1: Query #183 from the test set, tagged and parsed. An example query is brought in Table 2. These lines represent a query, whose ID in the 'test' set is 183, and whose raw form is charter school gradu- ate early. It is interpretable thus: the query is com- posed of two syntactic segments: [charter school] [graduate early]. In the first segment, the syntac- tic root is the noun school, and the noun charter modifies it in a nominal compound modifier rela- tion. The second segment is rooted by the verb graduate, modified by the adverb early in an ad- verbial modifier relation. A dependency tree cor- responding to this query is produced in Figure 1. 2.2 Linguistic pre-processing notes All queries were tokenized using the ClearNLP to- kenizer for English (Choi and McCallum, 2013) 4 and were not spell-corrected or filtered for adult content. initial quotes were replaced with backticks. When using off- the-shelf processing tools, we recommend to re- replace them in pre-processing. For Excel-friendliness, 4Version 2.0.1, from http://www.clearnlp.com Field # Field content 0 1 2 3 4 5 6 query-id token-in-query (starting with 1) segmentation marker ('SEG' iff token starts a new segment, '-' otherwise) token form token part-of-speech † index of syntactic head token, with 0 denoting root † dependency relation of edge from head token to this token † ‡ Table 1: Fields marked by † are not populated for the dev set in V 1.0; fields with ‡ are not fully populated in the test set. fanfiction website platforms rather than guest re- views written about pieces of fanfiction. Like- wise, in q.3013 [questionnaire] [assisted suicide] we treated assisted as an adjective relating to sui- cide rather than a main verb in a sentence describ- ing an unlikely scenario. Missing Auxiliary Verbs Another issue was certain constructions which may become a sen- tence by the addition of a copula or auxiliary verb. The guidelines stated that if the post-copular sequence describes an attribute of the semantic subject (pre-copula), it is considered the head of an adjunct phrase and shares its segment (e.g. q.2916 [paragraph describing a family], q.91.w.1- 4: [battery cables not tight]). If it is construed as a sentence missing an auxiliary, it is segmented away from the subject (e.g. q.475 [lab] [throwing up blood ?]). In a way, this is an explicit applica- tion of the constituency test described earlier. 3.2 Proper Names' Internal Structure The dataset contains many instances of product names followed by numbers denoting model (e.g. query 2347: how to replace crank sensor on 95 saab cs9000. The guidelines in these cases were to place the phrase head as the last alphabetic word (here, saab) and depend the post-modifier (cs9000) on it as an npadvmod. the1 call of 3 Annotation Guidelines The parse tree annotations followed the segmen- tation annotation. Both phases included super- vision over automatic part-of-speech tagging. In general, parse tree annotators were instructed to adhere to the Stanford Dependency guidelines (De Marneffe and Manning, 2008)5 with the nec- essary caveats that come with non-standard text prone to errors. Following are some selected issues which can be seen in the test dataset. Section 3.1 describes is- sues relating to segmentation tagging, and the sub- sequent subsections address issues of dependency edge attachment. 3.1 Segmentation Ambiguity Noun Strings The most difficult segmentation decisions have been in cases of long strings of nouns, both common and proper. The guideline is based on judgment, asking whether the phrase can stand as a constituent in a coherent sen- tence. For example, in query 116 words 1-3 are big mac cost, a phrase considered clunky as op- posed to the much-preferred cost of (a) big mac, resulting in the decision to segment it as [big mac] [cost]. A more clear-cut case is the segmenta- tion decision in q.284: [first day of missed pe- riod] [symptoms], where theoretically day could be tagged as a modifier phrase head of symptoms, but no imaginable well-formed sentence would use this formation as a constituent. Sometimes reasonable semantics forced us to conclude towards a segmentation decision over an unlikely (but syntactically well-formed) single- segment constituent. For example, in q.271 [fan- fiction] [guest reviews] we assume (and support this decision by running our own search) that the searcher was looking for guest reviews on query 3252: Long proper names with complex internal struc- tures were left as their underlying structures. E.g. the2 wild is parsed with call as the phrase head with a det preceding and a prep following, further decom- posed into pobj(of,wild) and det(wild,the2). How- ever, more trivial internal structures were flattened into the common proper name representation: q.3260, jeeves & wooster: nn(wooster,jeeves), nn(wooster,&). Nominal compounds were tagged as successive NNPs, e.g. q.3413, what cam- 5Version 3.5.2, from http://nlp.stanford.edu/software/dependencies_manual.pdf eras do they use in planet NNP earth NNP: nn(earth,planet). 3.3 Truncated Sentences Many of the queries in the dataset are in fact sen- tences aborted mid-way. Some because the query is a sentence-completion question (e.g. query 970 a major result of the european age of exploration was) and some for more opaque reasons (e.g. q.3828 why are russians so). In both these types, where the root of the sentence would normally lie in the missing complement, the root was assigned to the token nearest to it in the assumed full graph (was and so, respectively), with the other depen- dents collapsed unto it. The same goes for any phrase which is truncated before its grammatical head (e.g. q.3840) or mandatory complement (e.g. q.1861). 3.4 Foreign Languages The dataset contains several non-English queries that are treated as nonce (part-of-speech tag = 'FW', dependency relation = 'dep'). Their parse tree is, as a rule, a flat tree headed by the final word (proper name convention). E.g. q.3299, q.3319. Other cases where foreign words are tagged as 'FW' is when they function meta- linguistically. E.g. q.3472, what does baka FW mean in japanese. 3.5 Grammatical Errors By the nature of Web Queries being written in real time by users possessing diverse proficiency and competence, the dataset contains many grammat- ical errors (as well as typos – see Section 3.6). These were not corrected during pre-processing in order to maintain the authenticity of the data. The guidelines in such cases, unless re-segmentation was in order, called to retain as much of the in- tended structure as possible. in query 3274, word 4 part is meant to be parts and as such is tagged as a plural noun. In some cases, different parts of the sentence were fused together due to incorrect grammar. The solution was to rep- resent the fused token by the head of the intended phrase if it is fully contained within (e.g. q.3233, dogs for dog 's), or ignore a dependent if there is structural crossover (e.g. in q.3590, my sister in laws husband, the possessive 's was in effect ex- cluded from the tree). For example, Another common case was auxiliary deletion common in ESL writing, e.g. query 3949 why you study in university. Here we opted again for the intended meaning as a sentence missing the aux- iliary do rather than treating the full query as a constituent (adverbial clause, clausal complement, etc.) of a deleted governing predicate. 3.6 Typographical Errors In general, obvious typos were treated as the in- tended word whether they resulted in a legal En- glish word or not. E.g. q.3 w.13, trianlgle NN, or q.3786 w.5 if VBZ (for the intended is). Sometimes, typos result in word merge, in which case they were either POS-tagged as XX (e.g. q.252 w.3) or by the head if they can be construed as a coherent phrase (e.g. q.3115 w.1 search- where, which is probably a mis-concatenation of a meta-linguistic search with the first intended term where, and so analyzed as if it were the latter alone). Sometimes, extremely creative tokenization is employed by users. Behold the glory that is query 1814: green chemistry.in day today life. We parsed day today as if it were a noun phrase, and gave up representing the preposition in altogether. 3.7 BE-sentences Sentences with forms of the verb BE are often am- biguous between attributive sentences (where the BE-verb acts as copula to the head of the follow- ing phrase) and proper essential statements where BE is the main verb. We tended to go for the for- mer in case of ambiguity, excepting for very clear cases of essence (e.g. query 3264 the free market is a myth: root(ROOT,is)) and, of course, where the following can only be a clausal or prepositional complement (e.g. q.799 trouble is you think you have time, q.3593 what is on sheldons shirt in sea- son 1 episode 4). 4 Known Annotation Errors 4.1 Segmentation Errors Test set: Query ID V 1.0 Correct 194 304 325 362 425 847 911 3779 1147 1812 2784 2883 2912 3348 3366 1 1 1 1 1 1 1 1 1,3 1,4 1,2,3 1,7 1,5,7 1,2 1,2,3,4 1,3 1,3 1,3 1,3 1,4 1,3 1,4 1,5 1 1 1 1 1 1 1 4.2 Attachment Errors Test set: 2 6 Query.Token V 1.0 Correct 3153.6 3153.7 7 2 Credits Segmentation tagged by Bettina Bolla, Avihai Mejer, Yuval Pinter, Roi Reichart, and Idan Szpektor. Parsing tagged by Shir Givoni and Yu- val Pinter. References [Choi and McCallum2013] Jinho D Choi and Andrew 2013. Transition-based dependency In ACL (1), McCallum. parsing with selectional branching. pages 1052–1062. [De Marneffe and Manning2008] Marie-Catherine De Marneffe and Christopher D Manning. 2008. Stanford typed dependencies manual. Technical report, Technical report, Stanford University. [Pinter et al.2016] Yuval Pinter, Roi Reichart, and Idan Szpektor. 2016. Syntactic parsing of web queries with question intent. In Proceedings of NAACL- HLT, San Diego, CA, June 12-17, 2016.
1806.05258
2
1806
2018-07-10T19:52:19
SMHD: A Large-Scale Resource for Exploring Online Language Usage for Multiple Mental Health Conditions
[ "cs.CL" ]
Mental health is a significant and growing public health concern. As language usage can be leveraged to obtain crucial insights into mental health conditions, there is a need for large-scale, labeled, mental health-related datasets of users who have been diagnosed with one or more of such conditions. In this paper, we investigate the creation of high-precision patterns to identify self-reported diagnoses of nine different mental health conditions, and obtain high-quality labeled data without the need for manual labelling. We introduce the SMHD (Self-reported Mental Health Diagnoses) dataset and make it available. SMHD is a novel large dataset of social media posts from users with one or multiple mental health conditions along with matched control users. We examine distinctions in users' language, as measured by linguistic and psychological variables. We further explore text classification methods to identify individuals with mental conditions through their language.
cs.CL
cs
SMHD: A Large-Scale Resource for Exploring Online Language Usage for Multiple Mental Health Conditions Arman Cohan1 * Luca Soldaini1 Bart Desmet1,2 * Sean MacAvaney1 Andrew Yates1,3 * Nazli Goharian1 1IR Lab, Georgetown University, US {firstname}@ir.cs.georgetown.edu 2LT3, Ghent University, BE [email protected] 3Max Planck Institute for Informatics, DE [email protected] Abstract 8 1 0 2 l u J 0 1 ] L C . s c [ 2 v 8 5 2 5 0 . 6 0 8 1 : v i X r a Mental health is a significant and growing public health concern. As language usage can be leveraged to obtain crucial insights into mental health conditions, there is a need for large-scale, labeled, mental health-related datasets of users who have been diagnosed with one or more of such conditions. In this paper, we investigate the creation of high-precision patterns to identify self-reported diagnoses of nine different mental health conditions, and obtain high-quality labeled data without the need for manual labelling. We introduce the SMHD (Self-reported Mental Health Diagnoses) dataset and make it available. SMHD is a novel large dataset of social media posts from users with one or multiple mental health conditions along with matched control users. We examine distinctions in users' language, as measured by linguistic and psychological variables. We further explore text classification methods to identify individuals with mental conditions through their language. Introduction 1 Mental health is a significant challenge in healthcare. Mental disorders have the potential to tremen- dously affect the quality of life and wellness of individuals in society (Strine et al., 2008; Mowery et al., 2017a). Social media have become an increasingly important source of data related to mental health conditions (Cohan et al., 2017; Mowery et al., 2017b; Coppersmith et al., 2017; Yates et al., 2017), as it is now a prominent platform for individuals to engage in daily discussions, share information, seek advice and simply communicate with peers that have shared interests. In addition to its ubiquity and ease of access, the possibility to disclose mental health matters anonymously or pseudo-anonymously further drives users to online self-disclosure. At the same time, the close connection between language and mental health makes social media an invaluable resource of mental health-related data. Lack of data has been one of the key limitations to understanding and addressing the challenges the domain is facing (Coppersmith et al., 2014a). Data from social media can not only be used to potentially provide clinical help to users in need, but also to broaden our understanding of the various mental health conditions. Social media analysis has already been proven valuable for identifying depression (Coppersmith et al., 2014a; Yates et al., 2017), suicide ideation (Cohan et al., 2017; De Choudhury and Kıcıman, 2017; Kshirsagar et al., 2017; Desmet and Hoste, 2018), and other conditions such as schizophrenia (Mitchell et al., 2015). While social media data is abundantly available, the amount of labeled data for studying mental health conditions is limited. This is due to the high cost of annotation and the difficulty of access to experts. Prior research has investigated self-disclosure as a means of obtaining labeled data from social media. De Choudhury et al. (2013a) used it to identify new mothers and track post-partum changes in emotions. * Equal contribution. This work is licensed under a Creative Commons Attribution 4.0 International License. creativecommons.org/licenses/by/4.0/ License details: http:// Condition ADHD Anxiety Autism Bipolar Borderline Depression Eating OCD PTSD Schizophrenia Seasonal Affective Twitter, (Copper- smith et al, 2015) 102 216 n/a 188 101 393 238 100 403 172 100 Reddit, SMHD (ours) 10,098 8,783 2,911 6,434 n/a 14,139 598 2,336 2,894 1,331 n/a Table 1: Comparison between the number of self-reported diagnosed users per condition in the dataset of Coppersmith et al. (2015a) and ours (SMHD). I was officially diagnosed with ADHD last year. I have a diagnosed history of PTSD. my dr just diagnosed me as schizo. Figure 1: Examples of self-reported diagnoses statements. Coppersmith et al. (2014a) specifically focused on self-reports of mental health diagnoses. In particular, Coppersmith et al. (2015a) constructed a dataset of various mental health conditions using Twitter state- ments. Finally, Yates et al. (2017) introduced a large dataset of depressed users obtained from Reddit. We extend the previous efforts on addressing the lack of large-scale mental health-related language data. Particularly, we propose improved data collection methods through which we can obtain high- quality large-scale datasets of labeled diagnosed conditions paired with appropriate control users. Con- sequently, we introduce SMHD (Self-reported Mental Health Diagnoses), a large dataset of diverse mental health conditions that can provide further insight into the mental health-related language. We leverage self-reported diagnosis statements where a user declares to have been diagnosed with a mental health condition such as depression. Examples of self-reported diagnoses are shown in Figure 1. Our dataset can be used not only to develop methods for better identifying mental health conditions through natural language, but also allows us to investigate the characteristics of language usage within each condition. We hope the availability of this new resource will foster further research into these problems and enhance reproducibility of suggested approaches. Our work has the following significant distinctions compared to existing social media datasets related to mental health. Previous work has studied self-reported diagnosis posts in Twitter (Coppersmith et al., 2015a), where the post length is limited to 140 characters.1 This makes the Twitter language use rather different from real life discussions. Instead, we use data from Reddit, an interactive discussion- centric forum without any length constraints. Our dataset contains up to two orders of magnitude more diagnosed individuals for each condition than the Twitter dataset by Coppersmith et al. (2015a), making it suitable for exploring more recent data-driven learning methods (see Table 1). We choose our control users in a systematic way that makes classification experiments on the dataset realistic. We normalize language usage between the users: by removing specific mental health signals and discussions, we focus on patterns of language in normal (general) discussions. While our dataset cre- ation method is close to Yates et al. (2017), we extend theirs by investigating multiple high-precision matching patterns to identify self-reported diagnoses for a range of conditions. Part of our patterns are obtained through synonym discovery. Considering relevant synonyms from reliable sources increases the variety of the diagnosed users and linguistic nuances. We also explore nine common mental health 1This limitation was doubled to 280 characters in late 2017. conditions while Yates et al. (2017) focus only on depression. We explore classification methods for identifying mental health conditions through social media language and provide detailed analysis that helps us understand the differences in language usage between conditions, and between diagnosed users and controls. Our contributions are as follows: (i) We investigate the creation of high-precision matching patterns to identify self-reported diagnoses of nine different mental health conditions. (ii) We introduce a large- scale dataset of nine mental health conditions that has significant extensions to existing datasets and we make our data publicly available. Our dataset includes users who might suffer from more than one condition, thus allowing language study of interacting mental conditions. (iii) We investigate language characteristics of each mental health group. (iv) We explore classification methods for detecting users with various mental health conditions. 2 Related work Social media offers a considerable amount of accessible common language, attracting the attention of those who study the language of individuals with mental health conditions. Twitter is a natural source, being a popular platform that enables users to share short messages publicly. Early work used crowd- sourcing to identify Twitter users who report a depression diagnosis in a survey, and proposed features that are able to identify depressed users prior to the onset of depression (De Choudhury et al., 2013b). Others found that these characteristics hold in both English and Japanese tweets (Tsugawa et al., 2015), indicating similar cross-cultural tendencies. Due to the cost and bias introduced by relying on surveys, work shifted to identifying mental health conditions by examining the content shared by social media users. Coppersmith et al. (2014a) identified approximately 1,200 Twitter users with 4 mental health conditions (bipolar, depression, PTSD, SAD) using diagnosis statements found in tweets (e.g., "I was diagnosed with depression"). Following this work, detailed studies were conducted on users experiencing PTSD (Coppersmith et al., 2014b), and schizophrenia (Mitchell et al., 2015; Ernala et al., 2017). The shared task at the 2nd Computational Linguistics and Clinical Psychology Workshop (CLPsych 2015) focused on identifying depression and PTSD users on Twitter (Coppersmith et al., 2015b). This included a set of approximately 1,800 Twit- ter users with self-identified diagnoses. Leading submissions to CLPsych 2015 relied on the LIWC lexicon (Pennebaker et al., 2015), topic modeling, manual lexicons, and other domain-dependent fea- tures (Resnik et al., 2015; Preotiuc-Pietro et al., 2015). Coppersmith et al. (2015a) expands the research on Twitter to eleven self-identified mental health conditions. (Benton et al., 2017) uses this dataset (and others) with a neural multi-task learning approach to identify language characteristics. Mowery et al. (2016) investigates specific symptoms of depression in tweets, including depressed mood, disturbed sleep, and loss of energy. While the abundant short texts of Twitter can provide some insight into language characteristics of those with mental health conditions, long-form content can provide additional linguistic insights. Some have investigated the language of users of an online crisis forum to identify posts of users who are at highest risk to allow for faster intervention (Milne et al., 2016; Cohan et al., 2017). Losada and Crestani (2016) applied the self-reported diagnosis strategy to identify approximately 150 Reddit users who suffer from depression, and paired them with 750 control users. Yates et al. (2017) also used self- reported diagnoses to identify clinically depressed users, but applied it to a larger set of Reddit, yielding the Reddit Self-reported Depression Diagnosis (RSDD) dataset of over 9,000 users with depression and over 100,000 control users (using an improved user control identification technique). The corpus was also used to study the temporal aspects of self-reported diagnoses (MacAvaney et al., 2018). Others have used data sources beyond social media to examine the language of people with mental health conditions. Resnik et al. (2013) uses topic models to predict depression and neuroticism based on student-written essays, finding clear clusters of words when students are asked to write about their feelings in a stream-of-consciousness setting. Althoff et al. (2016) uses text message conversations from a mental health crisis center to improve counseling techniques. This work addresses important limitations of previous efforts. Similar to RSDD (Yates et al., 2017), we build our corpus from Reddit using self-reported diagnoses. This results in a large amount of long-form post content that is not constrained by a character limit. Furthermore, because there are no character limits (as exist for Twitter), the mode of language is more typical of general writing. Unlike Yates et al. (2017), we investigate extended self-diagnoses matching patterns derived from mental health-related synonyms. We also focus on nine mental health conditions (rather than just a single condition). This results in a collection that can be used to compare and contrast the language characteristics of each condition. 3 Data In this section we describe the construction and characteristics of the Self-reported Mental Health Di- agnoses (SMHD) dataset. The studied conditions correspond to branches in the DSM-5 (American Psy- chiatric Association, 2013), an authoritative taxonomy for psychiatric diagnoses. Six conditions are top-level DSM-5 disorders: schizophrenia spectrum disorders (schizophrenia), bipolar disorders (bipo- lar), depressive disorders (depression), anxiety disorders (anxiety), obsessive-compulsive disorders (ocd) and feeding and eating disorders (eating). The three other conditions are one rank lower: post-traumatic stress disorder (ptsd) is classified under trauma- and stress-related disorders, and autism spectrum dis- orders (autism) and attention-deficit/hyperactivity disorder (adhd) under neurodevelopmental disorders. We use these lower-rank conditions to provide more definition when they are clearly distinguishable from sibling disorders. 3.1 Dataset construction The SMHD dataset was created by using high precision patterns to identify Reddit users who claimed to have been diagnosed with a mental health condition (diagnosed users) and using exclusion criteria to match these diagnosed users with control users who are unlikely to have one of the mental health con- ditions studied (control users). SMHD consists of user labels indicating the mental health condition(s) associated with each user and all Reddit posts made by each user between January 2006 and Decem- ber 2017 (inclusive). Users and posts were extracted from a publicly available Reddit corpus2. This approach is based on the method used to create the Reddit Self-reported Depression Diagnosis (RSDD) dataset (Yates et al., 2017). SMHD expands on RSDD by incorporating synonyms in matching patterns and including diagnoses for eight new conditions in addition to depression.3 Diagnosed users were identified using high precision diagnosis patterns in a manner similar to that used in prior work that studied depression on Reddit (Yates et al., 2017); we describe these patterns in more detail in section 3.2. After identifying candidate diagnosed users who matched a diagnosis pattern (see Figure 1), we removed any candidates who (1) matched a negative diagnosis pattern4 or (2) had fewer than 50 posts talking about topics other than mental health (mental health posts). This is done to ensure enough data remains for a diagnosed user after removing their mental health-related content. After removing these candidate diagnosed users, 36948 diagnosed users remain. Mental health posts were defined as posts that were either made to a subreddit (i.e., a subforum devoted to a specific topic) related to mental health or that included language related to mental health, such as the name of a condition (e.g., OCD) and general terms like diagnosis, mental illness, or suffering from. We constructed a list of subreddits related to mental health by beginning with lists from prior work studying depression on Reddit (Pavalanathan and De Choudhury, 2015; Yates et al., 2017) and expanding them to include discussion and support subreddits for each of the other mental health conditions. All mental health posts are removed for diagnosed users and control users alike. Classification therefore happens on the set of posts that do not contain any of the mental health terms, and that have not been posted in any of the mental health-related subreddits. Our methodology does not guarantee, however, that all potentially relevant terms or subreddits have been excluded. Control users were chosen from a pool of candidate control users based on their similarity with 2https://files.pushshift.io/reddit/ 3Patterns are available from http://ir.cs.georgetown.edu/data/smhd/. 4e.g., I was never clinically diagnosed. Figure 2: Precision, recall, F1 and F0.5 of the condi- tion diagnosis patterns as a function of the maximum al- lowable distance (in characters) between a diagnosis and a condition keyword. Chosen threshold indicated at 40 characters. Figure 3: Number of users per condition for SMHD (in blue) and SMHD-RC (in or- ange). Figure 4: Number of users with a single or mul- tiple co-occurring conditions. Figure 5: Concomitance of condition diag- noses. Rows contain relative co-occurences of the row condition with other conditions. the diagnosed users as measured by their number of posts and the subreddits they posted in. This is done to prevent biases between the control and diagnosed groups in the dataset and prevent making the task of identifying such users artificially easy. In more detail, every Reddit user who (1) had no mental health post5 and (2) had at least 50 posts became a candidate control user. Given this pool of candidate control users, we matched each diagnosed user with 9 candidate control users (on average) after excluding controls who had never posted in the same subreddit as the diagnosed user or who had more than twice as many posts or less than half as many posts as the target diagnosed user. The selection criteria for potential control users are stringent: users are removed if they do not have the required subreddit overlap or minimum post count, or if they use any of the mental health-related terms in any of their posts. The latter is necessary because we found that the prior probability of using an exclusion term in any given subreddit (e.g. depressed) is almost always higher for diagnosed users than for controls, even in popular subreddits on general topics (e.g. r/politics). As a result, the pool of candidate controls for matching to diagnosed users is significantly diminished. Because control users are picked from the pool without replacement, we were unable to meet the target of 9 appropriate controls for some of the diagnosed users. We release the users who have at least 9 control users as SMHD, and use this 5When defining language related to mental health, we consider add to be a mental health term. However, this term is often used as a verb that does not refer to Attention Deficit Disorder. We therefore do not exclude candidate control users who have used this term. We instead remove any post containing the term add, which matches our treatment of the diagnosed users where all mental health posts are removed. 100101102Distance in characters020406080100F0.5F1PrecisionRecalldepressionadhdanxietybipolarptsdautismocdschizophreniaeatingcondition0500010000usersSMHDSMHD-RC123456co-occurring conditions101102103104usersdepressionadhdanxietybipolarptsdautismocdschizophreniaeatingdepressionadhdanxietybipolarptsdautismocdschizophreniaeating0.000.050.100.150.200.250.30 dataset for all analyses in this paper. It contains 20,406 diagnosed users and 335,952 matched controls. A secondary dataset containing the remaining 16,542 diagnosed users with fewer than 9 controls will be made available as SMHD-RC (Relaxed Controls) for studies that require additional data for analysing differences between mental health conditions, rather than between diagnosed users and controls. 3.2 Diagnosis patterns To identify Reddit users who report a diagnosis for one or more mental health conditions, we developed detection patterns with a focus on high precision. The patterns consist of two components: one that matches a self-reported diagnosis, and another that maps relevant diagnosis keywords to the 9 mental health conditions. A user is included for a condition if one of the condition keywords occurs within a certain distance of the diagnosis pattern (as discussed below). For each condition, a seed list of diagnosis keywords was collected from the corresponding DSM-5 headings. To increase the likelihood of matching diagnostic posts, we expanded each set of medical expressions to include synonyms, common misspellings, vernacular terms and abbreviations. Our steps mirror the ones of Soldaini and Yom-Tov (2017), who were also interested in identifying self-diagnosed users, albeit on query logs. In particular, we leveraged two synonym mappings to generate alternative formulations of the disorders of interest: • MedSyn (Yates and Goharian, 2013) is a laypeople-oriented synonym mapping ontology. It was gener- • Behavioral (Yom-Tov and Gabrilovich, 2013) maps expressions commonly used by laypeople to de- scribe their medical condition to concepts in UMLS. The synonyms were generated by first identifying the most frequent search terms Yahoo! search used to retrieve Wikipedia medical pages. Then, frequent lexical affinities (Carmel et al., 2002) to the aforementioned were added to synonyms lists. ated from a subset of UMLS6 filtered to remove irrelevant semantic types. The resulting expansions were vetted manually to remove terms that did not describe the condition pre- cisely (e.g., hypernyms) or that were ambiguous (e.g., "add"), and missing items were added. Using the diagnosis patterns without condition keywords, all self-reported diagnosis posts were col- lected from the Reddit dataset, and 500 posts were randomly sampled for manual annotation. False positive matches were found in 18 of those, i.e. the precision for self-diagnosis detection was 96.4%. False positives included negations, hypotheticals (e.g., "I'm not sure if I was diagnosed"), and diagnoses that are uncertain or wrong ("I was diagnosed with autism, then undiagnosed."). Out of 500 diagnosis posts, 241 reported a mental health condition. The ones that were annotated as belonging to one of the 9 conditions were used to tune the condition term lists and the optimal distance between a diagnosis pattern and a condition term. Figure 2 plots the effect of this distance on precision, recall, F1 and F0.5 (which emphasizes precision). A maximum distance of 40 characters was chosen, where F0.5 score is highest. We thus achieve high precision (93%) with good recall (84%). Since the optimal distance threshold was tuned on this development set, it may overfit the data and the reported scores should be considered a ceiling performance. To validate the final diagnosis matching approach on a held-out set, 900 posts (corresponding to 9 samples of 100 diagnosis posts, one for each condition) was manually checked for false positives. We obtain high precision, with a minimum precision of 90% for anxiety and macro-averaged precision of 95.8%. Most false positives are caused by terms for a condition occurring close to a diagnosis for another condition (e.g. "My doctor diagnosed me with depression, and I also have an anxiety problem."). While a user might also suffer from these conditions, they are not explicitly reporting a diagnosis. 3.3 Dataset statistics Figure 3 shows the distribution of diagnosed users per condition in both datasets. Users who self-reported a diagnosis of depression, ADHD, anxiety or bipolar are most common. Interestingly, 26.7% of diag- nosed users in the dataset reported more than one diagnosis (Figure 4). Such concomitant conditions are not uncommon, and were also reported in the work of Coppersmith et al. (2015a). As can be seen in 6Unified Medical Language System condition control depression adhd anxiety bipolar ptsd autism ocd schizophrenia eating per post total tokens posts per user characters per post total 26.2 (48.3) 3,031.6M 133.9 (252.9) 310.0 (157.8) 115,669k 57.4M 227.5 (406.9) 45.1 (80.0) 1,272k 162.2 (84.2) 40.5M 237.5 (433.5) 46.5 (82.7) 872k 164.7 (83.6) 46.4 (83.0) 36.9M 233.9 (422.8) 159.7 (83.0) 795k 26.2M 230.6 (447.0) 575k 157.6 (82.4) 45.5 (86.5) 13.7M 267.8 (581.7) 258k 53.1 (114.0) 160.7 (84.7) 11.6M 237.9 (434.0) 46.5 (82.3) 248k 168.3 (84.5) 9.4M 234.2 (459.5) 203k 158.8 (81.4) 46.4 (90.1) 157.3 (80.5) 123k 49.2 (105.6) 6.1M 253.8 (566.6) 2.5M 232.6 (372.8) 46.3 (73.7) 53k 161.4 (81.0) Table 2: Average (Stdev.) and count of posts, tokens and characters for diagnosed and control users. Figure 5, depression co-occurs with high frequency with most of the other conditions, almost 30% of users with depression, OCD or PTSD also suffer from anxiety, and schizophrenia is most likely to be diagnosed alongside bipolar disorder. An important characteristic of the SMHD dataset is its scale. Reddit allows its users to write long-form posts, so unlike datasets collected on Twitter, a large amount of text is available for each diagnosed user. Table 2 gives an overview of the average and total number of posts, tokens and characters per condition, and for controls. Control users post on average twice as many posts as diagnosed users, but these posts tend to be considerably shorter. Although this may be a valid signal for certain mental health conditions, it can be removed for classification experiments by truncating the length and number of posts. This is common practice for technical reasons, and truncating post length has been shown in previous work to improve classification performance (Yates et al., 2017). 3.4 Ethics and privacy Even though we rely on publicly available Reddit posts in our work, mental health is a sensitive matter and measures to prevent risk to individuals in social media research should always be considered (Hovy and Spruit, 2016; Suster et al., 2017). The risks associated with the data collection methods and our resulting SMHD dataset is minimal. We refrain from publicly posting any excerpts of the data, we made no attempt to contact users, and we made no attempt to identify or link users to other social media accounts. We further replace usernames with random identifiers to prevent users' identities from being known without the use of external information. The SMHD dataset is available through a Data Usage Agreement (DUA)7 protecting the users' privacy. In particular, the DUA specifies that no attempt should be made to publish portions of the dataset (which could result in users being identified), contact users, identify them, or link them with other user information. 4 Analysis To investigate the differences between the language of mental health condition groups and the control group, we categorize language of users based on measures of psycholinguistic attributes through the LIWC lexicon (Pennebaker et al., 2015). These categories include variables that characterize linguistic style as well as psychological aspects of language (e.g., cognitive attributes and affective attributes). For each user, we obtain LIWC categories based on their posts and then compare these categories across users in each mental health condition group versus the control group using Welch's t-test (Welch, 1947). We adjust p-values with Bonferroni correction. To better see the differences between the categories, we also report the Cohen's d statistic (Cohen, 1988). Table 3 shows the results. In general, we observe a variety of differences in language use between the diagnosed and the control groups. The effect sizes range from a very small effect to medium (0.05<d<0.5), which is typical of large datasets (Sakai, 2016). These differences span across both the linguistic style and psychological 7http://ir.cs.georgetown.edu/resources/ LIWC category Summary Language Variables Clout Authentic WPS Dictionary words Total function words Total pronouns Personal pronouns 1st pers singular 3rd pers singular Impersonal pronouns Prepositions Auxiliary verbs Common Adverbs Conjunctions Other Grammar Common verbs Numbers Psychological Variables Positive emotion Anxiety Social processes Family Female references Cognitive processes Insight Discrepancy Tentative Differentiation Biological processes Health Time orientation Past focus Present focus Personal concerns Relativity Time Work Leisure Money Informal language Netspeak Assent depression adhd anxiety bipolar ptsd autism ocd schizophrenia eating −0.06‡ – 0.21‡ 0.2‡ 0.1‡ 0.08‡ 0.31‡ 0.27‡ 0.3‡ 0.27‡ 0.25‡ 0.22‡ 0.22‡ 0.23‡ 0.23‡ 0.23‡ 0.09‡ 0.17(cid:63) 0.11† 0.06‡ 0.16‡ 0.12‡ 0.14‡ 0.12‡ 0.09‡ – 0.17‡ 0.17‡ 0.15‡ 0.15‡ −0.1‡ −0.09‡ −0.11‡ −0.09‡ −0.11‡ – −0.1‡ 0.22‡ 0.08‡ 0.28‡ 0.28‡ 0.24‡ 0.26‡ 0.28‡ 0.1‡ 0.07† 0.12‡ 0.14‡ 0.08‡ 0.18‡ 0.17‡ – 0.18‡ 0.06‡ 0.24‡ 0.24‡ 0.2‡ 0.21‡ 0.22‡ 0.08(cid:63) – 0.12‡ 0.11‡ 0.06(cid:63) 0.16‡ 0.13‡ 0.15‡ 0.1‡ 0.22‡ 0.21‡ 0.14‡ 0.14‡ 0.16‡ – 0.05(cid:63) 0.12‡ 0.1‡ 0.07‡ 0.14‡ 0.11‡ – 0.14‡ 0.12‡ 0.2‡ 0.26‡ 0.17‡ 0.14‡ 0.17‡ – 0.09(cid:63) 0.12‡ 0.15‡ – 0.13‡ 0.13‡ – 0.07(cid:63) 0.11‡ 0.06(cid:63) 0.1‡ 0.14‡ 0.1‡ – 0.08‡ 0.1‡ – 0.08‡ 0.09‡ 0.1‡ – 0.06(cid:63) – – – 0.07‡ – 0.07‡ 0.13‡ 0.07‡ 0.06(cid:63) 0.08‡ 0.08‡ – 0.07† 0.05(cid:63) 0.06‡ 0.06† – 0.06(cid:63) – – 0.1‡ – 0.13‡ 0.09‡ 0.08‡ – 0.07(cid:63) – – 0.11‡ 0.08† 0.07(cid:63) – −0.08(cid:63) – – 0.15‡ – 0.12† – 0.22† – 0.16‡ 0.12† 0.1(cid:63) – – – – – 0.09(cid:63) – – – – – – 0.07† 0.11‡ 0.06‡ 0.13‡ 0.12‡ 0.09‡ – 0.07‡ 0.08‡ 0.06‡ 0.08‡ 0.08‡ 0.09‡ 0.05† – – 0.06‡ – – – – – −0.07‡ −0.07‡ −0.07‡ −0.09‡ −0.12‡ −0.09† −0.06‡ – −0.1‡ −0.07‡ −0.07‡ −0.06‡ −0.07‡ −0.06‡ −0.06‡ −0.06(cid:63) −0.1‡ −0.08(cid:63) – – – – – −0.05‡ −0.06‡ – −0.12‡ – −0.06(cid:63) 0.09(cid:63) – – – – – 0.23‡ 0.08† 0.28‡ 0.28‡ 0.26‡ 0.23‡ 0.26‡ – 0.13† 0.11† 0.13‡ – 0.11† 0.19‡ – −0.1‡ – – – – – 0.13† 0.17† – – – – – – – 0.11(cid:63) – – – – – – – −0.09(cid:63) – – – – – 0.22‡ 0.23‡ 0.18‡ 0.2‡ 0.17† – – – – – – – 0.24(cid:63) – 0.3‡ 0.27‡ 0.26† 0.27† 0.28† – – – – – 0.3‡ – – – −0.13† – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – −0.12‡ – – – −0.15‡ – – Table 3: Differences between the linguistic and psycholinguistic variables obtained from LIWC between users treatment groups and control users. Statistical significance is based on t-test with Bonferroni ad- justment. Numbers in the cells are effect sizes (Cohen's d). (cid:63), †, and ‡ respectively show adjusted p-values of <0.01, <0.001 and <0.0001. This is also indicated by shading colors, red shading shows that the corresponding category is observed with more intensity in the treatment group, where as blue shading shows more significance in the control group. For brevity, only significant attributes are shown. attributes. Particularly, we observe that clout, an attribute regarding language that indicates high social status, is more prominent among control users compared to the depression and anxiety groups. Related work in psychology shows that depression and anxiety are more prevalent in lower socioeconomic status demographics (Murphy et al., 1991), which is in line with the observation in our dataset. Next, authen- tic language is stronger among most of the mental health groups compared with control groups. This correlates with the use of personal and first person pronouns. This is backed by prior research show- ing that fewer self-references are associated with unauthentic language (Newman et al., 2003). We also observe that among most of the conditions the usage of first-person singular pronouns is higher than in control groups. Related studies arrive at the same conclusion that people with mental health conditions tend to use more first-person pronouns and references, possibly because mental health conditions result in greater self-focused attention and rumination (Bucci and Freedman, 1981; Pennebaker et al., 2015; Watkins and Brown, 2002; Van der Zanden et al., 2014). Social processes, the language related to human interaction and sharing, appears to be higher in de- pressed, anxiety and PTSD users. A potential explanation for this is that sharing and support-seeking behaviors have been shown to improve an individual's state of mind (Turner et al., 1983; De Choudhury and Kıcıman, 2017). People with conditions such as bipolar, depression and anxiety show significantly Depression ADHD Anxiety Bipolar PTSD Autism OCD Schizophrenia Eating Multi-label Logistic Regression BoW features XGBoost BoW features Linear SVM BoW features Supervised FastText Convolutional Neural Network (CNN) P=85.00 R=28.65 F=42.85 P=81.40 R=29.49 F=43.29 P=78.70 R=39.75 F=52.82 P=66.80 R=44.70 F=53.56 P=45.85 R=56.07 F=50.45 P=88.60 R=19.22 F=31.59 P=85.71 R=21.25 F=34.05 P=83.74 R=30.69 F=44.92 P=62.11 R=37.77 F=46.98 P=37.86 R=32.77 F=35.13 P=85.80 R=27.04 F=41.13 P=83.52 R=31.46 F=45.71 P=81.76 R=39.88 F=53.61 P=67.63 R=44.54 F=53.71 P=51.33 R=45.01 F=47.96 P=87.06 R=21.57 F=34.58 P=84.94 R=30.31 F=44.68 P=84.36 R=37.21 F=51.64 P=62.63 R=42.74 F=50.81 P=37.21 R=39.53 F=38.34 P=92.44 R=19.71 F=32.50 P=89.83 R=37.99 F=53.40 P=93.12 R=41.22 F=57.14 P=70.76 R=48.57 F=57.60 P=47.00 R=65.95 F=54.88 P=93.18 R=7.93 F=14.62 P=84.09 R=21.47 F=34.21 P=91.19 R=28.05 F=42.90 P=68.47 R=39.07 F=49.75 P=30.82 R=50.68 F=38.33 P=95.00 R=4.87 F=9.27 P=86.96 R=25.64 F=39.60 P=86.29 R=27.44 F=41.63 P=65.02 R=33.85 F=44.52 P=22.97 R=57.95 F=32.90 P=100.00 R=2.25 F=4.40 P=86.84 R=24.72 F=38.48 P=93.06 R=25.09 F=39.53 P=69.23 R=33.71 F=45.34 P=30.12 R=47.94 F=36.99 P=0.00 R=0.00 F=0.00 P=94.12 R=14.29 F=24.81 P=100.00 R=13.39 F=23.62 P=64.15 R=30.36 F=41.21 P=38.56 R=52.68 F=44.53 P=17.22 R=24.38 F=19.72 P=16.87 R=29.38 F=20.51 P=19.20 R=34.86 F=23.71 P=23.02 R=44.44 F=27.83 P=20.65 R=48.12 F=26.55 Table 4: Classification performance on target users in SMHD. All methods rely on the official SMHD split introduced in Section 3 for training, tuning, and testing. We report the performance of each classifier as binary predictor (i.e., given a condition, predict if a user belongs to the diagnosed or control group) as well as in a multi-label, multi-class setting (i.e., given a user, predict if and which conditions they were diagnosed with). more female references. This might point to a gender bias in the corpus towards males, which would shift an increased preoccupation with romantic relationships towards references of female partners. Cog- nitive processes (markers of cognitive activity associated with rational thought and argumentation) are also observed more in people with mental health conditions. This could be due to the observation that these groups tend to express their feelings more. Other attributes such as health, focus on past time, and biological processes are observed more in conditions such as depression. Unsurprisingly, attributes like leisure and money are more prevalent among controls. 5 Experiments In order to provide a more thorough understanding of SMHD, we explored several classification methods for each of the conditions included in the dataset. We train our classifiers both in a binary and multi- label multi-class setting. For the binary tasks, all classifiers are trained only on the subset of diagnosed users in SMHD who are associated with any condition and their respective control users. Recall that, as discussed in 3.3, users can be diagnosed with one or more conditions; as such, we also evaluate the baseline classifiers in a multi-class, multi-label setting. In other words, given a user, classifiers are trained to predict if and which conditions the user was diagnosed with. In detail, we consider the following methods: Logistic regression: we trained a simple discriminative model using bag-of-words features extracted over all posts by all users in the training set. Posts were concatenated and split on non-alphanumeric characters; we normalized tokens by folding them to lowercase. Words occurring less than 20 times in the training set were removed. Features were weighted using tf-idf and (cid:96)2-normalized. XGBoost (Chen and Guestrin, 2016): we evaluated the performance of an ensemble of decision trees. For this model, the same features described above were used. We set the number of estimators to 100. Support vector machine (SVM): we included a SVM classifier with linear kernel among our base- lines. Like the methods above, this model was trained on tf-idf bag-of-words features. Supervised FastText (Joulin et al., 2016): we trained a shallow neural net model using FastText. After tuning on the development set, we set the dimension of the hidden layer to 100. The model leverages sub-word information by using character ngrams of size 3 to 6; it was trained for 100 epochs. Convolutional neural network (CNN): Finally, we tested a CNN approach to learn ngram sequences indicative of each condition. We used a model architecture based on the work of Kim (2014), with a filter size of 3 and a pooling size of 4. A model was trained for each condition, and each model was trained for 100 epochs. Each user's posts are concatenated and truncated to 15,000 tokens. This representation combines tractability with density. We do not pad posts individually hence no space is wasted by including short posts. Each token is represented by the FastText embeddings from above. Results of the classification methods are reported in Table 4. All classifiers are trained, tuned, and tested on binary labels, except for the results reported in the rightmost column ("multi-label"). Overall, FastText obtained the best performance in terms of F1 score across all conditions except bipolar, in which it is outperformed by the SVM model, and eating disorder, where it is outperformed by a CNN. FastText also outperforms all other classifiers in the multi-label, multi-class test setting. We observe that models trained on bag-of-words features favor precision over recall, while the two neural models we tested offer more balanced performance. This can be explained by the fact that bag-of-words models are more likely to give more weight to strongly indicative text features, potentially causing some overfitting on the training data. Comparing across conditions, we note that the performance on models is strongly affected by the num- ber of diagnosed users in the training set. All classifiers struggle on the three conditions with fewest users (OCD, schizophrenia, and eating). This observation is consistent with the analysis on LIWC categories reported in Section 4. Finally, we note that the simpler neural model (FastText) outperformed the richer CNN method. We explain this result by observing that FastText considers all posts by a user, while CNN samples a portion of them. This strategy, which is motivated by efficiency reasons, was based on the work of Yates et al. (2017), in which sampling was found to be an effective strategy to make the classification problem tractable. However, this result suggests that novel methods ought to be studied to achieve a robust sampling strategy across all conditions included in SMHD. 6 Conclusion We presented SMHD, a large dataset of Reddit users with diverse mental health conditions and matched control users. Our dataset was constructed using high-precision diagnosis patterns and carefully selected control users. To our knowledge, SMHD is the largest dataset that supports a variety of mental health conditions and is up to two orders of magnitude larger than the largest published similar resource. We further examined differences in language use between mental health condition (diagnosed users) and control groups as measured by various linguistic and psychological signals. Several text classification methods were explored to identify the diagnosed users, with FastText being the most effective approach overall. We make our dataset available to the community, and hope that it will foster further research into these problems and enhance reproducibility of suggested approaches. References Tim Althoff, Kevin Clark, and Jure Leskovec. 2016. Large-scale analysis of counseling conversations: An appli- cation of natural language processing to mental health. In TACL. American Psychiatric Association. 2013. Diagnostic and Statistical Manual of Mental Disorders (DSM-5). Amer- ican Psychiatric Association Publishing. Adrian Benton, Margaret Mitchell, and Dirk Hovy. 2017. Multitask learning for mental health conditions with limited social media data. In EACL. Wilma Bucci and Norbert Freedman. 1981. The language of depression. Bulletin of the Menninger Clinic, 45(4):334. David Carmel, Eitan Farchi, Yael Petruschka, and Aya Soffer. 2002. Automatic query refinement using lexical affinities with maximal information gain. In Proceedings of the 25th annual international ACM SIGIR confer- ence on Research and development in information retrieval, pages 283–290. ACM. Tianqi Chen and Carlos Guestrin. 2016. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pages 785–794. ACM. Arman Cohan, Sydney Young, Andrew Yates, and Nazli Goharian. 2017. Triaging content severity in online mental health forums. Journal of the Association for Information Science and Technology (JASIST). Jacob Cohen. 1988. Statistical power analysis for the behavioral sciences 2nd edition. Glen Coppersmith, Mark Dredze, and Craig Harman. 2014a. Quantifying mental health signals in Twitter. In Proceedings of the Workshop on Computational Linguistics and Clinical Psychology: From Linguistic Signal to Clinical Reality, pages 51–60. Glen Coppersmith, Craig Harman, and Mark Dredze. 2014b. Measuring post traumatic stress disorder in Twitter. In ICWSM. Glen Coppersmith, Mark Dredze, Craig Harman, and Kristy Hollingshead. 2015a. From ADHD to SAD: An- alyzing the language of mental health on Twitter through self-reported diagnoses. In Proceedings of the 2nd Workshop on Computational Linguistics and Clinical Psychology: From Linguistic Signal to Clinical Reality, pages 1–10. Glen Coppersmith, Mark Dredze, Craig Harman, Kristy Hollingshead, and Margaret Mitchell. 2015b. CLPsych 2015 shared task: Depression and PTSD on Twitter. In CLPsych HLT-NAACL. Glen Coppersmith, Casey Hilland, Ophir Frieder, and Ryan Leary. 2017. Scalable mental health analysis in the clinical whitespace via natural language processing. In Biomedical & Health Informatics (BHI), 2017 IEEE EMBS International Conference on, pages 393–396. IEEE. Munmun De Choudhury and Emre Kıcıman. 2017. The language of social support in social media and its effect on suicidal ideation risk. In Proceedings of the... International AAAI Conference on Weblogs and Social Media. International AAAI Conference on Weblogs and Social Media, volume 2017, page 32. NIH Public Access. Munmun De Choudhury, Scott Counts, and Eric Horvitz. 2013a. Major life changes and behavioral markers in social media: case of childbirth. In Proceedings of the 2013 conference on Computer supported cooperative work, pages 1431–1442. ACM. Munmun De Choudhury, Michael Gamon, Scott Counts, and Eric Horvitz. 2013b. Predicting depression via social media. In ICWSM. Bart Desmet and Veronique Hoste. 2018. Online suicide prevention through optimised text classification. Infor- mation Sciences, 439-440:61–78. Sindhu Kiranmai Ernala, Asra F. Rizvi, Michael L. Birnbaum, John M. Kane, and Munmun De Choudhury. 2017. Linguistic markers indicating therapeutic outcomes of social media disclosures of schizophrenia. PACMHCI, 1:43:1–43:27. Dirk Hovy and Shannon L Spruit. 2016. The social impact of natural language processing. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pages 591–598. Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. 2016. Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In EMNLP. Rohan Kshirsagar, Robert Morris, and Sam Bowman. 2017. Detecting and explaining crisis. arXiv preprint arXiv:1705.09585. David E. Losada and Fabio Crestani. 2016. A test collection for research on depression and language use. In CLEF. Sean MacAvaney, Bart Desmet, Arman Cohan, Luca Soldaini, Andrew Yates, Ayah Zirikly, and Nazli Goharian. 2018. RSDD-Time: Temporal annotation of self-reported mental health diagnoses. In Proceedings of the Fifth Workshop on Computational Linguistics and Clinical Psychology: From Keyboard to Clinic, pages 168–173. David N. Milne, Glen Pink, Ben Hachey, and Rafael Alejandro Calvo. 2016. CLPsych 2016 shared task: Triaging content in online peer-support forums. In CLPsych@HLT-NAACL. Margaret Mitchell, Kristy Hollingshead, and Glen Coppersmith. 2015. Quantifying the language of schizophrenia in social media. In Proceedings of the 2nd workshop on Computational linguistics and clinical psychology: From linguistic signal to clinical reality, pages 11–20. Danielle L Mowery, Albert Park, Craig Bryan, and Mike Conway. 2016. Towards automatically classifying de- pressive symptoms from Twitter data for population health. In Proceedings of the Workshop on Computational Modeling of People's Opinions, Personality, and Emotions in Social Media (PEOPLES), pages 182–191. Danielle Mowery, Craig Bryan, and Mike Conway. 2017a. Feature studies to inform the classification of depres- sive symptoms from Twitter data for population health. arXiv preprint arXiv:1701.08229. Danielle Mowery, Hilary Smith, Tyler Cheney, Greg Stoddard, Glen Coppersmith, Craig Bryan, and Mike Con- way. 2017b. Understanding depressive symptoms and psychosocial stressors on Twitter: a corpus-based study. Journal of medical Internet research, 19(2). Jane M Murphy, Donald C Olivier, Richard R Monson, Arthur M Sobol, Elizabeth B Federman, and Alexan- der H Leighton. 1991. Depression and anxiety in relation to social status: A prospective epidemiologic study. Archives of General Psychiatry, 48(3):223–229. Matthew L Newman, James W Pennebaker, Diane S Berry, and Jane M Richards. 2003. Lying words: Predicting deception from linguistic styles. Personality and social psychology bulletin, 29(5):665–675. Umashanthi Pavalanathan and Munmun De Choudhury. 2015. Identity management and mental health discourse in social media. In Proceedings of the 24th International Conference on World Wide Web, WWW '15 Compan- ion, pages 315–321, New York, NY, USA. ACM. James W Pennebaker, Ryan L Boyd, Kayla Jordan, and Kate Blackburn. 2015. The development and psychometric properties of LIWC2015. Technical report. Daniel Preotiuc-Pietro, Johannes C. Eichstaedt, Gregory J. Park, Maarten Sap, Laura Smith, Victoria Tobolsky, H. Andrew Schwartz, and Lyle H. Ungar. 2015. The role of personality, age, and gender in tweeting about mental illness. In CLPsych HLT-NAACL. Philip Resnik, Anderson Garron, and Rebecca Resnik. 2013. Using topic modeling to improve prediction of neuroticism and depression in college students. In EMNLP. Philip Resnik, William Armstrong, Leonardo Claudino, and Thang Nguyen. 2015. The University of Maryland CLPsych 2015 shared task system. In CLPsych HLT-NAACL. Tetsuya Sakai. 2016. Statistical significance, power, and sample sizes: A systematic review of SIGIR and TOIS, 2006-2015. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, pages 5–14. ACM. Luca Soldaini and Elad Yom-Tov. 2017. Inferring individual attributes from search engine queries and auxiliary information. In Proceedings of the 26th International Conference on World Wide Web (WWW '17), pages 293– 301. Tara W Strine, Ali H Mokdad, Lina S Balluz, Olinda Gonzalez, Raquel Crider, Joyce T Berry, and Kurt Kroenke. 2008. Depression and anxiety in the United States: findings from the 2006 behavioral risk factor surveillance system. Psychiatric services, 59(12):1383–1390. Simon Suster, St´ephan Tulkens, and Walter Daelemans. 2017. A short review of ethical challenges in clinical natural language processing. arXiv preprint arXiv:1703.10090. Sho Tsugawa, Yusuke Kikuchi, Fumio Kishino, Kosuke Nakajima, Yuichi Itoh, and Hiroyuki Ohsaki. 2015. Recognizing depression from Twitter activity. In CHI. R Jay Turner, B Gail Frankel, and Deborah M Levin. 1983. Social support: Conceptualization, measurement, and implications for mental health. Research in community & mental health. Rianne Van der Zanden, Keshia Curie, Monique Van Londen, Jeannet Kramer, Gerard Steen, and Pim Cuijpers. 2014. Web-based depression treatment: Associations of clients word use with adherence and outcome. Journal of Affective Disorders, 160:10–13. E Watkins and RG Brown. 2002. Rumination and executive function in depression: An experimental study. Journal of Neurology, Neurosurgery & Psychiatry, 72(3):400–402. Bernard L Welch. 1947. The generalization ofstudent's' problem when several different population variances are involved. Biometrika, 34(1/2):28–35. Andrew Yates and Nazli Goharian. 2013. ADRTrace: detecting expected and unexpected adverse drug reactions from user reviews on social media sites. In European Conference on Information Retrieval, pages 816–819. Springer. Andrew Yates, Arman Cohan, and Nazli Goharian. 2017. Depression and self-harm risk assessment in online forums. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2968–2978, Copenhagen, Denmark, September. Association for Computational Linguistics. Elad Yom-Tov and Evgeniy Gabrilovich. 2013. Postmarket drug surveillance without trial costs: discovery of adverse drug reactions through large-scale analysis of web search queries. Journal of medical Internet research, 15(6).
1912.12598
1
1912
2019-12-29T07:27:23
ORB: An Open Reading Benchmark for Comprehensive Evaluation of Machine Reading Comprehension
[ "cs.CL" ]
Reading comprehension is one of the crucial tasks for furthering research in natural language understanding. A lot of diverse reading comprehension datasets have recently been introduced to study various phenomena in natural language, ranging from simple paraphrase matching and entity typing to entity tracking and understanding the implications of the context. Given the availability of many such datasets, comprehensive and reliable evaluation is tedious and time-consuming for researchers working on this problem. We present an evaluation server, ORB, that reports performance on seven diverse reading comprehension datasets, encouraging and facilitating testing a single model's capability in understanding a wide variety of reading phenomena. The evaluation server places no restrictions on how models are trained, so it is a suitable test bed for exploring training paradigms and representation learning for general reading facility. As more suitable datasets are released, they will be added to the evaluation server. We also collect and include synthetic augmentations for these datasets, testing how well models can handle out-of-domain questions.
cs.CL
cs
ORB: An Open Reading Benchmark for Comprehensive Evaluation of Machine Reading Comprehension Dheeru Dua♣, Ananth Gottumukkala♣, Alon Talmor♥, Sameer Singh♣, and Matt Gardner♠ ♣University of California, Irvine, USA ♥Allen Institute for Artificial Intelligence, Seattle, Washington, USA ♠Allen Institute for Artificial Intelligence, Irvine, California, USA [email protected] 9 1 0 2 c e D 9 2 ] L C . s c [ 1 v 8 9 5 2 1 . 2 1 9 1 : v i X r a Abstract Reading comprehension is one of the crucial tasks for furthering research in natural lan- guage understanding. A lot of diverse read- ing comprehension datasets have recently been introduced to study various phenomena in natural language, ranging from simple para- phrase matching and entity typing to entity tracking and understanding the implications of the context. Given the availability of many such datasets, comprehensive and reli- able evaluation is tedious and time-consuming for researchers working on this problem. We present an evaluation server, ORB, that reports performance on seven diverse reading compre- hension datasets, encouraging and facilitating testing a single model's capability in under- standing a wide variety of reading phenomena. The evaluation server places no restrictions on how models are trained, so it is a suitable test bed for exploring training paradigms and rep- resentation learning for general reading facil- ity. As more suitable datasets are released, they will be added to the evaluation server. We also collect and include synthetic augmenta- tions for these datasets, testing how well mod- els can handle out-of-domain questions. 1 Introduction Research in reading comprehension, the task of an- swering questions about a given passage of text, has seen a huge surge of interest in recent years, with many large datasets introduced targeting var- ious aspects of reading (Rajpurkar et al., 2016; Dua et al., 2019; Dasigi et al., 2019; Lin et al., 2019). However, as the number of datasets in- creases, evaluation on all of them becomes chal- lenging, encouraging researchers to overfit to the biases of a single dataset. Recent research, in- cluding MultiQA (Talmor and Berant, 2019) and the MRQA workshop shared task, aim to facilitate training and evaluating on several reading compre- hension datasets at the same time. To further aid in this direction, we present an evaluation server that can test a single model across many differ- ent datasets, including on their hidden test sets in some cases. We focus on datasets where the core problem is natural language understanding, not in- formation retrieval; models are given a single pas- sage of text and a single question and are required to produce an answer. As our goal is to provide a broad suite of ques- tions that test a single model's reading ability, we additionally provide synthetic augmentations to some of the datasets in our evaluation server. Sev- eral recent papers have proposed question transfor- mations that result in out-of-distribution test exam- ples, helping to judge the generalization capabil- ity of reading models (Ribeiro et al., 2018, 2019; Zhu et al., 2019). We collect the best of these, add some of our own, and keep those that gener- ate reasonable and challenging questions. We be- lieve this strategy of evaluating on many datasets, including distribution-shifted synthetic examples, will lead the field towards more robust and com- prehensive reading comprehension models. Code server, evaluation the includ- for ing a script to run it on the dev sets of these datasets and a leaderboard showing re- sults on their hidden tests, can be found at https://leaderboard.allenai.org/orb 2 Datasets We selected seven existing datasets that target various complex linguistic phenomena such as coreference resolution, entity and event detection, etc., capabilities which are desirable when test- ing a model for reading comprehension. We chose datasets that adhere to two main properties: First, we exclude from consideration any multiple choice dataset, as these typically require very dif- ferent model architectures, and they often have bi- ases in how the distractor choices are generated. Second, we require that the dataset be originally designed for answering isolated questions over a single, given passage of text. We are focused on evaluating reading performance, not retrieval; reading a single passage of text is far from solved, so we do not complicate things by adding in re- trieval, conversation state, or other similar com- plexities. It is our intent to add to the evaluation server any high-quality reading comprehension dataset that is released in the future that matches these restric- tions. We now briefly describe the datasets that we in- clude in the initial release of ORB. Table 1 gives summary statistics of these datasets. Except where noted, we include both the development and test sets (including hidden test sets) in our evaluation server for all datasets. requires SQuAD (Rajpurkar et al., 2016) a model to perform lexical matching between the context and the question to predict the an- swer. This dataset provides avenues to learn predicate-argument structure and multi-sentence reasoning to some extent. It was collected by asking crowd-workers to create question-answer pairs from Wikipedia articles such that the answer is a single-span in the context. The dataset was later updated to include unanswerable questions (Rajpurkar et al., 2018), giving a harder question set without as many reasoning shortcuts. We include only the development sets of SQuAD 1.1 and SQuAD 2.0 in our evaluation server. DuoRC (Saha et al., 2018) tests if the model can generalize to answering semantically similar but syntactically different paraphrased questions. The questions are created on movie summaries ob- tained from two sources, Wikipedia and IMDB. The crowd-workers formalized questions based on Wikipedia contexts and in turn answered them based on the IMDB context. This ensured that the model will not rely solely on lexical matching, but rather utilize semantic understanding. The answer can be either a single-span from context or free form text written by the annotator. Quoref (Dasigi et al., 2019) focuses on under- standing coreference resolution, a challenging as- pect of natural language understanding. It helps gauge how a model can handle ambiguous entity and event resolution to answer a question correctly. This dataset was created by asking crowd workers to write questions and multi-span answers from Wikipedia articles that centered around pronouns in the context. DROP (Dua et al., 2019) attempts to force mod- els to have a more comprehensive understanding of a paragraph, by constructing questions that query many parts of the paragraph at the same time. These questions involve reasoning opera- tions that are mainly rudimentary mathematical skills such as addition, subtraction, maximum, minimum, etc. To perform well on this dataset a model needs to locate multiple spans associated with questions in the context and perform a set of operations in a hierarchical or sequential manner to obtain the answer. The answer can be either a set of spans from the context, a number or a date. ROPES (Lin et al., 2019) centers around under- standing the implications of a passage of text, par- ticularly dealing with the language of causes and effects. A system is given a background passage, perhaps describing the effects of deforestation on local climate and ecosystems, and a grounded sit- uation involving the knowledge in the background passage, such as, City A has more trees than City B. The questions then require grounding the ef- fects described in the background, perhaps query- ing which city would more likely have greater eco- logical diversity. This dataset can be helpful in un- derstanding how to apply the knowledge contained in a passage of text to a new situation. NewsQA (Trischler et al., 2017) dataset focuses on paraphrased questions with predicate-argument structure understanding. To some extent it is simi- lar to DuoRC, however the examples are collected from news articles and offers diverse linguistic structures. This crowd-sourced dataset was cre- ated by asking annotators to write questions from CNN/DailyMail articles as context. NarrativeQA (Kocisk´y et al., 2018) focuses on understanding temporal reasoning among various events that happen in a given movie plot. It also tests the models ability to "hop" between various parts of the context and not rely solely on sequen- tial reasoning. The dataset was constructed by aligning books from Gutenberg 1 with the sum- maries of their movie adaptations from various 1http://www.gutenberg.org/ Dataset Dev Size Test Size Context Length (Avg) Answer Length (Avg) 123.7 127.5 4.0 10,570 - SQuAD1.1 10,570 - 4.2 SQuAD2.0 12,233 13,449 1113.6 2.8 DuoRC 2,418 2.7 Quoref 1.5 9,536 DROP 1.2 1,204 ROPES 5.1 NewsQA 5,166 NarrativeQA 3,443 4.7 348.2 2,537 195.1 9,622 177.1 1,015 5,126 711.3 10,557 567.9 Table 1: Dataset Statistics web resources. The crowd workers were asked to create complex questions about characters, narra- from summaries and typically tives, events etc. can be answered from summaries. In addition, crowd workers were required to provide answers that do not have high overlap with the context. In accordance with our format, we only use the ver- sion with the summaries as context in our evalua- tion server. 3 Synthetic Augmentations Prior works (Jia and Liang, 2017) have shown that RC models are brittle to minor perturbations in original dataset. Hence, to test the model's abil- ity to generalize to out-of-domain syntactic struc- tures and be logically consistent in its answers, we automatically generate questions based on various heuristics. These heuristics fall in two broad cate- gories. 1. The question is paraphrased to a minimal ex- tent to create new syntactic structures, keep- ing the semantics of the question largely in- tact and without making any changes to the original context and answer. 2. The predicate-argument structures of a given question-answer pair are leveraged to create new WH-questions based on the object in the question instead of the subject. This rule- based method, adopted from (Ribeiro et al., 2019), changes the question and answer keep- ing the context fixed. We use five augmentation techniques, where the first four techniques fall into the first category and the last technique falls into the second category. Invert Choice transforms a binary choice ques- tion by changing the order in which the choices are presented, keeping the answer the same. Dataset IC MWC Imp No-Ans SEARs NewsQA QuoRef DROP SQuAD ROPES DuoRC 0 0 1377 16 637 22 0 0 457 0 119 0 501 79 113 875 0 2706 347 385 284 594 201 - 16009 11759 16382 28188 2909 45020 Table 2: Yields of augmented datasets transforms More Wrong Choice a binary choice question by substituting the wrong choice in the question with another wrong choice from the passage. No Answer substitutes a name in the question for a different name from the passage to create with high probability a new question with no an- swer. SEARs creates minimal changes in word selec- tion or grammar while maintaining the original meaning of the question according to the rules de- scribed by Ribeiro et al. (2018). Implication creates a new question-answer pair, where the object of the original question is re- placed with the answer directly resulting in cre- ation of a new WH-question where the answer is now the object of the original question. These transformations are performed based on rules de- scribed by Ribeiro et al. (2019). We attempted all the above augmentation tech- niques on all the datasets (except NarrativeQA where entity and event tracking is complex and these simple transformations can lead to a high number of false positives). Table 2 shows the num- ber of augmentations generated by each augmenta- tion technique-dataset pair. A few sample augmen- tations are shown in Table 3. After generating all the augmented datasets, we manually identified the augmentation technique- dataset pairs which led to high-quality augmen- tations. We sample 50 questions from each aug- mented dataset and record whether they satisfy the three criteria given below. 1. Is the question understandable, with little to no grammatical errors? 2. Is the question semantically correct? 3. Is the new answer the correct answer for the new question? Table 4 shows the number of high-quality ques- tions generated for each dataset. We keep the Template Type Context (truncated) Original QA Pair Generated QA Pair Invert Choice More Wrong Choice Implication No Answer SEARs ... before halftime thanks to a David Akers 32-yard field goal, giving Detroit a 17-14 edge ... in the third, Wash- ington was able to equalize with John Potter making his first career field goal from 43 yards out ... in the fourth, Detroit took the lead again, this time by way of Akers hitting a 28-yard field goal, giving Detroit a 20-17 lead... The first issue in 1942 consisted of denominations of 1, 5, 10 and 50 centavos and 1, 5, and 10 Pesos. ... 1944 ushered in a 100 Peso note and soon after an inflationary 500 Pesos note. In 1945, the Japanese issued a 1,000 Pesos note... ... In 1562, naval officer Jean Ribault led an expedition that explored Florida and the present-day Southeastern U.S., and founded the outpost of Charlesfort on Parris Island, South Carolina... From 1975, Flavin installed permanent works in Europe and the United States, including ... the Union Bank of Switzerland, Bern (1996). ... The 1930s church was designed by Giovanni Muzio... Q: Which player scored more field goals, David Akers or John Potter? A: David Akers Q: Which player scored more field goals, John Potter or David Akers? A: David Akers Q: Which year ush- ered in the largest Pe- sos note, 1944 or 1945? A: 1945 Q: Which year ush- ered in the largest Pe- sos note, 1942 or 1945? A: 1945 Q: When first ault a settlement South A: 1562 did Rib- establish in Carolina? Q: Which permanent Flavin works install 1996? A: Union Bank of Switzerland, Bern did in Q: Who established in South a settlement Carolina 1562? A: Ribault in Q: Which permanent works did Giovanni Muzio install in 1996? A: No Answer ... Dhul-Nun al-Misri and Ibn Wahshiyya were the first historians to study hieroglyphs, by comparing them to the contemporary Coptic language used by Coptic priests in their time... compare Q: What did histori- ans to the language? Coptic A: hieroglyphs Q: What'd ans compare Coptic A: hieroglyphs histori- to the language? Table 3: Examples of generated augmentations with various templates. Dataset IC MWC Imp No-Ans SEARs NewsQA QuoRef DROP SQuAD ROPES DuoRC - - 46 15/16 48 18/22 - - 42 - 36 - 47 45 36 47 - 47 47 48 48 48 11 - 50 50 50 50 50 50 Table 4: Quality of augmented datasets (# of good ques- tions out of 50 sampled) augmentation technique-dataset pairs where at least 90% of the question-answer pairs satisfy the above three criteria. We further test the perfor- mance of these augmentations (Section 4) on a BERT (Devlin et al., 2019b) based model to estab- lish if the dataset has a sufficiently different ques- tion distribution from the original and has enough independent value to be incorporated into the eval- uation server. 4 Experiments 4.1 Model We train a numerically-aware BERT-based model2 (NABERT) on all the seven datasets and test its performance on existing datasets and synthetic 2https://github.com/raylin1000/drop-bert augmentations. NABERT is a BERT based model with the ability to perform discrete operations like counting, addition, subtraction etc. We added support for "impossible" answers in the existing NABERT architecture by extending the answer type predictor which classifies the type of reason- ing involved given a question into one of the fol- lowing five categories: number, span, date, count, impossible. All the hyper-parameter settings were kept the same. We noticed catastrophic forgetting on randomly sampling a minibatch for training, from all the datasets pooled together. To alleviate this problem, we sampled uniformly from each dataset in the be- ginning and then switched to sampling in propor- tion to the size of each dataset towards the end of the epoch (Stickland and Murray, 2019). This helped improve the performance on several dataset by 3-4% in EM, however, there is still a lot of room for improvement on this front. We also tried a simple BERT model (Devlin et al., 2019a) and MultiQA (Talmor and Berant, 2019) but NABERT gave the best results on the seven development sets. In case of DuoRC and NarrativeQA, some an- swers are free-form human generated and do not have an exact overlap with the context. However, Dataset Dev Test EM F1 EM F1 NewsQA Quoref DROP SQuAD 1.1 SQuAD 2.0 ROPES DuoRC 29.34 34.49 19.09 68.03 33.70 40.03 25.65 45.40 42.65 23.16 78.55 39.17 49.07 34.28 29.69 30.13 17.69 - - 47.96 23.44 46.19 38.39 21.87 - - 56.06 31.73 Narrative QA BLEU- 1 BLEU- 4 METEOR ROUGE- Dev Set Test Set 0.17 0.16 0.021 0.019 0.33 0.33 L (F1) 0.52 0.53 Table 5: Performance on baseline BERT model on dif- ferent datasets the NABERT model is trained to predict a span's start and end indices in the context. So for answers, which are not exact spans from the context we pick a span which has the highest ROUGE-L with the gold answer to serve as labels for training. How- ever, for evaluation we use the original gold an- swer and not the extracted passage span for evalu- ating the model's performance. 4.2 Existing Dataset Performance Table 5 shows the result of evaluating on all of the development and test sets using our evaluation server. We chose the official metrics adopted by the individual datasets to evaluate the performance of our baseline model. As can be seen in the table, the results are quite poor, significantly be- low single-dataset state-of-the-art on all datasets. The training of our initial baseline appears to be dominated by SQuAD 1.1, or perhaps SQuAD 1.1 mainly tests reasoning that is common to all of the other datasets. Significant research is re- quired to build reading systems and develop train- ing regimes that are general enough to handle mul- tiple reading comprehension datasets at the same time, even when all of the datasets are seen at train- ing time. 4.3 Synthetic Augmentations Table 6 shows the performance of the baseline model on various development sets and heuris- tically generated questions. The More Wrong Choice augmentation is omitted since a high enough quality and/or yield of questions could not be ensured for any of the datasets. When evalu- ated on out-of-domain linguistic structures, perfor- mance drops significantly for some augmentation- dataset pairs but only marginally for others. For questions generated by the Invert Choice augmen- tation, the model struggles to grasp the correct reasoning behind two answer options like Art Eu- phoric or Trescott Street and changes the predic- tion when the choices are flipped. However, rel- ative to the dev set performances on the original datasets, the performance drop is almost nonexis- tent. For the SEARs based augmentation the gen- erated linguistic variations are close to in-domain syntactic structure so we do not see much per- formance drop in most of the datasets except for ROPES and NewsQA. The Implication style ques- tions create a large performance drop for NewsQA and SQuAD while having a performance boost for DuoRC. Finally, the No-Ans type questions have the worst performance across board for all datasets. 5 Related Work Generalization and multi-dataset evaluation Recently there has been some work aimed at ex- ploring the relation and differences between multi- ple reading comprehension datasets. MULTIQA (Talmor and Berant, 2019) investi- gates over ten RC datasets, training on one or more source RC datasets, and evaluating generalization, as well as transfer to a target RC dataset. This work analyzes the factors that contribute to gener- alization, and shows that training on a source RC dataset and transferring to a target dataset substan- tially improves performance. MultiQA also pro- vides a single format including a model and in- frastructure for training and comparing question answering datasets. We provide no training mech- anism, instead focusing on very simple evaluation that is compatible with any training regime, includ- ing evaluating on hidden test sets. MRQA19, the Machine Reading for Question Answering workshop, introduced a shared task, which tests whether existing machine reading com- prehension systems can generalize beyond the datasets on which they were trained. The task provides six large-scale datasets for training, and evaluates generalization to ten different hidden test datasets. However these datasets were modified from there original version, and context was lim- ited to 800 tokens. In addition this shared task only tests for generalization with no intra-domain eval- uation. In contrast, our evaluation server simply Dev IC Imp No-Ans SEARs EM F1 EM F1 EM F1 EM F1 EM F1 NewsQA 29.34 34.49 QuoRef 19.09 DROP SQuAD 68.03 40.03 ROPES DuoRC 25.65 45.40 42.65 23.16 78.55 49.07 34.28 - - 40.23 56.25 24.08 27.27 - - 48.03 64.58 31.74 34.19 23.35 32.91 - 46.74 - 30.30 34.36 44.84 - 57.97 - 35.23 0.02 0.0 0.0 0.0 - - 0.02 0.0 0.0 0.0 - - 21.34 34.84 16.97 56.53 14.05 21.51 33.33 42.11 21.65 71.25 19.12 28.85 Template Type Answered Incorrectly Answered Correctly Invert Choice Implication SEARs art Which founded gallery Original: Eu- was phoric Street? Generated: Which art gallery was founded first, Trescott Street or Art Euphoric? first, Trescott Art or did When the Original: right Huguenots to the Baronies? Generated: Who secured the right to own land in baronies in 1697? secure in land own the Original: Who scored more field goals, Nate Kaeding or Dan Carpenter? Generated: Who scored more field goals, Dan Carpenter or Nate Kaeding? When Edict Henry Original: Nantes? issue Generated: What did Henry issue in 1598? did of the What Super the Original: theme 50? Generated: So what was the theme of Super Bowl 50? was Bowl of Original: Who won Super Bowl 50? Generated: So who won Super Bowl 50? Table 6: Quantitative and qualitative analysis of generated augmentations. We only show performance for high yield and high-quality augmentations. provides a single-model evaluation on many differ- ent datasets, with no prescriptions about training regimes. test labels has been exercised by various leader- boards on Kaggle and CodaLab, as well as shared tasks at the SemEval and CoNLL conferences. NLP evaluation benchmarks The General Lan- guage Understanding Evaluation benchmark or GLUE (Wang et al., 2018) is a tool for evaluating and analyzing the performance of models across a diverse range of existing NLU tasks. A newer version, Super-GLUE (Wang et al., 2019) is styled after GLUE with a new set of more difficult lan- guage understanding tasks. In this line of work another standard toolkit for evaluating the qual- ity of universal sentence representations is SEN- TEVAL (Conneau and Kiela, 2018). Similar to GLUE, SENTEVAL also encompasses a variety of tasks, including binary and multi-class classi- fication, natural language inference and sentence similarity. We differ from GLUE and SENTEVAL by focusing on reading comprehension tasks, and only evaluating a single model on all datasets, in- stead of allowing the model to be tuned to each dataset separately. Evaluation Platforms and Competitions in NLP The use of online evaluation platform with private Additional benchmarks such as PARLAI (Miller et al., 2017) and BABI (Weston et al., 2016) proposed a hierarchy of tasks towards building question answering and reasoning models and language understanding. However these frameworks do not include a standardized evaluation suite for system performance nor do they offer a wide set of reading comprehension tasks. 6 Conclusion We have presented ORB, an open reading bench- mark designed to be a comprehensive test of read- ing comprehension systems, in terms of their gen- eralizability, understanding of various natural lan- guage phenomenon, capability to make consistent predictions, and ability to handle out-of-domain questions. This benchmark will grow over time as more interesting and useful reading comprehen- sion datasets are released. We hope that this bench- mark will help drive research on general reading systems. 7 Acknowledgments We would like to thank NFS grant CNS-1730158 for providing computational resources (GPUs) to carry out all the experiments. References A. Conneau and D. Kiela. 2018. Senteval: An evalu- ation toolkit for universal sentence representations. Association for Computational Linguistics (ACL). Pradeep Dasigi, Nelson Liu, Ana Marasovic, Noah Smith, and Matt Gardner. 2019. Quoref: A read- ing comprehension dataset with questions requiring coreferential reasoning. In EMNLP. J. Devlin, M. Chang, K. Lee, and K. Toutanova. 2019a. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American As- sociation for Computational Linguistics (NAACL). Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019b. Bert: Pre-training of deep bidirectional transformers for language under- standing. North American Association for Computa- tional Linguistics (NAACL). D. Dua, Y. Wang, P. Dasigi, G. Stanovsky, S. Singh, and M. Gardner. 2019. Drop: A reading com- prehension benchmark requiring discrete reasoning over paragraphs. In North American Association for Computational Linguistics (NAACL). R. Jia and P. Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Em- pirical Methods in Natural Language Processing (EMNLP). T. Kocisk´y, J. Schwarz, P. Blunsom, C. Dyer, K. Her- mann, G. Melis, and E. Grefenstette. 2018. The nar- rativeqa reading comprehension challenge. Transac- tions of the Association for Computational Linguis- tics (TACL), 6:317 -- 328. Kevin Lin, Oyvind Tafjord, Peter Clark, and Matt Gard- ner. 2019. Reasoning over paragraph effects in situ- ations. arXiv preprint arXiv:1908.05852. A. H. Miller, W. Feng, A. Fisch, J. Lu, D. Batra, A. Bor- des, D. Parikh, and J. Weston. 2017. Parlai: A dialog research software platform. In Empirical Methods in Natural Language Processing (EMNLP), pages 79 -- 84. P. Rajpurkar, R. Jia, and P. Liang. 2018. Know what you don't know: Unanswerable questions for SQuAD. In Association for Computational Linguis- tics (ACL). P. Rajpurkar, J. Zhang, K. Lopyrev, and P. Liang. 2016. SQuAD: 100,000+ questions for machine compre- hension of text. In Empirical Methods in Natural Language Processing (EMNLP). Marco Tulio Ribeiro, Carlos Guestrin, and Sameer Singh. 2019. Are red roses red? evaluating con- sistency of question-answering models. In Proceed- ings of the 57th Conference of the Association for Computational Linguistics, pages 6174 -- 6184. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversar- ial rules for debugging nlp models. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 856 -- 865. A. Saha, R. Aralikatte, M. Khapra, and K. Sankara- narayanan. 2018. Duorc: Towards complex lan- guage understanding with paraphrased reading com- prehension. In Association for Computational Lin- guistics (ACL). Asa Cooper Stickland and Iain Murray. 2019. BERT and PALs: Projected attention layers for efficient adaptation in multi-task learning. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 5986 -- 5995, Long Beach, California, USA. PMLR. Alon Talmor and Jonathan Berant. 2019. Multiqa: An empirical investigation of generalization and trans- fer in reading comprehension. 57th Annual Confer- ence of the Association for Computational Linguis- tics (ACL), abs/1905.13453. A. Trischler, T. Wang, X. Yuan, J. Harris, A. Sordoni, P. Bachman, and K. Suleman. 2017. NewsQA: A machine comprehension dataset. In Workshop on Representation Learning for NLP. A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman. 2019. Superglue: A stickier benchmark for general- purpose language understanding systems. In Ad- vances in Neural Information Processing Systems (NeurIPS). Alex Wang, Amanpreet Singh, Julian Michael, Fe- lix Hill, Omer Levy, and Samuel Bowman. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353 -- 355, Brussels, Bel- gium. Association for Computational Linguistics. J. Weston, A. Bordes, S. Chopra, and T. Mikolov. 2016. Towards AI-complete question answering: A set of prerequisite toy tasks. ICLR. Haichao Zhu, Li Dong, Furu Wei, Wen- and Ting Liu. 2019. hui Wang, Bing Qin, Learning to ask unanswerable questions for machine reading comprehension. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4238 -- 4248, Florence, Italy. Association for Compu- tational Linguistics.
1906.09912
1
1906
2019-06-17T06:32:24
KaWAT: A Word Analogy Task Dataset for Indonesian
[ "cs.CL" ]
We introduced KaWAT (Kata Word Analogy Task), a new word analogy task dataset for Indonesian. We evaluated on it several existing pretrained Indonesian word embeddings and embeddings trained on Indonesian online news corpus. We also tested them on two downstream tasks and found that pretrained word embeddings helped either by reducing the training epochs or yielding significant performance gains.
cs.CL
cs
KaWAT: A Word Analogy Task Dataset for Indonesian Kemal Kurniawan Kata Research Team Kata.ai Jakarta, Indonesia [email protected] Abstract 9 1 0 2 n u J 7 1 ] L C . s c [ 1 v 2 1 9 9 0 . 6 0 9 1 : v i X r a We introduced KaWAT (Kata Word Analogy Task), a new word analogy task dataset for In- donesian. We evaluated on it several existing pretrained Indonesian word embeddings and em- beddings trained on Indonesian online news corpus. We also tested them on two downstream tasks and found that pretrained word embeddings helped either by reducing the training epochs or yielding significant performance gains. 1 Introduction Despite the existence of various Indonesian pretrained word embeddings, there are no publicly available Indonesian analogy task datasets on which to evaluate these embeddings. Consequently, it is unknown if Indonesian word embeddings introduced in, e.g., (Al-Rfou et al., 2013) and (Grave et al., 2018), capture syntactic or semantic information as measured by analogy tasks. Also, such embeddings are usually trained on Indonesian Wikipedia (Al-Rfou et al., 2013; Bojanowski et al., 2017) whose size is relatively small, approximately 60M tokens. Therefore, in this work, we introduce KaWAT (Kata Word Analogy Task), an Indonesian word analogy task dataset, and new Indonesian word embeddings pretrained on 160M tokens of online news corpus. We evaluated these embeddings on KaWAT, and also tested them on POS tagging and text summarization as representatives of syntactic and semantic downstream task respectively. 2 Methodology We asked an Indonesian linguist to help build KaWAT based on English analogy task datasets such as Google Word Analogy (Mikolov et al., 2013a) and BATS (Gladkova et al., 2016). Following those works, we split the analogy tasks into two categories, syntax and semantic. We included mostly morpho- logical analogies in the syntax category, leveraging the richness of Indonesian inflectional morphology. For semantic, we included analogies such as antonyms, country capitals and currencies, gender-specific words, measure words, and Indonesian province capitals. In total, we have 15K syntactic and 19K se- mantic analogy queries. KaWAT is available online.1 One of the goals of this work is to evaluate and compare existing Indonesian pretrained word embeddings. We used fastText pretrained embeddings introduced in (Bojanowski et al., 2017) and (Grave et al., 2018), which have been trained on Indonesian Wikipedia and Indonesian Wikipedia plus Common Crawl data respectively. We refer to them as Wiki/fastText and CC/fastText here- inafter. We also used another two pretrained embeddings: polyglot embedding trained on Indonesian Wikipedia (Al-Rfou et al., 2013) and NLPL embedding trained on the Indonesian portion of CoNLL 2017 corpus (Fares et al., 2017). For training our word embeddings, we used online news corpus obtained from Tempo.2 We used Tempo newspaper and magazine articles up to year 2014. This corpus contains roughly 400K articles, 160M word tokens, and 600K word types. To train the word embeddings, we experi- mented with three algorithms: word2vec (Mikolov et al., 2013b), fastText (Bojanowski et al., 2017), and 1https://github.com/kata-ai/kawat 2https://www.tempo.co GloVe (Pennington et al., 2014). We refer to them henceforth as Tempo/word2vec, Tempo/fastText, and Tempo/GloVe respectively. We used gensim3 to run word2vec and fastText and the original C imple- mentation for GloVe.4 For all three, we used their default hyperparameters, i.e. no tuning was performed. Our three embeddings are available online.5 Evaluation on KaWAT was done using gensim with its KeyedVectors.most similar method. Since the vocabularies of the word embeddings are different, for a fair comparison, we first removed analogy queries containing words that do not exist in any vocabulary. In other words, we only kept queries whose words all exist in all vocabularies. After this process, there were roughly 6K syntactic and 1.5K semantic queries. We performed evaluation by computing 95% confidence interval of the accuracy at rank 1 by bootstrapping. Our implementation code is available online.6 3 Results 3.1 Word analogy results We found that on syntactic analogies, Wiki/fastText achieved 2.7% accuracy, which significantly outper- formed the others, even CC/fastText which has been trained on a much larger corpus. Other embeddings performed poorly, mostly less than 1% of accuracy. The overall trend of low accuracy scores attests to the difficulty of syntactic KaWAT analogies, making it suitable as benchmark for future research. On semantic analogies, Tempo/GloVe clearly outperformed the others with 20.42% accuracy, except Tempo/word2vec. Surprisingly, we found that Tempo/fastText performed very poorly with less than 1% accuracy, even worse than Wiki/fastText which has been trained on a much smaller data. Overall, the accuracies on semantic are also low, less than 25%, which again attests to the suitability of KaWAT as benchmark for future work. 3.2 Downstream task results To check how useful these embeddings are for downstream tasks, we evaluated them on POS tagging and text summarization task. For each task, we compared two embeddings, which are the best off-the-shelf pretrained embedding and our proposed embedding on the syntactic (for POS) and semantic (for summa- rization) analogy task respectively.7 We used the same model and setting as (Kurniawan and Aji, 2018) for POS tagging and (Kurniawan and Louvan, 2018) for summarization. However, for computational reasons, we tuned only the learning rate using grid search, and only used the first fold of the summa- rization dataset. Our key finding from the POS tagging experiment is that using the two embeddings did not yield significant gain on test F1 score compared with not using any pretrained embedding (around 97.23). However, on average, using Wiki/fastText resulted in 20% fewer training epochs, compared with only 4% when using Tempo/GloVe. For the summarization experiment, Tempo/GloVe was significantly better8 than CC/fastText in ROUGE-1 and ROUGE-L scores (66.63 and 65.93 respectively). The scores of using CC/fastText was on par to those of not using any pretrained word embedding, and we did not observe fewer training epochs when using pretrained word embedding. 4 Conclusion We introduced KaWAT, a new dataset for Indonesian word analogy task, and evaluated several Indone- sian pretrained word embeddings on it. We found that (1) in general, accuracies on the analogy tasks were low, suggesting that improvements for Indonesian word embeddings are still possible and KaWAT is hard enough to be the benchmark dataset for that purpose, (2) on syntactic analogies, embedding by (Bojanowski et al., 2017) performed best and yielded 20% fewer training epochs when employed for POS tagging, and (3) on semantic analogies, GloVe embedding trained on Tempo corpus performed best and produced significant gains on ROUGE-1 and ROUGE-L scores when used for text summarization. 3https://radimrehurek.com/gensim 4https://github.com/stanfordnlp/GloVe 5https://drive.google.com/open?id=1T9RmF0nHwN742aDkkQbjimpUCLgeVkhT 6https://github.com/kata-ai/id-word2vec 7We performed paired t-test and found Tempo/GloVe to be the best among our Tempo embeddings (p < 0.05). 8As evidenced by the 95% confidence interval reported by the ROUGE script. 5 Acknowledgment We thank Tempo for their support and access to their news and magazine corpora. We also thank Rezka Leonandya and Fariz Ikhwantri for reviewing the earlier version of this manuscript. References Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. 2013. Polyglot: Distributed Word Representations for Mul- tilingual NLP. In Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pages 183 -- 192, Sofia, Bulgaria. Association for Computational Linguistics. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135 -- 146. Murhaf Fares, Andrey Kutuzov, Stephan Oepen, and Erik Velldal. 2017. Word vectors, reuse, and replicability: Towards a community repository of large-text resources. In Proceedings of the 21st Nordic Conference on Computational Linguistics, pages 271 -- 276, Gothenburg, Sweden, May. Linkoping University Electronic Press, Linkopings universitet / Language Technology Group, Department of Informatics, University of Oslo, Norway. Anna Gladkova, Aleksandr Drozd, and Satoshi Matsuoka. 2016. Analogy-based detection of morphological and semantic relations with word embeddings: What works and what doesn't. In Proceedings of the NAACL Student Research Workshop, pages 8 -- 15, San Diego, California. Association for Computational Linguistics. Edouard Grave, Piotr Bojanowski, Prakhar Gupta, Armand Joulin, and Tomas Mikolov. 2018. Learning Word Vectors for 157 Languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC-2018), Miyazaki, Japan. European Language Resource Association. Kemal Kurniawan and Alham Fikri Aji. 2018. Toward a Standardized and More Accurate Indonesian Part-of- In 2018 International Conference on Asian Language Processing (IALP), pages 303 -- 307, Speech Tagging. Bandung, Indonesia, November. IEEE. Kemal Kurniawan and Samuel Louvan. 2018. IndoSum: A New Benchmark Dataset for Indonesian Text Summa- rization. In 2018 International Conference on Asian Language Processing (IALP), pages 215 -- 220, Bandung, Indonesia, November. IEEE. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013a. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S. Corrado, and Jeff Dean. 2013b. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems, pages 3111 -- 3119. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global Vectors for Word Rep- resentation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532 -- 1543, Doha, Qatar. Association for Computational Linguistics.
1807.11276
1
1807
2018-07-30T10:31:52
Graphene: Semantically-Linked Propositions in Open Information Extraction
[ "cs.CL" ]
We present an Open Information Extraction (IE) approach that uses a two-layered transformation stage consisting of a clausal disembedding layer and a phrasal disembedding layer, together with rhetorical relation identification. In that way, we convert sentences that present a complex linguistic structure into simplified, syntactically sound sentences, from which we can extract propositions that are represented in a two-layered hierarchy in the form of core relational tuples and accompanying contextual information which are semantically linked via rhetorical relations. In a comparative evaluation, we demonstrate that our reference implementation Graphene outperforms state-of-the-art Open IE systems in the construction of correct n-ary predicate-argument structures. Moreover, we show that existing Open IE approaches can benefit from the transformation process of our framework.
cs.CL
cs
Graphene: Semantically-Linked Propositions in Open Information Extraction Matthias Cetto1, Christina Niklaus1, Andr´e Freitas2, and Siegfried Handschuh1 {matthias.cetto, christina.niklaus, siegfried.handschuh}@uni-passau.de 1 Faculty of Computer Science and Mathematics, University of Passau 2 School of Computer Science, University of Manchester 8 1 0 2 l u J 0 3 ] L C . s c [ 1 v 6 7 2 1 1 . 7 0 8 1 : v i X r a [email protected] Abstract We present an Open Information Extraction (IE) approach that uses a two-layered transforma- tion stage consisting of a clausal disembedding layer and a phrasal disembedding layer, together with rhetorical relation identification. In that way, we convert sentences that present a complex linguistic structure into simplified, syntactically sound sentences, from which we can extract propositions that are represented in a two-layered hierarchy in the form of core relational tuples and accompanying contextual information which are semantically linked via rhetorical relations. In a comparative evaluation, we demonstrate that our reference implementation Graphene outper- forms state-of-the-art Open IE systems in the construction of correct n-ary predicate-argument structures. Moreover, we show that existing Open IE approaches can benefit from the transfor- mation process of our framework. Introduction 1 Information extraction (IE) turns the unstructured information expressed in natural language (NL) text into a structured representation (Jurafsky and Martin, 2009) in the form of relational tuples that consist of a set of arguments and a phrase denoting a semantic relation between them, e.g. (cid:104)Barack Obama; served as; the 44th President of the US(cid:105). Traditional IE systems have concentrated on identifying and extracting relations of interest by taking as input the target relations, along with hand-crafted extraction patterns or patterns learned from hand-labeled training examples. As this manual labor scales linearly with the number of target relations, such a supervised approach does not scale to large, heterogeneous corpora which are likely to contain a variety of unanticipated relations. To tackle this issue, Banko et al. (2007) introduced Open IE as a new extraction paradigm that allows for a domain-independent discovery of relations in large amounts of text by not depending on any relation-specific human input. Instead, detecting the relations is part of the problem. State-of-the-art Open IE systems (see Section 2) identify relationships between entities in a sentence by matching patterns over either shallow syntactic features in terms of part-of-speech (POS) tags and noun phrase (NP) chunks or dependency tree structures. However, particularly long and syntactically complex sentences pose a challenge for current Open IE approaches. By analyzing the output of such systems (see Figure 1), we observed three common shortcomings. First, relations often span over long nested structures or are presented in a non-canonical form that cannot be easily captured by a small set of extraction patterns. Therefore, such relations are commonly missed by state-of-the-art approaches. Consider for example the first sentence in Figure 1 which asserts that (cid:104)Sonia Sotomayor; became; the first Supreme Court Justice of Hispanic descent(cid:105). This information is encoded in a complex participial construction that is omitted by both reference Open IE systems, OLLIE (Mausam et al., 2012) and ClausIE (Del Corro and Gemulla, 2013). Second, current Open IE systems tend to extract propositions with long argument phrases that can be further decomposed into meaningful propositions, with each of them representing a separate fact. Overly specific constituents that mix multiple - potentially semantically unrelated - propositions are difficult This work is licenced under a Creative Commons Attribution 4.0 International Licence. Licence details: http:// creativecommons.org/licenses/by/4.0/ He nominated Sonia Sotomayor on May 26, 2009 to replace David Souter; she was confirmed on August 6, 2009, becoming the first Supreme Court Justice of Hispanic descent. OLLIE: (1) she (2) He (3) He (4) He (5) Sonia Sotomayor (6) He (7) 2009 was confirmed on nominated Sonia Sotomayor on nominated Sonia Sotomayor nominated 2009 on be nominated 2009 on nominated 2009 be nominated Sonia Sotomayor on August 6, 2009 May 26 2009 May 26 May 26 Sonia Sotomayor May 26 ClausIE: He (8) (9) she (10) she nominated was confirmed was confirmed Sonia Sotomayor on May 26 2009 to replace David Souter on August 6 2009 becoming the first Supreme Court Justice of Hispanic descent becoming the first Supreme Court Justice of Hispanic descent Graphene: (11) #1 ("a) ("b) (12) #2 ("a) (13) #3 0 he S:PURPOSE S:TEMPORAL she S:TEMPORAL she 0 0 nominated Sonia Sotomayor to replace David Souter on May 26, 2009 was confirmed on August 6, 2009 was becoming the first Supreme Court Justice of Hispanic descent Although the Treasury will announce details of the November refunding on Monday, the funding will be delayed if Congress and President Bush fail to increase the Treasury's borrowing capacity. OLLIE: (14) the Treasury (15) Congress and President Bush will announce fail to increase details of the November refunding the Treasury's borrowing capacity ClausIE: (16) the Treasury (17) the Treasury (18) the funding (19) the funding will announce will announce will be delayed will be delayed details of the November refunding on Monday details of the November refunding if Congress and President Bush fail to increase the Treasury 's [...] if Congress and President Bush fail to increase the Treasury 's [...] (20) Congress and President Bush (21) the Treasury has borrowing capacity Although the Treasury will announce details of the November [...] fail to increase the Treasury 's borrowing capacity the Treasury will announce details of the November refunding the funding will be delayed Graphene: (22) #1 ("a) ("b) (23) #2 ("a) ("b) ("c) (24) #3 (25) #4 0 0 1 1 S:TEMPORAL L:CONTRAST L:CONTRAST L:CONDITION L:CONDITION on Monday #2 #1 #3 #4 Congress president Bush fail to increase the Treasury 's borrowing capacity fail to increase the Treasury 's borrowing capacity Figure 1: Comparison of the output generated by different state-of-the-art Open IE systems. Contextual arguments of Graphene are differentiated between simple textual arguments (S:) or arguments that link to other propositions (L:). Both contextual types are semantically classified by rhetorical relations. to handle for downstream applications, such as question answering (QA) or textual entailment tasks. Instead, such approaches benefit from extractions that are as compact as possible. This phenomenon can be witnessed particularly well in the extractions generated by ClausIE ((8-10) and (16-21)), whose argument phrases frequently combine several semantically independent statements. For instance, the argument in proposition (8) contains three unrelated facts, namely a direct object (cid:104)Sonia Sotomayor(cid:105), a temporal expression (cid:104)on May 26 2009(cid:105) and a phrasal description (cid:104)to replace David Souter(cid:105) specifying the purpose of the assertion on which it depends. Third, they lack the expressiveness needed to properly represent complex assertions, resulting in in- complete, uninformative or incoherent propositions that have no meaningful interpretation or miss crit- ical information asserted in the input sentence. Most state-of-the-art systems focus on extracting bi- nary relationships without preserving the semantic connection between the individual propositions. This can be seen in the second example in Figure 1. Here, the proposition (cid:104)Congress and President Bush; fail to increase; the Treasury's borrowing capacity(cid:105) is not asserted by the input sentence, but rather represents the precondition for the predication that (cid:104)the funding; will be delayed; ∅(cid:105). However, both state-of-the-art Open IE systems fail to accurately reflect this contextual information in the extracted relational tuples. While OLLIE completely ignores above-mentioned inter-proposition relationship in its extractions, ClausIE incorporates this information in its argument phrases ((18) and (19)), yet producing over-specified components that is likely to hurt the performance of downstream semantic applications. To overcome these limitations, we developed an Open IE framework that transforms complex NL sentences into clean, compact structures that present a canonical form which facilitates the extraction of accurate, meaningful and complete propositions. The contributions of our work are two-fold. First, to remove the complexity of determining intricate predicate-argument structures with variable arity from syntactically complex input sentences, we propose a two-layered transformation process consisting of a clausal and phrasal disembedding layer. It removes clauses and phrases that convey no central informa- tion from the input and converts them into independent sentences, thereby reducing the source sentence to its main information. In that way, the input is transformed into a novel hierarchical representation in the form of core facts and accompanying contexts. Second, we identify the rhetorical relations by which core sentences and their associated contexts are connected in order to preserve their se- mantic relationship (see the output of our reference Open IE implementation Graphene in Figure 1). These two innovations enable us to enrich extracted relational tuples of the form (cid:104)arg1, rel, arg2(cid:105) with contextual information that further specifies the tuple and to establish semantic links between them, al- lowing to fully reconstruct the informational content of the input. The resulting representation of the source text can then be used to facilitate a variety of artificial intelligence tasks, such as building QA systems or supporting semantic inferences. The idea of generating a syntactically sound representation from linguistically complex NL sentences can be easily transported to other tasks than Open IE, e.g. it might be helpful for problems such as sentiment analysis, coreference resolution or text summarization. 2 Related Work Learning-based approaches. The line of work on Open IE begins with TEXTRUNNER (Banko et al., 2007), a self-supervised learning approach which uses a Naive Bayes classifier to train a model of relations over examples of extraction tuples that are heuristically generated from sentences in the Penn Treebank using unlexicalized POS and NP chunk features. The system then applies the learned extractor to label each word between a candidate pair of NP arguments as part of a relation phrase or not. WOE (Wu and Weld, 2010) also learns an open information extractor without direct supervision. It makes use of Wikipedia as a source of training data by bootstrapping from entries in Wikipedia infoboxes to learn extraction patterns on both POS tags (WOEpos) and dependency parses (WOEparse). By comparing their two approaches, Wu and Weld (2010) show that the use of dependency features results in an increase in precision and recall over shallow linguistic features (though, at the cost of extraction speed). OLLIE follows the idea of bootstrap learning of patterns based on dependency parse paths. However, while WOE relies on Wikipedia-based bootstrapping, OLLIE applies a set of high precision seed tuples from its predecessor system REVERB to bootstrap a large training set. Moreover, OLLIE is the first Open IE approach to identify not only verb-based relations, but also noun-mediated ones. Rule-based approaches. The second category of Open IE systems make use of hand-crafted extraction rules. This includes REVERB (Fader et al., 2011), a shallow extractor that applies a set of lexical and syn- tactic constraints that are expressed in terms of POS-based regular expressions. In that way, the amount of incoherent, uninformative and overspecified relation phrases is reduced. While previously mentioned Open IE systems focus on the extraction of binary relations, KRAKEN (Akbik and Loser, 2012) is the first approach to be specifically built for capturing complete facts from sentences by gathering the full set of arguments for each relation phrase within a sentence, thus producing tuples of arbitrary arity. The identification of relation phrases and their corresponding arguments is based on hand-written extraction rules over typed dependency information. EXEMPLAR (Mesquita et al., 2013) applies a similar approach for extracting n-ary relations, as it uses hand-crafted patterns based on dependency parse trees to detect a relation trigger and the arguments connected to it. Clause-based approaches. Aiming to improve the accuracy of Open IE approaches, more recent work is based on the idea of incorporating a sentence re-structuring stage whose goal is to transform the original sentence into a set of independent clauses that are easy to segment into Open IE tuples. An example of such a paraphrase-based Open IE approach is ClausIE, which exploits linguistic knowledge about the grammar of the English language to map the dependency relations of an input sentence to clause constituents. In that way, a set of coherent clauses presenting a simple linguistic structure is derived from the input. Then, one or more predicate-argument extractions are generated for each clause. In the same vein, Schmidek and Barbosa (2014) propose a strategy to break down structurally complex sentences into simpler ones by decomposing the original sentence into its basic building blocks via chunking. The dependencies of each two chunks are then determined using dependency parsing or a Naive Bayes classifier. Depending on their relationships, chunks are combined into simplified sentences, upon which the task of relation extraction is carried out. Angeli et al. (2015) present Stanford Open IE, an approach in which a classifier is learned for splitting a sentence into a set of logically entailed shorter utterances which are then maximally shortened by running natural logic inference over them. In the end, a small set of hand-crafted patterns are used to extract a predicate-argument triple from each utterance. On the basis of such re-arrangement strategies for decomposing a complex input sentence into a set of self-contained clauses that present a linguistic structure that is easier to process for Open IE systems, we have developed an Open IE pipeline which will be presented in the following section. 3 Proposed Open IE Approach We propose a method for facilitating the task of Open IE on sentences that present a complex linguistic structure. It is based on the idea of disembedding clausal and phrasal constituents out of a source sen- tence. In doing so, our approach identifies and retains the semantic connections between the individual components, thus generating a novel lightweight semantic Open IE representation. We build upon the concept presented in Niklaus et al. (2016), who distinguish between core and con- textual information in the context of sentence simplification. This is done by disembedding and trans- forming supplementary material expressed in phrases (e.g. spatial or temporal information) into stand- alone context sentences, thus reducing the input sentences to their key information (core sentences). In our work, we now port this idea to a broader scope by targeting clausal disembedding techniques for complex, nested structures. Furthermore, by converting the whole simplification process into a recur- sive process, we are able to generate a hierarchical representation of syntactically simplified core and contextual sentences (see center image of Figure 2). Moreover, this allows us to detect both local and long-range rhetorical dependencies that hold between nested structures, similar to Rhetorical Structure Theory (RST) (Mann and Thompson, 1988). As a consequence, when carrying out the task of Open IE on the compressed core sentences, the complexity of determining intricate predicate-argument structures is removed and the extracted propositions can be semantically linked and enriched with the disembedded contextual information. Our proposed framework uses a two-layered transformation stage for recursive sentence simplification that is followed by a final relation extraction stage. It takes a text document as an input and returns a set of hierarchically ordered and semantically interconnected relational tuples (see the output of Graphene in Figure 1). The workflow of our approach is displayed in Figure 2. 3.1 Transformation Stage The core component of our work is the two-layered transformation stage where sentences that present a complex linguistic form are recursively transformed into simpler, compact, syntactically sound sentences with accompanying contextual information. 3.1.1 Concept of the Discourse Tree Creation During the transformation process, we aim to identify intra-sentential semantic relationships which can later be used to restore semantic relations between extracted propositions. To cap- ture these semantic relations, we employ a concept of RST, is repre- sented as a hierarchy of consecutive, non-overlapping text spans (so-called Elementary Discourse Units (EDUs)) that are connected by rhetorical relations such as Condition, Enablement or Back- ground. In addition, Mann and Thompson (1988) introduced the notion of nuclearity, where text spans that are connected by rhetorical relations are classified as either nucleus, when em- bodying the central part of information, or satellite, whose role is to further specify the nucleus. in which a document Input-Document Transformation Stage DOCUMENT-ROOT core Coordination Contrast → core The Treasury will announce details of the November refunding. TEMPORAL(on Monday) core Subordination Condition → core The funding will be delayed. context Coordination List [...] Although the Treasury will announce details of the November refunding on Monday, the funding will be delayed if Congress and President Bush fail to increase the Treasury's borrowing capacity. [...] core core Congress fail to increase the Treasury's borrowing capacity. President Bush fail to increase the Treasury's borrowing capacity. Figure 2: Extraction workflow for an example sentence. Relation Extraction The Treasury will announce details [...] Contrast TEMPORAL(on Monday) Condition Condition The funding will be delayed. Congress fail to increase [...] List President Bush fail to increase [...] (cid:104)The Treasury; will announce; details [...](cid:105) TEMPORAL(on Monday) (cid:104)The funding; will be delayed; (cid:105) (cid:104)Congress; fail; to increase [...](cid:105) (cid:104)President Bush; fail; to increase [...](cid:105) We adapt the RST framework for our task of clausal sen- tence simplification, where the goal is to split up complex multi-clause sentences in a recursive fashion in order to obtain a hierarchical structure of the input similar to the diagrams used in RST. As opposed to RST, the resulting simplified sentences, which are represented as leaf nodes in the tree, cannot be specified prior to the transforma- tion process, since they are not uniform and might require transformations (e.g. paraphrasing) for specific syntactic environments in which they occur. Therefore, the trans- formation process is carried out in a top-down fashion, starting with the input document and using a set of syn- tactic rule patterns that define how to split up, transform and recurse on complex syntactic sentence patterns (see Section 3.1.3). Each split will then create two or more simplified sentences that are connected with information about their constituency type (coordinate or subordinate) and identified rhetorical relation. The constituency type infers the concept of nuclearity, where coordinate sen- tences (which we will call core sentences) represent nu- cleus spans and subordinate sentences (context sentences) represent satellite spans. In this way, we obtain a hierar- chical tree representation of the input document similar to RST. We will denote the resulting tree as a discourse tree. Rule: Subordinated Clauses with Closing Subordi- native Clauses Phrasal Pattern: ROOT S z1 NP(cid:48) z2 z3 VP VP* SBAR z5 z4 x S(cid:48) NP VP Extraction: Cue phrase: x z1(cid:107)NP(cid:48)(cid:107)z2(cid:107)z3(cid:107)z4(cid:107)z5 S(cid:48) Figure 3: Rule for subordinated clauses with closing subordinative clauses ("(cid:107)" denotes concatenation). Note that our approach differs from RST in the following ways: 1) connected sentences do not have to be non-overlapping text spans; 2) our approach works in a top-down fashion where the final simplified sentences result from the transformation process, whereas in RST, the smallest elements of discourse (EDUs) are identified in advance. 3.1.2 Algorithm The transformation algorithm (see Algorithm 1) takes as an input the document text as a string and outputs its discourse tree. In the initialization step (2), the discourse tree is set up in the form of a single, unclassified coordination node that represents the root of the document's discourse tree. It contains edges to every sentence that has been tokenized out of the document string, which are treated as coordinated leaf nodes. In this way, all sentences are considered as core sentences, thus being equally relevant. Algorithm 1 Transformation Stage Input: the document-string str Output: the discourse tree discourse tree 1: function TRANSFORMATION(str) 2: 3: 4: discourse tree ← initialize as a document root node with leaf-nodes for each sentence in str. TRAVERSEDISCOURSETREE(discourse tree) discourse tree ← further disembed contextual phrases (e.g. temporal, spatial) out of sentence leaves using the Sentence Simplification system proposed by Niklaus et al. (2016). return discourse tree 5: 6: end function if rule.pattern.matches(leaf.parse tree) then match ← False (cid:46) Check clausal transformation rules in fixed order for rule in T RAN SF ORM RU LES do match ← True Break (cid:46) Process leaves from left to right for leaf in tree.leaves do 7: procedure TRAVERSEDISCOURSETREE(tree) 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: end for if match == True then end if (cid:46) Disembedding / Simplification simplif ied sentences ← rule.disembed(leaf.parse tree) new leaves ← convert simplif ied sentences into leaf nodes. Nodes for subordinate sentences are labelled as context, else core new node ← create new parent node for new leaves. If a context sentence is enclosed, the constituency is subordinate, else coordinate (cid:46) Rhetorical relation identification cue phrase ← rule.extract cue(leaf.parse tree) new node.relation ← match cue phrase against a list of rhetorical cue words that are assigned to their most likely triggered rhetorical relation. Different cue word lists are used for different syntactic environments. (cid:46) Recursion tree.replace(leaf, new node) TRAVERSEDISCOURSETREE(new node) 26: 27: 28: 29: 30: 31: end procedure end for end if After initialization, the discourse tree is traversed and split up recursively in a top- down approach (3, 7). The tree traversal is done by processing sentence leaves in depth- first order, starting from the root node. For every leaf (9), we check if its phrasal parse structure matches one of the fixed ordered set of 16 hand-crafted syntactic rule patterns (see Section 3.1.3) that determine how a sentence is split up into two or more simplified sen- tence leaves (13). The first matching rule will be used, generating two or more simplified sentences (20) that will again be processed in this way. In addition to generating simpli- fied sentences, each rule also determines the constituency type of the newly created node (22) and returns a cue phrase which is used as a lexical feature for classifying the type of rhetorical relation connecting the split sen- tences (24, 25). The algorithm terminates when no more rule matches the set of gener- ated sentences. Finally, we use the sentence simplification system of Niklaus et al. (2016) to further disembed contextual phrases out of the simplified sentences from the discourse tree (4). The complete source code of our Example: Subordinated Clauses with Closing Subordinative Clauses Sentence: "The Great Red Spot may have been observed in 1664 by Robert Hooke, although this is disputed." Matched Pattern: ROOT S NP VP The Great Red Spot MD VP may VB VP have VBN VP . . been VBN PP observed by Robert Hooke , , SBAR IN S although VP is disputed NP DT this Extraction: "although" → Contrast core core The Great Red Spot may have been observed in 1664 by Robert Hooke. This is disputed. Figure 4: Example for subordinated clauses with clos- ing subordinative clauses. framework can be found online1. 3.1.3 Transformation Rules The set of hand-crafted transformation rules used in the simplification process are based on syntactic and lexical features that can be obtained from a sentence's phrase structure, which we generated with the help of Stanford's pre-trained lexicalized parser (Socher et al., 2013). These rules make use of regular expressions over the parse trees encoded in the form of Tregex patterns (Levy and Andrew, 2006). They were heuristically determined in a rule engineering process whose main goal was to provide a best-effort set of rules, targeting the challenge of being applied in a recursive fashion and to overcome biased or erroneous parse trees. During our experiments, we developed a fixed execution order of rules which achieved the highest F1-score in the evaluation setting. Each rule pattern accepts a sentence's phrasal parse tree as an input and encodes a certain parse tree pattern that, in case of a match, will extract textual parts out of the tree that are used to produce the following information: Simplified sentences The simplified sentences are generated by combining extracted parts from the parse tree. Note that some of the extracted parts such as phrases also require to be arranged and complemented in a way so that they form grammatically correct sentences (paraphrasing), aiming for a canonical subject-predicate-object structure. Constituency Our notion of constituency depicts the contextual hierarchy between the simplified sen- tences. If all sentences can be considered to be equally important, we will call it a coordination. In this case, all generated sentences are labeled as core sentences. Otherwise, i.e. if one sentence provides background information or further specifies another sentence, we use the term subordinate and label the sentence as context sentence. In most of the cases, our framework uses the syntactic in- formation of coordinated and subordinated clauses to infer the same type of (semantic) constituency with respect to the rhetorical relations. An example where this does not apply are rules for identify- ing attributions. In these cases, we consider an actual statement (e.g. "Economic activity continued to increase.") to be more important than the fact that this was stated by some entity (e.g. "This was what the Federal Reserve noted."). Classified rhetorical relation Both syntactic and lexical features are used during the transformation process to identify and classify rhetorical relations that hold between the simplified sentences. Syn- tactic features are manifested in the phrasal composition of a sentence's phrasal parse tree, whereas lexical features are extracted from the parse tree as so-called cue phrases. Cue phrases (often de- noted as discourse markers) represent a sequence of words that are likely to include rhetorical cue words (e.g. "because", "after that" or "in order to") indicating a certain rhetorical relation. The way these cue phrases are extracted from a sentence's parse tree is specific to each rule pattern. For determining potential cue words and their positions in specific syntactic environments, we use the work of Knott and Dale (1994). The extracted cue phrases are then used to infer the kind of rhetori- cal relation. For this task, we use a predefined list of rhetorical cue words which are assigned to the rhetorical relation that they most likely trigger. The mapping of cue words to rhetorical relations was adapted from the work of Taboada and Das (2013). If one of these cue words is present in the cue phrase, the corresponding rhetorical relation is set between the newly constructed sentences. An example for a transformation rule, targeting subordinate clausal constructions, is illustrated in Figure 3. Figure 4 shows its application to an example sentence. The full rule set can be found in the supplementary material online2. Here, a detailed example that demonstrates the process of turning a complex NL sentence into a discourse tree is provided, too. 3.2 Relation Extraction 1https://github.com/Lambda-3/Graphene 2https://github.com/Lambda-3/Graphene/tree/master/wiki/supplementary z3 z6 z7 z1 z2 VP VP* topmost S(cid:48) NP(cid:48) rel ← z3 (cid:107)z4 arg1 ← NP' arg2 ← x (cid:107)z5 The last step in our framework is realized by the actual relation extraction task. To do so, each of the previ- ously generated leaf sentences is given as an input to any Open IE system that is able to extract one (or more) binary propositions from a given sentence. In order to map the identified rhetorical and contextual relation- ships from the discourse tree to the extracted propo- sitions, we need to determine which of the extracted propositions embodies the main statement of the cor- responding sentence. We use the following heuristic to decide whether an extracted proposition represents the main statement of the input sentence: 1) the head verb of the input sentence is contained in the relational phrase rel of the proposition (cid:104)arg1; rel; arg2(cid:105) (e.g. (cid:104)Employees; are nominated; for the program(cid:105)); or 2) the head verb of the input sentence equals the object argument arg2 of the proposition (e.g. (cid:104)Employees; are; nominated(cid:105)). We will denote any proposition that matches those criteria as a representative of the corresponding sentence. Once determined, the iden- tified rhetorical and contextual relations that hold between two sentences from the discourse tree can be directly transferred as (semantically typed) additional arguments to the corresponding representatives, thus generating n-ary relations. Figure 5: Graphene's default relation extrac- tion pattern ("(cid:107)" denotes concatenation). NP PP S SBAR z4 z5 x In this way, extractions from any Open IE system that uses our framework can be enriched with se- mantic information. An example of the semantically enriched output produced by the Open IE system OLLIE when using our framework as a preprocessing step is shown in Figure 6. In our baseline imple- mentation Graphene, we use one syntactic rule pattern that operates on the sentence's phrase structure and identifies simple subject-predicate-object structures. The default pattern, which extracts one tuple for each sentence, is shown in Figure 5. He nominated Sonia Sotomayor on May 26, 2009 to replace David Souter; she was confirmed on August 6, 2009, becoming the first Supreme Court Justice of Hispanic descent. OLLIE (alone): (1) she (2) He (3) He (4) He (5) Sonia Sotomayor (6) He (7) 2009 was confirmed on nominated Sonia Sotomayor on nominated Sonia Sotomayor nominated 2009 on be nominated 2009 on nominated 2009 be nominated Sonia Sotomayor on August 6, 2009 May 26 2009 May 26 May 26 Sonia Sotomayor May 26 0 Ollie (using framework): (8) #1 ("a) ("b) (9) #2 he S:PURPOSE S:TEMPORAL she 0 nominated Sonia Sotomayor to replace David Souter . on May 26 , 2009 . was becoming the first Supreme Court Justice of Hispanic descent Figure 6: Comparison of the output of OLLIE alone and with the framework. 4 Evaluation In order to evaluate the performance of our Open IE reference implementation Graphene, we conduct an automatic evaluation using the Open IE benchmark framework proposed in Stanovsky and Dagan (2016), which is based on a QA-Semantic Role Labeling (SRL) corpus with more than 10,000 extractions over 3,200 sentences from Wikipedia and the Wall Street Journal3. This benchmark allows us to compare our system with a variety of current Open IE approaches in recall and precision. Moreover, we investi- gate whether our two-layered transformation process of clausal and phrasal disembedding improves the performance of state-of-the-art Open IE systems when applied as a preprocessing step. 3available under https://github.com/gabrielStanovsky/oie-benchmark 4.1 Experimental Setup To conduct an automatic comparative evaluation, we integrate Graphene into Stanovsky and Dagan (2016)'s Open IE benchmark framework, which was created from a QA-SRL dataset where every verbal predicate was considered as constituting an own extraction. Since Graphene's structured output is not designed to yield extractions for every occurrence of a verbal predicate, we use an alternative relation extraction implementation which is able to produce more than one extraction from a simplified core sentence. To match extractions to reference propositions from the gold standard, we use the method de- scribed in Stanovsky and Dagan (2016), following He et al. (2015) by matching an extraction with a gold proposition if both agree on the grammatical head of both the relational phrase and its arguments. Since n-ary relational tuples with possibly more than two arguments have to be compared, we assign a positive match if the relational phrase and at least two of their arguments match. Since the gold standard is com- posed of n-ary relations, we add all contexts (S) of an extraction as additional arguments besides arg1 and arg2. We assess the performance of our system together with the state-of-the-art systems ClausIE, OLLIE, OpenIE-4 (Mausam, 2016), PropS (Stanovsky et al., 2016), REVERB and Stanford Open IE. After evaluating Graphene as a reference implementation of the proposed approach, we investigate how clausal and phrasal disembedding applied as a preprocessing step affects the performance of other Open IE systems. Therefore, we compare the performance of ClausIE, OLLIE, OpenIE-4, REVERB and Stanford Open IE on the raw input data with their performance when operating inside of our framework where they act as different relation extraction implementations that take the simplified sentences of the transformation stage as an input. 4.2 Results and Discussion Figure 7 shows the precision-recall curve for each system within the Open IE benchmark evaluation framework. In our experiments, with a score of 50.1% in average precision, our reference implementa- tion Graphene achieves the best performance of all the systems in extracting accurate relational tuples, followed by OpenIE-4 (44.6%) and PropS (42.4%). Considering recall, Graphene (27.2%) is able to compete with other high-precision systems, such as PropS (26.7%). However, it does not reach the recall rate of ClausIE (33.0%) or OpenIE-4 (32.5%). This lack in recall was expected, since Graphene was not designed to create fine-grained relations for every possible verb, as opposed to the gold standard, but rather determines the main relations with attached (contextual) arguments that often contain some of these verbal expressions. In an in-depth analysis of the output, we proved that only 33.72% of un- matched gold extractions were caused by a wrong argument assignment of Graphene. In the majority of cases (66.28%), Graphene did not extract propositions with a matching relational phrase. We further calculated that in 56.80% of such cases, the relational phrase of a missed gold standard extraction was actually contained inside an argument, e.g.: "Japan may be a tough market for outsiders to penetrate, and the U.S. is hopelessly behind Japan in certain technologies." • Unmatched Gold-Extraction: (cid:104)outsiders; may penetrate; Japan(cid:105) • Graphene-Extractions: 1. (cid:104)Japan; may be; a tough market for outsiders to penetrate(cid:105) 2. (cid:104)the U.S.; is hopelessly behind Japan; in certain technologies(cid:105) This number even grows to 67.89% when considering the lemmatized form of the head: "The seeds of "Raphanus sativus" can be pressed to extract radish seed oil." • Unmatched Gold-Extraction: (cid:104)radish seed oil; can be extracted; from The seeds(cid:105) • Graphene-Extractions: 1. (cid:104)the seeds of "Raphanus sativus"; can be pressed; to extract radish seed oil(cid:105) Figure 7: Performance of Graphene. Figure 8: Improvements of state-of-the-art systems when operating as RE component of our framework. Another 5.22% of unmatched relational phrases would have been recognized by Graphene if they were compared based on their lemmatized head. Regarding the overall Area Under the Curve (AUC) score, OpenIE-4 is the best performing system with a score of 14.5%, closely followed by Graphene (13.6%), PropS (11.3%) and ClausIE (9.3%). The precision-recall curve in Figure 8 shows that when using clausal and phrasal disembedding pro- vided by our framework, all tested systems except for OpenIE-4 (-18%) gain in AUC. The highest im- provement in AUC was achieved by Stanford Open IE, yielding a 63% AUC increase over the output of Stanford Open IE as a standalone system. AUC scores of OLLIE and REVERB improve by 34% and 22%. While OLLIE and REVERB primarily profit from a boost in recall (+4%, +26%), ClausIE mainly enhances precision (+16%). Furthermore, the performance of our reference relation extraction imple- mentation increases both in precision (+10%) and recall (+8%) when applied as the relation extraction component inside of our system Graphene (+19% AUC). 5 Conclusion In this paper, we introduce a novel Open IE approach that presents an innovative two-layered hierarchical representation of syntactically simplified sentences in the form of core facts and accompanying contexts that are semantically linked by rhetorical relations. In that way, the semantic connection of the individual components is preserved, thus allowing to fully reconstruct the informational content of the input. The results of a comparative analysis conducted on a large-scale benchmark framework showed that with a score of 50.1%, our baseline system Graphene achieves the best average precision, while also providing a recall rate of 27.2% that is comparable to that of other high-precision systems. Moreover, we demonstrated that by using clausal and phrasal disembedding as a preprocessing step, the AUC score of state-of-the-art Open IE systems can be improved by up to 63%. In summary, we were able to show that by generating a two-layered representation of core and contextual information, the relations extracted by state-of-the-art Open IE systems can be semantically enriched without losing in precision or recall. Moreover, by using clausal and phrasal disembedding techniques, contextual information is detached from the core propositions and transformed into additional arguments, thus avoiding the problem of overspecified argument phrases and yielding a more compact structure. By enhancing the resulting syn- tactically sound sentence representation with rhetorical relations, semantically typed and interconnected relational tuples are created that may benefit downstream artificial intelligence tasks. In future work, we plan to evaluate the classification of the rhetorical relations, examine to what extent other NL Processing tasks such as QA systems may benefit from the results produced by our framework and investigate the creation of big knowledge graphs for QA by performing a large-scale Wikipedia extraction. References [Akbik and Loser2012] Alan Akbik and Alexander Loser, 2012. Proceedings of the Joint Workshop on Automatic Knowledge Base Construction and Web-scale Knowledge Extraction (AKBC-WEKEX), chapter KrakeN: N-ary Facts in Open Information Extraction, pages 52 -- 56. Association for Computational Linguistics. [Angeli et al.2015] Gabor Angeli, Melvin Jose Johnson Premkumar, and Christopher D. Manning. 2015. Leverag- ing linguistic structure for open domain information extraction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 344 -- 354, Beijing, China, July. Association for Computational Lin- guistics. [Banko et al.2007] Michele Banko, Michael J. Cafarella, Stephen Soderland, Matt Broadhead, and Oren Etzioni. 2007. Open information extraction from the web. In Proceedings of the 20th International Joint Conference on Artifical Intelligence, pages 2670 -- 2676, San Francisco, CA, USA. Morgan Kaufmann Publishers Inc. [Del Corro and Gemulla2013] Luciano Del Corro and Rainer Gemulla. 2013. Clausie: Clause-based open infor- mation extraction. In Proceedings of the 22Nd International Conference on World Wide Web, pages 355 -- 366, New York, NY, USA. ACM. [Fader et al.2011] Anthony Fader, Stephen Soderland, and Oren Etzioni. 2011. information extraction. Processing, pages 1535 -- 1545, Edinburgh, Scotland, UK., July. Association for Computational Linguistics. Identifying relations for open In Proceedings of the 2011 Conference on Empirical Methods in Natural Language [He et al.2015] Luheng He, Mike Lewis, and Luke Zettlemoyer. 2015. Question-answer driven semantic role In Proceedings of the 2015 conference on labeling: Using natural language to annotate natural language. empirical methods in natural language processing, pages 643 -- 653. [Jurafsky and Martin2009] Daniel Jurafsky and James H. Martin. 2009. Speech and Language Processing (2Nd Edition). Prentice-Hall, Inc., Upper Saddle River, NJ, USA. [Knott and Dale1994] Alistair Knott and Robert Dale. 1994. Using linguistic phenomena to motivate a set of coherence relations. Discourse processes, 18(1):35 -- 62. [Levy and Andrew2006] Roger Levy and Galen Andrew. 2006. Tregex and tsurgeon: tools for querying and manipulating tree data structures. In Proceedings of the fifth international conference on Language Resources and Evaluation, pages 2231 -- 2234. [Mann and Thompson1988] William C Mann and Sandra A Thompson. 1988. Rhetorical structure theory: Toward a functional theory of text organization. Text-Interdisciplinary Journal for the Study of Discourse, 8(3):243 -- 281. [Mausam et al.2012] Mausam, Michael Schmitz, Stephen Soderland, Robert Bart, and Oren Etzioni. 2012. Open language learning for information extraction. In Proceedings of the 2012 Joint Conference on Empirical Meth- ods in Natural Language Processing and Computational Natural Language Learning, pages 523 -- 534, Jeju Island, Korea, July. Association for Computational Linguistics. [Mausam2016] Mausam. 2016. Open information extraction systems and downstream applications. In Proceed- ings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI 2016, New York, NY, USA, 9-15 July 2016, pages 4074 -- 4077. [Mesquita et al.2013] Filipe Mesquita, Jordan Schmidek, and Denilson Barbosa. 2013. Effectiveness and effi- ciency of open relation extraction. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 447 -- 457. Association for Computational Linguistics. [Niklaus et al.2016] Christina Niklaus, Bernhard Bermeitinger, Siegfried Handschuh, and Andr´e Freitas. 2016. A sentence simplification system for improving relation extraction. In Prooceedings of COLING 2016: System Demonstrations, The 26th International Conference on Computational Linguistics, Osaka, Japan, December 11-16, 2016, pages 170 -- 174. [Schmidek and Barbosa2014] Jordan Schmidek and Denilson Barbosa. 2014. Improving open relation extraction via sentence re-structuring. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC-2014). European Language Resources Association (ELRA). [Socher et al.2013] Richard Socher, John Bauer, Christopher D. Manning, and Andrew Y. Ng. 2013. Parsing With Compositional Vector Grammars. In ACL. [Stanovsky and Dagan2016] Gabriel Stanovsky and Ido Dagan. 2016. Creating a large benchmark for open in- In Proceedings of the 2016 Conference on Empirical Methods in Natural Language formation extraction. Processing (EMNLP), page (to appear), Austin, Texas, November. Association for Computational Linguistics. [Stanovsky et al.2016] Gabriel Stanovsky, Jessica Ficler, Ido Dagan, and Yoav Goldberg. 2016. Getting more out of syntax with props. CoRR, abs/1603.01648. [Taboada and Das2013] Maite Taboada and Debopam Das. 2013. Annotation upon annotation: Adding signalling information to a corpus of discourse relations. D&D, 4(2):249 -- 281. [Wu and Weld2010] Fei Wu and S. Daniel Weld. 2010. Open information extraction using wikipedia. In Proceed- ings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 118 -- 127. Association for Computational Linguistics.
1704.00849
3
1704
2017-06-08T01:08:38
Voice Conversion from Unaligned Corpora using Variational Autoencoding Wasserstein Generative Adversarial Networks
[ "cs.CL" ]
Building a voice conversion (VC) system from non-parallel speech corpora is challenging but highly valuable in real application scenarios. In most situations, the source and the target speakers do not repeat the same texts or they may even speak different languages. In this case, one possible, although indirect, solution is to build a generative model for speech. Generative models focus on explaining the observations with latent variables instead of learning a pairwise transformation function, thereby bypassing the requirement of speech frame alignment. In this paper, we propose a non-parallel VC framework with a variational autoencoding Wasserstein generative adversarial network (VAW-GAN) that explicitly considers a VC objective when building the speech model. Experimental results corroborate the capability of our framework for building a VC system from unaligned data, and demonstrate improved conversion quality.
cs.CL
cs
Voice Conversion from Unaligned Corpora using Variational Autoencoding Wasserstein Generative Adversarial Networks Chin-Cheng Hsu1, Hsin-Te Hwang1, Yi-Chiao Wu1, Yu Tsao2, and Hsin-Min Wang1 1Institute of Information Science, Academia Sinica, Taiwan 2Research Center for Information Technology Innovation, Academia Sinica, Taiwan {jeremycchsu, hwanght, tedwu, whm}@iis.sinica.edu.tw, [email protected] 7 1 0 2 n u J 8 ] L C . s c [ 3 v 9 4 8 0 0 . 4 0 7 1 : v i X r a Abstract Building a voice conversion (VC) system from non-parallel speech corpora is challenging but highly valuable in real ap- plication scenarios. In most situations, the source and the target speakers do not repeat the same texts or they may even speak different languages. In this case, one possible, although indi- rect, solution is to build a generative model for speech. Gen- erative models focus on explaining the observations with latent variables instead of learning a pairwise transformation function, thereby bypassing the requirement of speech frame alignment. In this paper, we propose a non-parallel VC framework with a variational autoencoding Wasserstein generative adversarial network (VAW-GAN) that explicitly considers a VC objective when building the speech model. Experimental results corrob- orate the capability of our framework for building a VC sys- tem from unaligned data, and demonstrate improved conversion quality. Index Terms: non-parallel voice conversion, Wasserstein gen- erative adversarial network, GAN, variational autoencoder, VAE 1. Introduction The primary goal of voice conversion (VC) is to convert the speech from a source speaker to that of a target, without chang- ing the linguistic or phonetic content. However, consider the case of converting one's voice into that of another who speaks a different language. Traditional VC techniques would have trouble dealing with such cases because most of them require parallel training data in which many pairs of speakers uttered the same texts. In this paper, we are devoted to bridging the gap between parallel and non-parallel VC systems. We pursue a unified generative model for speech that nat- urally accommodates VC (Sec. 2). In this framework, we do not have to align any frames or to cluster phones or frames ex- plicitly. The idea is skeletonized in the probabilistic graphical model (PGM) in Fig. 1. In this model, our attention is directed away from seeking alignment. Rather, what we are concerned about are 1) finding a good inference model (Sec. 2.1) for the la- tent variable z and 2) building a good synthesizer whose outputs match the distribution of the real speech of the target (Sec. 2.2 through 2.3). In this paper, we present a specific implementa- tion in which a variational autoencoder (VAE [1]) assumes the inference task and a Wasserstein generative adversarial network (W-GAN [2]) undertakes speech synthesis. Our contribution is two-fold: • We introduce the W-GAN to non-parallel voice conver- sion and elucidate the reason why it fits this task (Sec. 2). • We demonstrate the ability of W-GAN to synthesize more realistic spectra (Sec. 3). (a) Speech model (b) Voice conversion (c) The conversion phase Figure 1: Graphical models of our voice conversion framework. Red arrows represent inference. During the conversion phase, we first infer the latent variable z and blend it with the target speaker's representation y. 2. Non-parallel voice conversion via deep generative models Given spectral frames Xs = {xs,n}Ns n=1 from the source speaker and those Xt = {xt,n(cid:48)}Nt n(cid:48)=1 from the target, assume that the real data distributions of the source and the target re- spectively admit a density p∗ s and p∗ t . Let f be a voice conver- sion function that induces a conditional distribution pts. The goal of VC is to estimate f so that pts best approximates the real data distribution p∗ t : pts(f (xs,n)) ≈ p ∗ t (xt,n(cid:48) ). (1) We can decompose the VC function f into two stages ac- cording to the PGM in Fig. 1b. In the first stage, a speaker- independent encoder Eφ infers a latent content zn. In the sec- ond stage, a speaker dependent decoder Gθ mixes zn with a speaker-specific variable y to reconstruct the input. The prob- lem of VC is then reformulated as: xt,n(cid:48) ≈ f (xs,n) = Gθ(Eφ(xs,n), y). (2) In short, this model explains the observation x using two latent variables y and z. We will drop the frame indices when- ever readability is unharmed. We refer to y as the speaker rep- resentation vector because it is determined solely by the speaker identity. We refer to z as the phonetic content vector because with a fixed y, we can generate that speaker's voice by varying 𝒚𝑚𝒙𝑛𝒛𝑛NM𝒚𝑠𝒛𝑛𝒚𝑡𝒙𝑡,𝑛𝒙𝑠,𝑛… 𝒚𝒕𝒛𝑛ෝ𝒙𝒕,𝑛… Phonetic contentConverted spectral frameSpeaker representation𝒙𝑠,𝑛… Spectral frame(from source speaker) z. Note that the term phonetic content is only valid in the con- text of our experimental settings where the speech is natural, noise-free, and non-emotional. This encoder-decoder architecture facilitates VC from un- aligned or non-parallel corpora. The function of the encoder is similar to a phone recognizer whereas the decoder operates as a synthesizer. The architecture enables voice conversion for the following reasons. The speaker representation y can be ob- tained from training. The encoder can infer the phonetic content z. The synthesizer can reconstruct any spectral frame x with the corresponding y and z. Combining these elements, we can build a non-parallel VC system via optimizing the encoder, the decoder (synthesizer), and the speaker representation. With the encoder, frame-wise alignment is no longer needed; frames that belong to the same phoneme class now hinge on a similar z. With this conditional synthesizer, VC becomes as simple as re- placing the speaker representation y. (as illustrated in Fig. 1c). We delineate our proposed method incrementally in three subsections: a conditional variational autoencoder (C-VAE) in Sec. 2.1, a generative adversarial nets (GAN) applied to im- prove the over-simplified C-VAE model in Sec. 2.2, and a Wasserstein GAN (W-GAN) that explicitly considers VC in the training objectives in Sec. 2.3. 2.1. Modeling speech with a C-VAE Recent works have proven the viability of speech modeling with VAEs [3, 4]. A C-VAE that realizes the PGM in Fig. 1a maxi- mizes a variational lower bound of the log-likelihood: log pθ(xy) ≤ −Jvae(xy) = −(Jobs(xy) + Jlat(x)), (3) (cid:0)qφ(zx)(cid:107)pθ(z)(cid:1), (cid:2) log pθ(xz, y)(cid:3), Jlat(φ; x) = DKL Jobs(φ, θ; x, y) = −Eqφ(zx) (4) (5) where x ∈ Xs ∪ Xt, DKL is the Kullback-Leibler divergence, pθ(z) is our prior distribution model of z, pθ(xz, y) is our synthesis model, and qφ(zx) is our inference model. Note that the synthesis is conditioned on an extra input y, thus the name conditional VAE. In order to train the C-VAE, we have to simplify the model in several aspects. First, we choose pθ(xz, y) to be a normal distribution whose covariance is an identity matrix. Second, we choose pθ(z) to be a standard normal distribution. Third, the expectation over z is approximated by sampling methods. With these simplifications, we can avoid intractability and focus on modeling the statistics of the Gaussian distributions. For the phonetic content z, we have: qφ(zx) = N (z Eφ1 (x), diag(Eφ2 (x))), (6) where φ1 ∪ φ2 = φ are the parameters of the encoder, and Eφ1 and Eφ2 are the inference models of mean and variance. For the reconstructed or converted spectral frames, we have: pθ(xm,nzn, ym) = N (xm,n Gθ(zn, ym), I). (7) Training this C-VAE means maximizing (3). For every in- put (xn, yn), we can sample the latent variable zn using the re-parameterization trick described in [1]. With zn and yn, the model can reconstruct the input, and by replacing yn, it can convert voice. This means that we are building virtually multi- ple models in one. Conceptually, the speaker switch lies in the speaker representation y because the synthesis is conditioned on y. 2.2. Improving speech models with GANs Despite the effectiveness of C-VAE, the simplification induces inaccuracy in the synthesis model. This defect originates from the fallible assumption that the observed data is normally dis- tributed and uncorrelated across dimensions. This assumption gave us a defective learning objective, leading to muffled con- verted voices. Therefore, we are motivated to resort to models that side-step this defect. We can improve the C-VAE by incorporating a GAN ob- jective [5] into the decoder. A vanilla GAN [6] consists of two components: a generator (synthesizer) Gθ that produces realistic spectrum and a discriminator Dψ that judges whether an input is a true spectrum or a generated one. These two components seek an equilibrium in a min-max game with the Jensen-Shannon di- vergence DJS as the objective, which is defined as follows: t(cid:107)pts ∗ (cid:0)p (cid:3) + Ex∼pts ψ(x)(cid:3) + Ez∼qφ (cid:1) + 2 log 2. (cid:2) log (cid:2) log(cid:0)1 − D∗ p∗ p∗ t + pts (cid:2) log (cid:2) log D∗ (cid:3) ψ(Gθ(z))(cid:1)(cid:3), pts p∗ t + pts Jgan(θ, ψ; x) = 2 DJS = Ex∼p∗ = Ex∼p∗ t t t (8) where D∗ ψ denotes the optimal discriminator, which is the den- sity ratio in the second equality in (8). We can view this as a density ratio estimation problem without explicit specification of distributions. Presumably, GANs produce sharper spectra because they optimize a loss function between two distributions in a more di- rect fashion. We can combine the objectives of VAE and GAN by assigning VAE's decoder as GAN's generator to form a VAE- GAN [5]. However, the VAE-GAN does not consider VC ex- plicitly. Therefore, we propose our final model: variational au- toencoding Wasserstein GAN (VAW-GAN). 2.3. Direct consideration of voice conversion with W-GAN A deficiency in the VAE-GAN formulations is that it treats VC indirectly. We simply assume that when the model is well- trained, it naturally equips itself with the ability to convert voices. In contrast, we can directly optimize a non-parallel VC loss by renovating DJS with a Wasserstein objective [2]. 2.3.1. Wasserstein distance The Wasserstein-1 distance is defined as follows: W (p ∗ t , pts) = inf γ∈Π(p∗ t ,pts) E(x,x)∼γ (cid:2)(cid:107)x − x(cid:107)(cid:3) (9) where Π(p, q) denotes the set of all joint distributions γ(x, x) whose marginals are respectively p∗ t and pts. According to the definition, the Wasserstein distance is calculated from the opti- mal transport, or the best frame alignment. Note that (9) is thus suitable for parallel VC. On the other hand, the Kantorovich-Rubinstein duality [7] of (9) allows us to explicitly approach non-parallel VC: (cid:2)D(x)(cid:3) − Ex∼pts (cid:2)D(x)(cid:3), W (p ∗ t , pts) = sup Ex∼p∗ t (cid:107)D(cid:107)L≤1 (10) where the supremum is over all 1-Lipschitz functions D : X → R. If we have a parameterized family of functions Dψ∈Ψ that are all K-Lipschitz for some K, we could consider solving the problem: max ψ∈Ψ Jwgan, (11) Algorithm 1 VAE-WGAN training function AUTOENCODE(X, y) Zµ ← Eφ1 (X) Zσ ← Eφ2 (X) Z ← sample from N (Zµ, Zσ) X(cid:48) ← Gθ(Z, y) return X(cid:48), Z φ, θ, ψ ← initialization while not converged do Xs ← mini-batch of random samples from source Xt ← mini-batch of random samples from target (cid:48) s, Zs ← AUTOENCODE(Xs, ys) X (cid:48) t , Zt ← AUTOENCODE(Xt, yt) X Xts ← Gθ(Zs, yt) Jobs ← Jobs(Xs) + Jobs(Xt) Jlat ← Jlat(Zs) + Jlat(Zt) Jwgan ← Jwgan(Xt, Xs) // Update the encoder, generator, and discriminator while not converged do update←−−−− − ∇ψ(−Jwgan) ψ update←−−−− − ∇φ(Jobs + Jlat) update←−−−− − ∇θ(Jobs + αJwgan) φ θ where Jwgan is defined as (cid:2)Dψ(x)(cid:3) − Ez∼qφ(zx) (cid:2)Dψ(Gθ(z), yt)(cid:3) (12) Ex∼p∗ t Alignment is not required in this formulation because of the respective expectations. What we need now is a batch of real frames from the target speaker, another batch of synthetic frames converted from the source into the target speaker, and a good discriminator Dψ. 2.3.2. VAW-GAN Incorporating the W-GAN loss (12) with (3) yields our final objective: Jvawgan = − DKL (cid:0)qφ(znxn)(cid:107)p(zn)(cid:1) (cid:2) log pθ(xz, y)(cid:3) (cid:2)Dψ(x)(cid:3) (cid:2)Dψ(Gθ(z, yt))(cid:3) + Ez∼qφ(zx) + α Ex∼p∗ − α Ez∼qφ(zx) t (13) where α is a coefficient which emphasizes the W-GAN loss. This objective is shared across all three components: the en- coder, the synthesizer, and the discriminator. The synthesizer minimizes this loss whereas the discriminator maximizes it; consequently the two components have to be optimized in alter- nating order. For clarity, we summarize the training procedures in Alg. 1. Note that we actually use an update schedule for Dψ instead of training it to real optimality. 3. Experiments 3.1. The dataset The proposed VC system was evaluated on the Voice Conver- sion Challenge 2016 dataset [8]. The dataset was a parallel speech corpus; however, frame alignment was not performed in the following experiments. We conducted experiments on a subset of 3 speakers. In the inter-gender experiment, we chose SF1 as the source and TM3 as the target. In the intra-gender experiment, we chose TF2 as the target. We used the first 150 utterances (around 10 minutes) per speaker for training, the succeeding 12 for validation, and 25 (out of 54) utterances in the official testing set for subjective evaluations. 3.2. The feature set We used the STRAIGHT toolkit [9] to extract speech parame- ters, including the STRAIGHT spectra (SP for short), aperiod- icity (AP), and pitch contours (F0). The rest of the experimen- tal settings were the same as in [3], except that we rescaled log energy-normalized SP (denoted by logSP en) to the range of [−1, 1] dimension-wise. Note that our system performed frame- by-frame conversion without post-filtering and that we utilized neither contextual nor dynamic features in our experiments. 3.3. Configurations and hyper-parameters The baseline system was the C-VAE system (denoted simply as VAE) [3] because its performance had been proven to be on par with another simple parallel baseline. In our proposed sys- tem, the encoder, the synthesizer, and the discriminator were convolutional neural networks. The phonetic space was 64- dimensional and assumed to have a standard normal distribu- tion. The speaker representation were one-hot coded, and their embeddings were optimized as part of the generator parame- ters1. 3.4. The training and conversion procedures We first set α to 0 to exclude W-GAN, and trained the VAE till convergence to get the baseline model. Then, we proceeded on training the whole VAW-GAN via setting α to 50. Conversion was conducted on a frame-by-frame basis as shown in Fig. 1c. First, Eφ inferred the phonetic content zn from xs,n Then, we specified a speaker identity (integer, the subscript t in yt) that retrieved the speaker representation vec- tor y. The synthesizer Gθ then generated a conditional output frame x using zn and yt. 3.5. Subjective evaluations Five-point mean opinion score (MOS) tests were conducted in a pairwise manner. Each of the 10 listeners graded the pairs of outputs from the VAW-GAN and the VAE. Inter-gender and intra-gender VC were evaluated respectively. The MOS results on naturalness shown in Fig. 2 demon- strate that VAW-GAN significantly outperforms the VAE base- line (p-value (cid:28) 0.01 in paired t-tests). The results are in ac- cordance with the converted spectra shown in Fig. 3, where the output spectra from VAW-GAN express richer variability across the frequency axis, hence reflecting clearer voices and enhanced intelligibility. We did not report objective evaluations such as mean mel- cepstral coefficients because we found inconsistent results with the subjective evaluations. However, similar inconsistency is common in the VC literature because it is highly likely that those evaluations are inconsistent with human auditory systems [10, 11, 12]. The performance of speaker similarity was also 1 Due to space limitations, the specification of hyper-parameters and audio samples can be found on-line: https://github.com/JeremyCCHsu/vc-vawgan the rest of Figure 2: MOS on naturalness. The source is SF1, and the targets are TF2 and TM3. Figure 3: Selected frames of the STRAGIHT spectra converted from SF1 to TM3. The spectral envelopes from the VAW-GAN outputs are less smooth across the frequency axis. unreported because we found that it remained about the same as that of [13] (System B in [14]). 4. Discussions 4.1. W-GAN improved spectrum modeling As we can see in Fig. 3, the spectral envelopes of the syn- thetic speech from VAW-GAN are more structured, with more observable peaks and troughs. Spectral structures are key to the speech intelligibility, indirectly contributing to the elevated MOS. In addition, the more detailed spectral shapes in the high- frequency region reflect clearer (non-muffled) voice of the syn- thetic speech. 4.2. W-GAN as a variance modeling alternative The Wasserstein objective in (13) is minimized when the distri- bution of the converted spectrum pts is closest to the true data distribution p∗ t . Unlike VAE that assumes a Gaussian distribu- tion on the observation, W-GAN models the observation implic- itly through a series of stochastic procedures, without prescrib- ing any density forms. In Fig. 4, we can observe that the output spectra of the VAW-GAN system have larger variance compared to those of the VAE system. The global variance (GV) of the VAW-GAN output may not be as good as that of the data but the higher values indicate that VAW-GAN does not centralize predicted values at the mean too severely. Since speech has a highly diverse distribution, it requires more sophisticated anal- ysis on this phenomenon. Figure 4: The GV computed from the logSP en over all non- silent frames from speaker TM3. 4.3. Imperfect speaker modeling in VAW-GAN The reason that the speaker similarity of the converted voice is not improved reminds us of the fact that both VAE and VAW- GAN optimize the same PGM, thus the same speaker model. Therefore, modeling speaker with one global variable might be insufficient. As modeling speaker with a frame-wise variable may conflict with the phonetic vector z, we may have to resort to other PGMs. We will investigate this problem in the future. 5. Related work To handle non-parallel VC, many researchers resort to frame- based, segment-based, or cluster-based alignment schemes. One of the most intuitive ways is to apply an automatic speech recognition (ASR) module to the utterances, and proceed with explicit alignment or model adaptation [15, 16]. The ASR mod- ule provides every frame with a phonetic label (usually the phonemic states). It is particularly suitable for text-to-speech (TTS) systems because they can readily utilize these labeled frames [17]. A shortcoming with these approaches is that they require an extra mapping to realize cross-lingual VC. To this end, the INCA-based algorithms [18, 19] were proposed to iter- atively seek frame-wise correspondence using converted surro- gate frames. Another attempt is to separately build frame clus- ters for the source and the target, and then set up a mapping between them [20]. Recent advances include [21], in which the authors ex- ploited i-vectors to represent speakers. Their work differed from ours in that they adopted explicit alignment during train- ing. In [22], the authors represented the phonetic space with senone probabilities outputted from an ASR module, and then generated voice by means of a TTS module. Despite differences in realization, our models do share some similarity ideally. 6. Conclusions We have presented a voice conversion framework that is able to directly incorporate a non-parallel VC criterion into the objec- tive function. The proposed VAW-GAN framework improves the outputs with more realistic spectral shapes. Experimen- tal results demonstrate significantly improved performance over the baseline system. 7. Acknowledgements This work was supported in part by the Ministry of Science and Technology of Taiwan under Grant: MOST 105-2221-E-001- 012-MY3. 3.0082.292Intra-genderMean Opinion ScoreVAEVAW-GAN3.2122.08812345Inter-gender50100150200250300350400450500234VAEVAW-GAN50100150200250300350400450500234VAEVAW-GAN501001502002503003504004505000123VAEVAW-GAN5010015020025030035040045050000.511.5STRAIGHT Frequency IndexGlobal variance realVAEVAW−GAN [15] M. Dong, C. Yang, Y. Lu, J. W. Ehnes, D. Huang, H. Ming, R. Tong, S. W. Lee, and H. Li, "Mapping frames with DNN-HMM recognizer for non-parallel voice conversion," in Asia-Pacific Signal and Information Processing Association Annual Summit and Conference, APSIPA 2015, Hong Kong, December 16-19, 2015. IEEE, 2015, pp. 488–494. [Online]. Available: http://dx.doi.org/10.1109/APSIPA.2015.7415320 [16] M. Zhang, J. Tao, J. Tian, and X. Wang, "Text-independent voice conversion based on state mapped codebook," in Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing, ICASSP 2008, March 30 - April 4, 2008, Caesars Palace, Las Vegas, Nevada, USA. IEEE, 2008, pp. 4605–4608. [Online]. Available: http://dx.doi.org/10.1109/ ICASSP.2008.4518682 [17] P. Song, W. Zheng, and L. Zhao, "Non-parallel training for voice conversion based on adaptation method," in IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP 2013, Vancouver, BC, Canada, May 26- 31, 2013. IEEE, 2013, pp. 6905–6909. [Online]. Available: http://dx.doi.org/10.1109/ICASSP.2013.6639000 [18] D. Erro, A. Moreno, and A. Bonafonte, "INCA algorithm for training voice conversion systems from nonparallel corpora," IEEE Trans. Audio, Speech & Language Processing, vol. 18, no. 5, pp. 944–953, 2010. [Online]. Available: http://dx.doi.org/ 10.1109/TASL.2009.2038669 [19] Y. Agiomyrgiannakis, "The matching-minimization algorithm, framework for the INCA algorithm and a mathematical voice conversion with unaligned corpora," in 2016 IEEE International Conference on Acoustics, Speech and Signal ICASSP 2016, Shanghai, China, March 20-25, Processing, 2016. [Online]. Available: http://dx.doi.org/10.1109/ICASSP.2016.7472758 IEEE, 2016, pp. 5645–5649. [20] H. Ney, D. Sundermann, A. Bonafonte, and H. Hoge, "A first step towards text-independent voice conversion," in INTERSPEECH 2004 - ICSLP, 8th International Conference on Spoken Language Processing, Jeju Island, Korea, October 4-8, 2004. ISCA, 2004. [21] J. Wu, Z. Wu, and L. Xie, "On the use of i-vectors and average voice model for voice conversion without parallel data," in Asia-Pacific Signal and Information Processing Association Annual Summit and Conference, APSIPA 2016, Jeju, South Korea, December 13-16, 2016. IEEE, 2016, pp. 1–6. [Online]. Available: http://dx.doi.org/10.1109/APSIPA.2016.7820901 [22] F. Xie, F. K. Soong, and H. Li, "A KL divergence and dnn-based approach to voice conversion without parallel training sentences," in Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, N. Morgan, Ed. http: //dx.doi.org/10.21437/Interspeech.2016-116 ISCA, 2016, pp. 287–291. [Online]. Available: [23] Asia-Pacific Signal and Information Processing Associa- tion Annual Summit and Conference, APSIPA 2016, Jeju, South Korea, December 13-16, 2016. [On- line]. Available: http://ieeexplore.ieee.org/xpl/mostRecentIssue. jsp?punumber=7803478 IEEE, 2016. [24] N. Morgan, Ed., Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016. ISCA, 2016. [Online]. Available: http://dx.doi.org/10.21437/Interspeech.2016 8. References [1] D. P. Kingma and M. Welling, "Auto-encoding variational bayes," CoRR, vol. abs/1312.6114, 2013. [Online]. Available: http://arxiv.org/abs/1312.6114 [2] M. Arjovsky, S. Chintala, "Wasserstein GAN," CoRR, vol. abs/1701.07875, 2017. [Online]. Available: http://arxiv.org/abs/1701.07875 and L. Bottou, [3] C. Hsu, H. Hwang, Y. Wu, Y. Tsao, and H. Wang, "Voice conversion from non-parallel corpora using variational auto- encoder," in Asia-Pacific Signal and Information Processing Association Annual Summit and Conference, APSIPA 2016, Jeju, South Korea, December 13-16, 2016. IEEE, 2016, pp. 1– 6. [Online]. Available: http://dx.doi.org/10.1109/APSIPA.2016. 7820786 [4] M. Blaauw and J. Bonada, "Modeling and transforming speech using variational autoencoders," in Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, N. Morgan, Ed. [Online]. Available: http://dx.doi.org/10.21437/Interspeech.2016-1183 ISCA, 2016, pp. 1770–1774. [5] A. B. L. Larsen, S. K. Sønderby, H. Larochelle, and O. Winther, "Autoencoding beyond pixels using a learned the 33nd International similarity metric," in Proceedings of Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, ser. JMLR Workshop and Conference Proceedings, M. Balcan and K. Q. Weinberger, Eds., vol. 48. JMLR.org, 2016, pp. 1558–1566. [Online]. Available: http://jmlr.org/proceedings/papers/v48/larsen16.html [6] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde- Farley, S. Ozair, A. C. Courville, and Y. Bengio, "Generative adversarial networks," CoRR, vol. abs/1406.2661, 2014. [Online]. Available: http://arxiv.org/abs/1406.2661 [7] C. Villani, Optimal Transport: Old and New, ser. Grundlehren der mathematischen Wissenschaften. Berlin: Springer, 2009. [8] T. Toda, L. Chen, D. Saito, F. Villavicencio, M. Wester, Z. Wu, and J. Yamagishi, "The voice conversion challenge in Interspeech 2016, 17th Annual Conference of 2016," the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, N. Morgan, Ed. ISCA, 2016, pp. 1632–1636. [Online]. Available: http: //dx.doi.org/10.21437/Interspeech.2016-1066 [9] H. Kawahara, I. Masuda-Katsuse, and A. de Cheveign´e, "Re- structuring speech representations using a pitch-adaptive timefre- quency smoothing and an instantaneous-frequency-based F0 ex- traction: Possible role of a repetitive structure in sounds," Speech Commun., no. 3-4, pp. 187–207, 1999. [10] T. Toda, A. W. Black, and K. Tokuda, "Voice conversion based on maximum-likelihood estimation of spectral parameter trajectory," IEEE Transactions on Audio, Speech, and Language Processing, 2007. [11] L.-H. Chen, Z.-H. Ling, L.-J. Liu, and L.-R. Dai, "Voice conver- sion using deep neural networks with layer-wise generative train- ing," IEEE/ACM Transactions on Audio, Speech and Language Processing, vol. 22, pp. 1506–1521, 2014. [12] H.-T. Hwang, Y. Tsao, H.-M. Wang, Y.-R. Wang, and S.-H. Chen, "A probabilistic interpretation for artificial neural network-based voice conversion," Proc. APSIPA, 2015. [13] Y.-C. Wu, H.-T. Hwang, C.-C. Hsu, Y. Tsao, and H.-M. Wang, "Locally linear embedding for exemplar-based spectral conver- sion," Proc. INTERSPEECH, in press. [14] M. Wester, Z. Wu, and J. Yamagishi, "Analysis of the voice conversion challenge 2016 evaluation results," in Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, N. Morgan, Ed. ISCA, 2016, pp. 1637– 1641. [Online]. Available: https://doi.org/10.21437/Interspeech. 2016-1331
1106.5973
1
1106
2011-06-27T20:13:07
Entropy of Telugu
[ "cs.CL" ]
This paper presents an investigation of the entropy of the Telugu script. Since this script is syllabic, and not alphabetic, the computation of entropy is somewhat complicated.
cs.CL
cs
Entropy of Telugu Venkata Ravinder Paruchuri Computer Science Oklahoma State University, Stillwater, OK-74078 [email protected] Abstract: This paper presents an investigation of the entropy of the Telugu script. Since this script is syllabic, and not alphabetic, the computation of entropy is somewhat complicated. Introduction Indian languages are highly phonetic; i.e. the pronunciation of new words can be reliably predicted from their written form. A background to Indian scripts is given in [1] -[6]. Indian scripts are highly systematic in their arrangement of sounds, and the milieu in which they arose is provided in papers on early Indian science [7]-[11]. From the evidence available at this time it may be assumed that the 3rd millennium BC Indus script evolved into the Brahmi script of late centuries BC which, in turn, evolved into the different Indian modern Scripts. Structurally, all the Indian scripts are thus closely related although their forms may look quite different. The Brahmi script is also the parent to Southeast Asian scripts. The alphabets of Indian languages are classified into consonants, vowels and other symbols. An akshara or syllable consists of 0, 1, 2 or 3 consonants and a vowel or other symbol. Each akshara can be pronounced independently. Alphabets of all the Indian languages are derived from the Brahmi script. In all the Indian languages there are 33 common consonants and 15 common vowels. In addition, there are 3-4 consonants and 2- 3 vowels that are specific to each language, but not very significant in practice. Words are made up of one or more aksharas. If an akshara consists of more than one consonant, they are called samyuktakshara. The similarity in alphabet is not extended in graphical form which is used for printing. Each language uses different scripts, which consists of different graphemes. There are about 10-12 major scripts in India among which Devanagari is the most widely used. Different languages have different statistical characteristics. Some have an over line for the entire word, while some have not touching graphemes. The vowels and the supporting consonants in samyuktakshara can appear on the left, right, above, below or in combinations to the main consonant. Examples: Entropy Over line Non Touching जम्म ू-कश्मीर పద్మవిభూషణ్ Entropy of the language is the measure of disorder associated with the system. For a random variable X with n outcomes , the Shannon entropy, a measure of uncertainty and denoted by H(X), is defined as Entropy of the English language is calculated by taking into consideration, the 26 alphabets and space character and leaving out the punctuation. Entropy of Telugu language is computed by converting the Telugu language into English language using some software’s and then using the above mentioned formula to compute it. The entropy in Telugu language is computed in two ways.  By converting it to English and then considering them as English letters  By converting it to English and then considering them as Telugu letters. To understand the conversion of Telugu into English font, here are some of the examples: కార్ాాలయ౦ ప్ రతిపాది౦చినట్లు ప్ద్మవిభూషణ్ వయస్సు సాధ్ామ ైన౦త kAryAlayaM pratipAdiMcinaTlu padmavibhUShaN^ vayassu sAdhyamainaMta In the first method, after converting them into English font, they are considered as English alphabets, i.e. padmavibhUShaN^ is considered as a sequence of characters containing p, a, d, m, a, v, i, b, h, U, S, h, a, N, ^. In the Telugu language, the alphabets are case sensitive as each has different meaning. The frequencies of each letter are shown in the table 1. Table 1: Frequencies of alphabets in Telugu language Alphabets Frequencies (%) Alphabets Frequencies (%) A B C D E F G H I J K L M N O P Q R S T U 13.15 0.99 1.98 2.47 1.30 0.04 1.52 3.31 6.81 0.78 3.92 3.57 2.01 4.66 0.49 2.68 0.00 3.31 2.46 2.97 5.65 A B C D E F G H I J K L M N O P Q R S T U 6.13 0.00 0.00 1.35 1.77 0.00 0.00 0.00 1.03 0.04 0.00 0.69 3.67 0.25 1.46 0.04 0.01 0.06 0.29 1.41 0.07 V W X Y Z 2.43 0.00 0.00 1.86 0.00 Space 12.05 V W X Y Z ^ 0.01 0.00 0.00 0.00 0.00 0.46 The above results are calculated based on 10,000 characters and the frequencies are rounded off to 2 decimal points. In the next method, after converting them to English font, they are considered as Telugu syllables as opposed to English alphabets in method one. In this approach, the words are partitioned on the basis of Telugu syllables. Some examples are shown below. padmavibhUShaN^ kAryAlayaM sAdhyamainaMta pa, dma, vi, bhU, Sha , N^ kA, ryA, la, yaM sA, dhya, mai, naM, ta The frequencies of each syllable according to the given text are computed and then the entropy of the language is calculated. In this case we are considering one syllable at a time and the entropy of the language calculated is approximately 5.98 for the 10,000 characters that I have considered. We have continued this method for finding the entropy of Telugu language by considering two syllables at a time to decrease the entropy of the language. In this approach, the words are partitioned on the basis of Telugu syllables. Some examples are shown below. padmavibhUShaN^ kAryAlayaM sAdhyamainaMta padma, dmavi, vibhU, bhUSha, ShaN^ kAryA, ryAla, layaM sAdhya, dhyamai, mainaM, naMta In this case the entropy of the language is calculated to be 3.98 approximately for the same 10,000 characters. In the next step, we found the entropy of Telugu language by considering three syllables at a time. In this approach, the words are partitioned on the basis of Telugu syllables. Some examples are shown below. padmavibhUShaN^ kAryAlayaM sAdhyamainaMta padmavi, dmavibhU, vibhUSha, bhUShaN^ kAryAla, ryAlayaM sAdhyamai, dhyamainaM, mainaMta In this case the entropy of the language is calculated to be 2.739 approximately for the same 10,000 characters. In the next step, we found the entropy of Telugu language by considering four syllables at a time. In this approach, the words are partitioned on the basis of Telugu syllables. Some examples are shown below. padmavibhUShaN^ kAryAlayaM sAdhyamainaMta padmavibhU, dmavibhUSha, vibhUShaN^ kAryAlayaM sAdhyamainaM, dhyamainaMta In this case the entropy of the language is calculated to be 2.077 approximately for the same 10,000 characters. We continued this process for up to six syllables and the entropy of the language when 5 syllables and 6 syllables are considered is calculated. The entropy of language for 5 syllables is 1.699. The entropy of language for 6 syllables is 1.39. All the results are represented diagrammatically using graphs in the results section. Results This graph compares the entropies of English and Telugu language. Entropy of the English language is calculated by taking into consideration, the 26 letters and space character and leaving out the punctuation. The entropy in Telugu language is computed in two ways.  By converting it to English and then considering them as English alphabets (Telugu 1).  By converting it to English and then considering them as Telugu alphabets (Telugu 2). Graph 1: Comparison of entropies calculated. The next section is about Telugu 2 where the alphabets are considered as in Telugu language. We have considered one syllable at a time, two syllables at a time etc till we have reached a value which doesn’t change much. Entropy decreases as the number of syllables considered increases. Graph 2: Entropy of language when considered according to syllables. The next graph shows the comparison of entropies of English language for the original text and the jumbled text [12] with first and last letters kept constant. This graph shows that there is much less difference in the entropies of original text and the jumbled one and hence people are able to read the jumbled text with not much difficulty. Graph 3: Entropies of English language for original text and jumbled text. Graph 4: Entropies of English language for original text and jumbled text. The above graph shows the comparison of entropies of Telugu language for the original text and the jumbled text with first and last letters kept constant. This graph shows that there is much less difference in the entropies of original text and the jumbled one and hence people are able to read the jumbled text with not much difficulty. The difference is very little in Telugu language compared to that of English is because of the word length in Telugu language. In jumbling process we only consider the words of length greater than three, but the graph shows that approximately 70% of the words in Telugu are of length less than four. Graph 22: Percentage of words based on word length Conclusions For Indian languages like Hindi and Telugu, which are phonetic so that the pronunciation of new words can be reliably predicted from their written form, consonants carry more information than the vowels. This can be inferred from both the time taken to read the text and also from the percentage of correctness. The words can be read with much ease if the first and last letters are left in their places. The entropy of Telugu is higher than that of English, which means that Telugu is more succinct than English and each syllable in Telugu (as in other Indian languages) contains more information compared to English. The comparison of entropies of the language for original and jumbled texts confirms that the users can read jumbled text with not much difficulty. REFERENCES 1. A.K. Singh, Development of Nagari Script. Parimal Publications, Delhi. 2. S. Kak, A frequency analysis of the Indus script. Cryptologia, vol. 12, pp. 129-143, 1988. 3. S. Kak, Indus and Brahmi – further connections. Cryptologia, vol. 14, pp. 169-183, 1989. 4. S. Kak, The evolution of early writing in India. Indian Journal of History Of Science”, vol. 28, pp. 375-388, 1994. 5. P.G. Patel, P. Pandey and D. Rajgor (eds.), The Indic scripts. D.K. Printworld, New Delhi, 2007. 6. S. Kak, Knowledge of planets in the third millennium BC, Quarterly Journal of the Royal Astronomical Society, vol. 37, pp. 709-715, 1996. 7. S. Kak, The astronomy of the age of geometric altars, Quarterly Journal of the Royal Astronomical Society, vol. 36, pp. 385-396, 1995. 8. S. Kak, The Paninian approach to natural language processing, International Journal of Approximate Reasoning, vol. 1, pp. 117-130, 1987. 9. S. Kak, Astronomy of the Vedic altars. Vistas in astronomy, vol. 36, pp. 117-140, 1993. 10. S. Kak, The structure of the Rig Veda. Indian Journal of History of Science, vol. 28, pp. 71-79, 1993. 11. S. Kak, The nature of physical reality, Peter Lang, New York, 1986. 12. V.R. Paruchuri, Information retrieval of jumbled words. arXiv:1101.0766
1805.00254
1
1805
2018-05-01T09:39:19
Joint Bootstrapping Machines for High Confidence Relation Extraction
[ "cs.CL", "cs.AI", "cs.IR", "cs.LG", "cs.NE" ]
Semi-supervised bootstrapping techniques for relationship extraction from text iteratively expand a set of initial seed instances. Due to the lack of labeled data, a key challenge in bootstrapping is semantic drift: if a false positive instance is added during an iteration, then all following iterations are contaminated. We introduce BREX, a new bootstrapping method that protects against such contamination by highly effective confidence assessment. This is achieved by using entity and template seeds jointly (as opposed to just one as in previous work), by expanding entities and templates in parallel and in a mutually constraining fashion in each iteration and by introducing higherquality similarity measures for templates. Experimental results show that BREX achieves an F1 that is 0.13 (0.87 vs. 0.74) better than the state of the art for four relationships.
cs.CL
cs
Joint Bootstrapping Machines for High Confidence Relation Extraction Pankaj Gupta1,2, Benjamin Roth2, Hinrich Schutze2 1Corporate Technology, Machine-Intelligence (MIC-DE), Siemens AG Munich, Germany 2CIS, University of Munich (LMU) Munich, Germany 8 1 0 2 y a M 1 ] L C . s c [ 1 v 4 5 2 0 0 . 5 0 8 1 : v i X r a [email protected] [email protected] {beroth, inquiries}@cis.lmu.de Abstract Semi-supervised bootstrapping techniques for relationship extraction from text iteratively ex- pand a set of initial seed instances. Due to the lack of labeled data, a key challenge in boot- strapping is semantic drift: if a false positive instance is added during an iteration, then all following iterations are contaminated. We in- troduce BREX, a new bootstrapping method that protects against such contamination by highly effective confidence assessment. This is achieved by using entity and template seeds jointly (as opposed to just one as in previous work), by expanding entities and templates in parallel and in a mutually constraining fash- ion in each iteration and by introducing higher- quality similarity measures for templates. Ex- perimental results show that BREX achieves an F1 that is 0.13 (0.87 vs. 0.74) better than the state of the art for four relationships. Introduction 1 Traditional semi-supervised bootstrapping rela- tion extractors (REs) such as BREDS (Batista et al., 2015), SnowBall (Agichtein and Gravano, 2000) and DIPRE (Brin, 1998) require an initial set of seed entity pairs for the target binary rela- tion. They find occurrences of positive seed en- tity pairs in the corpus, which are converted into extraction patterns, i.e., extractors, where we de- fine an extractor as a cluster of instances generated from the corpus. The initial seed entity pair set is expanded with the relationship entity pairs newly extracted by the extractors from the text iteratively. The augmented set is then used to extract new re- lationships until a stopping criterion is met. Due to lack of sufficient labeled data, rule- based systems dominate commercial use (Chiti- cariu et al., 2013). Rules are typically defined by creating patterns around the entities (entity ex- traction) or entity pairs (relation extraction). Re- cently, supervised machine learning, especially deep learning techniques (Gupta et al., 2015; Nguyen and Grishman, 2015; Vu et al., 2016a,b; Gupta et al., 2016), have shown promising results in entity and relation extraction; however, they need sufficient hand-labeled data to train models, which can be costly and time consuming for web- scale extractions. Bootstrapping machine-learned rules can make extractions easier on large corpora. Thus, open information extraction systems (Carl- son et al., 2010; Fader et al., 2011; Mausam et al., 2012; Mesquita et al., 2013; Angeli et al., 2015) have recently been popular for domain specific or independent pattern learning. Hearst (1992) used hand written rules to gen- erate more rules to extract hypernym-hyponym pairs, without distributional similarity. For en- tity extraction, Riloff (1996) used seed entities to generate extractors with heuristic rules and scored them by counting positive extractions. Prior work (Lin et al., 2003; Gupta et al., 2014) investigated different extractor scoring measures. Gupta and Manning (2014) improved scores by introducing expected number of negative entities. Brin (1998) developed the bootstrapping rela- tion extraction system DIPRE that generates ex- tractors by clustering contexts based on string matching. SnowBall (Agichtein and Gravano, 2000) is inspired by DIPRE but computes a TF- IDF representation of each context. BREDS (Batista et al., 2015) uses word embeddings (Mikolov et al., 2013) to bootstrap relationships. Related work investigated adapting extractor scoring measures in bootstrapping entity extrac- tion with either entities or templates (Table 1) as seeds (Table 2). The state-of-the-art relation ex- tractors bootstrap with only seed entity pairs and suffer due to a surplus of unknown extractions and the lack of labeled data, leading to low con- fidence extractors. This in turn leads to to low confidence in the system output. Prior RE sys- BREE BRET BREJ type typed entity entity pair template instance γ i xpiq xpiq Gp Gn Gp Gn G kit λcat cat λN N HC λN N LC λN HC λN LC Bootstrapping Relation Extractor with Entity pair Bootstrapping Relation Extractor with Template Bootstrapping Relation Extractor in Joint learning a named entity type, e.g., person a typed entity, e.g., ă"Obama",personą a pair of two typed entities a triple of vectors ((cid:126)v´1, (cid:126)v0, (cid:126)v1) and an entity pair entity pair and template (types must be the same) instance set extracted from corpus a member of γ, i.e., an instance the entity pair of instance i the template of instance i a set of positive seed entity pairs a set of negative seed entity pairs a set of positive seed templates a set of negative seed templates ă Gp, Gn, Gp, Gn ą number of iterations cluster of instances (extractor) category of extractor λ Non-Noisy-High-Confidence extractor (True Positive) Non-Noisy-Low-Confidence extractor (True Negative) Noisy-High-Confidence extractor (False Positive) Noisy-Low-Confidence extractor (False Negative) Table 1: Notation and definition of key terms tems do not focus on improving the extractors' scores. In addition, SnowBall and BREDS used a weighting scheme to incorporate the importance of contexts around entities and compute a similar- ity score that introduces additional parameters and does not generalize well. Contributions. (1) We propose a Joint Boot- strapping Machine1 (JBM), an alternative to the entity-pair-centered bootstrapping for relation ex- traction that can take advantage of both entity-pair and template-centered methods to jointly learn extractors consisting of instances due to the oc- currences of both entity pair and template seeds. It scales up the number of positive extractions for non-noisy extractors and boosts their confi- dence scores. We focus on improving the scores for non-noisy-low-confidence extractors, resulting in higher recall. The relation extractors boot- strapped with entity pair, template and joint seeds are named as BREE, BRET and BREJ (Table 1), respectively. (2) Prior work on embedding-based con- relations text comparison has assumed that have consistent syntactic expression and has mainly addressed synonymy by using embeddings (e.g.,"acquired" -- "bought"). In reality, there is large variation in the syntax of how relations are expressed, e.g., "MSFT to acquire NOK for $8B" 1github.com/pgcool/Joint-Bootstrapping-Machines vs. "MSFT earnings hurt by NOK acquisition". We introduce cross-context similarities that com- pare all parts of the context (e.g., "to acquire" and "acquisition") and show that these perform better (in terms of recall) than measures assuming con- sistent syntactic expression of relations. (3) Experimental results demonstrate a 13% gain in F 1 score on average for four relationships and suggest eliminating four parameters, com- pared to the state-of-the-art method. The motivation and benefits of the proposed JBM for relation extraction is discussed in depth in section 2.3. The method is applicable for both entity and relation extraction tasks. However, in context of relation extraction, we call it BREJ. 2 Method 2.1 Notation and definitions We first introduce the notation and terms (Table 1). Given a relationship like "x acquires y", the task is to extract pairs of entities from a corpus for which the relationship is true. We assume that the arguments of the relationship are typed, e.g., x and y are organizations. We run a named entity tagger in preprocessing, so that the types of all candidate entities are given. The objects the bootstrapping algorithm generally handles are therefore typed entities (an entity associated with a type). For a particular sentence in a corpus that states that the relationship (e.g., "acquires") holds be- tween x and y, a template consists of three vectors that represent the context of x and y. (cid:126)v´1 repre- sents the context before x, (cid:126)v0 the context between x and y and (cid:126)v1 the context after y. These vectors are simply sums of the embeddings of the corre- sponding words. A template is "typed", i.e., in addition to the three vectors it specifies the types of the two entities. An instance joins an entity pair and a template. The types of entity pair and tem- plate must be the same. The first step of bootstrapping is to extract a set of instances from the input corpus. We refer to this set as γ. We will use i and j to refer to instances. xpiq is the entity pair of instance i and xpiq is the template of instance i. A required input to our algorithm are sets of positive and negative seeds for either entity pairs (Gp and Gn) or templates (Gp and Gn) or both. We define G to be a tuple of all four seed sets. We run our bootstrapping algorithm for kit iter- ations where kit is a parameter. A key notion is the similarity between two in- stances. We will experiment with different sim- ilarity measures. The baseline is (Batista et al., 2015)'s measure given in Figure 4, first line: the similarity of two instances is given as a weighted sum of the dot products of their before contexts ((cid:126)v´1), their between contexts ((cid:126)v0) and their after contexts ((cid:126)v1) where the weights wp are parame- ters. We give this definition for instances, but it also applies to templates since only the context vectors of an instance are used, not the entities. The similarity between an instance i and a clus- ter λ of instances is defined as the maximum sim- ilarity of i with any member of the cluster; see Figure 2, right, Eq. 5. Again, there is a straight- forward extension to a cluster of templates: see Figure 2, right, Eq. 6. ^ cnfpλ,Gq ě τcnfu loomoon The extractors Λ can be categorized as follows: ΛN N HC " tλ P Λ λ ÞÑ R non´noisy loomoon ΛN N LC " tλ P Λλ ÞÑ R ^ cnfpλ,Gq ă τcnfu ÞÑ R ΛN HC " tλ P Λ λ - ^ cnfpλ,Gq ě τcnfu ÞÑ R ^ cnfpλ,Gq ă τcnfu ΛN LC " tλ P Λλ - (1) (2) noisy (3) (4) where R is the relation to be bootstrapped. The λcat is a member of Λcat. For instance, a λN N LC is called as a non-noisy-low-confidence extractor if it represents the target relation (i.e., λ ÞÑ R), how- ever with the confidence below a certain threshold (τcnf ). Extractors of types ΛN N HC and ΛN LC are desirable, those of types ΛN HC and ΛN N LC un- desirable within bootstrapping. 2.2 The Bootstrapping Machines: BREX To describe BREX (Figure 1) in its most general form, we use the term item to refer to an entity pair, a template or both. The input to BREX (Figure 2, left, line 01) is a set γ of instances extracted from a corpus and Gseed, a structure consisting of one set of positive and one set of negative seed items. Gyield (line 02) collects the items that BREX extracts in several it- erations. In each of kit iterations (line 03), BREX first initializes the cache Gcache (line 04); this cache collects the items that are extracted in this itera- tion. The design of the algorithm balances ele- ments that ensure high recall with elements that ensure high precision. High recall is achieved by starting with the seeds and making three "hops" that consecutively consider order-1, order-2 and order-3 neighbors Figure 1: Joint Bootstrapping Machine. The red and blue filled circles/rings are the instances generated due to seed entity pairs and templates, respectively. Each dashed rectangular box represents a cluster of in- stances. Numbers indicate the flow. Follow the nota- tions from Table 1 and Figure 2. of the seeds. On line 05, we make the first hop: all instances that are similar to a seed are col- lected where "similarity" is defined differently for different BREX configurations (see below). The collected instances are then clustered, similar to work on bootstrapping by Agichtein and Gravano (2000) and Batista et al. (2015). On line 06, we make the second hop: all instances that are within τ sim of a hop-1 instance are added; each such in- stance is only added to one cluster, the closest one; see definition of µ: Figure 2, Eq. 8. On line 07, we make the third hop: we include all instances that are within τ sim of a hop-2 instance; see definition of ψ: Figure 2, Eq. 7. In summary, every instance that can be reached by three hops from a seed is being considered at this point. A cluster of hop-2 instances is named as extractor. High precision is achieved by imposing, on line 08, a stringent check on each instance before its information is added to the cache. The core func- tion of this check is given in Figure 2, Eq. 9. This definition is a soft version of the following hard max, which is easier to explain: cnfpi, Λ,Gq « maxtλPΛiPψpλqu cnfpi, λ,Gq We are looking for a cluster λ in Λ that li- censes the extraction of i with high confidence. cnfpi, λ,Gq (Figure 2, Eq. 10), the confidence of a single cluster (i.e., extractor) λ for an instance, is defined as the product of the overall reliability of λ (which is independent of i) and the similarity of i to λ, the second factor in Eq. 10, i.e., simpi, λq. This factor simpi, λq prevents an extraction by a cluster whose members are all distant from the in- stance -- even if the cluster itself is highly reliable. ......SeedsSeed Occurrences Extractors Candidate Instances Output Instances(4)Compute Extractors' Confidence(5)Identify positives, negatives, unknownsAugment Initial Seed sets with Output Instances in GenerateExtractors FindOccurr-encesclusterHop-1Hop-2Hop-3 1 2 3 4cluster(1)(2)(3)(6) Algorithm: BREX 01 INPUT: γ, Gseed 02 Gyield :" Gseed Ţ 03 for kit iterations: Gcache :" H 04 Ť pti P γmatchpi,Gyieldqq Θ :" 05 Λ :" tµpθ, Θqθ P Θu 06 λPΛ ψpλq: for each i P 07 if checkpi, Λ,Gyieldq : 08 addpi,Gcacheq 09 GyieldY" Gcache 10 11 OUTPUT: Gyield, Λ simpi, λq " maxi1Pλsimpi, i1q simpi, Gq " maxtPGsimpi, tq simpi, θq ě τ simu ψpλq " ti P γsimpi, λq ě τ simu µpθ, Θq " ti P γsimpi, θq " d ^ ź d " max θPΘ cnfpi, Λ,Gq " 1 ´ p1´cnfpi, λ,Gqq cnfpi, λ,Gq " cnfpλ,Gqsimpi, λq cnfpλ,Gq " 1 N`pλ,Gnq N`pλ,Gpq ` wu N0pλ,Gq " ti P λxpiq R pGp Y Gnqu tλPΛiPψpλqu 1 ` wn N0pλ,Gq N`pλ,Gpq (5) (6) (7) (8) (9) (10) (11) (12) Figure 2: BREX algorithm (left) and definition of key concepts (right) Seed Type (i) N`pλ,Glq (ii)pwn, wuq 05 matchpi,Gq 08 checkpi, Λ,Gq 09 addpi,Gq BREE Entity pairs tiPλxpiqPGlu p1.0, 0.0q xpiq P Gp cnfpi, Λ,Gqě τcnf GpY" txpiqu BRET Templates tiPλsimpi, Glqě τsimu p1.0, 0.0q simpi, Gpqě τsim cnfpi, Λ,Gqě τcnf GpY" txpiqu Figure 3: BREX configurations BREJ Joint (Entity pairs + Templates) tiPλxpiqPGlu`tiPλsimpi, Glqě τsimu p1.0, 0.0q xpiq P Gp _ simpi, Gpqě τsim cnfpi, Λ,Gqě τcnf ^ simpi, Gpqě τsim GpY" txpiqu, GpY" txpiqu The first factor in Eq. 10, i.e., cnfpλ,Gq, as- sesses the reliability of a cluster λ: we compute the ratio N`pλ,Gnq N`pλ,Gpq , i.e., the ratio between the num- ber of instances in λ that match a negative and pos- itive gold seed, respectively; see Figure 3, line (i). If this ratio is close to zero, then likely false pos- itive extractions are few compared to likely true positive extractions. For the simple version of the algorithm (for which we set wn " 1, wu " 0), this results in cnfpλ,Gq being close to 1 and the reliability measure it not discounted. On the other hand, if N`pλ,Gnq N`pλ,Gpq is larger, meaning that the rela- tive number of likely false positive extractions is high, then cnfpλ,Gq shrinks towards 0, resulting in progressive discounting of cnfpλ,Gq and lead- ing to non-noisy-low-confidence extractor, partic- ularly for a reliable λ. Due to lack of labeled data, the scoring mechanism cannot distinguish between noisy and non-noisy extractors. There- fore, an extractor is judged by its ability to extract more positive and less negative extractions. Note that we carefully designed this precision compo- nent to give good assessments while at the same time making maximum use of the available seeds. The reliability statistics are computed on λ, i.e., on hop-2 instances (not on hop-3 instances). The ratio N`pλ,Gnq N`pλ,Gpq is computed on instances that di- rectly match a gold seed -- this is the most reliable information we have available. After all instances have been checked (line 08) and (if they passed muster) added to the cache (line 09), the inner loop ends and the cache is merged into the yield (line 10). Then a new loop (lines 03 -- 10) of hop-1, hop-2 and hop-3 exten- sions and cluster reliability tests starts. Thus, the algorithm consists of kit iterations. There is a tradeoff here between τ sim and kit. We will give two extreme examples, assuming that we want to extract a fixed number of m instances where m is given. We can achieve this goal either by setting kit=1 and choosing a small τ sim, which will result in very large hops. Or we can achieve this goal by setting τ sim to a large value and run- ning the algorithm for a larger number of kit. The flexibility that the two hyperparameters kit and τ sim afford is important for good performance. ř simmatchpi, jq " simsym2 cc ` pPt´1,0,1u wp(cid:126)vppiq(cid:126)vppjq (cid:126)v´1piq ` (cid:126)v1piq pi, jq " maxpPt´1,0,1u (cid:126)vppiq(cid:126)v0pjq ¯ maxpPt´1,0,1u (cid:126)vppiq(cid:126)v0pjq, maxpPt´ 1,0,1u (cid:126)vppjq(cid:126)v0piq (cid:126)v0piq, (cid:126)v0piq(cid:126)v0pjq (cid:126)v0pjq, (cid:126)v´1pjq ` (cid:126)v1pjq cc simsym1 pi, jq " max pi, jq " max ´` ; simasym cc ` (13) (14) (15) Figure 4: Similarity measures. These definitions for instances equally apply to templates since the definitions only depend on the "template part" of an instance, i.e., its vectors. (value is 0 if types are different) Figure 5: Illustration of Scaling-up Positive Instances. i: an instance in extractor, λ. Y: YES and N: NO 2.3 BREE, BRET and BREJ The main contribution of this paper is that we propose, as an alternative to entity-pair-centered BREE (Batista et al., 2015), template-centered BRET as well as BREJ (Figure 1), an instantiation of BREX that can take advantage of both entity pairs and templates. The differences and advan- tages of BREJ over BREE and BRET are: (1) Disjunctive Matching of Instances: The first difference is realized in how the three algo- rithms match instances with seeds (line 05 in Fig- ure 3). BREE checks whether the entity pair of an instance is one of the entity pair seeds, BRET checks whether the template of an instance is one of the template seeds and BREJ checks whether the disjunction of the two is true. The disjunc- tion facilitates a higher hit rate in matching in- stances with seeds. The introduction of a few handcrafted templates along with seed entity pairs allows BREJ to leverage discriminative patterns and learn similar ones via distributional semantics. In Figure 1, the joint approach results in hybrid extractors Λ that contain instances due to seed oc- currences Θ of both entity pairs and templates. (2) Hybrid Augmentation of Seeds: On line 09 in Figure 3, we see that the bootstrapping step is defined in a straightforward fashion: the entity pair of an instance is added for BREE, the template for BRET and both for BREJ. Figure 1 demonstrates Figure 6: An illustration of scaling positive extractions and computing confidence for a non-noisy extractor generated for acquired relation. The dashed rectangu- lar box represents an extractor λ, where λ (BREJ) is hybrid with 6 instances. Text segments matched with seed template are shown in italics. Unknowns (bold in black) are considered as negatives. Gcache is a set of output instances where τcnf " 0.70. the hybrid augmentation of seeds via red and blue rings of output instances. (3) Scaling Up Positives in Extractors: As dis- cussed in section 2.2, a good measure of the qual- ity of an extractor is crucial and N`, the number of instances in an extractor λ that match a seed, is an important component of that. For BREE and BRET, the definition follows directly from the fact that these are entity-pair and template-centered in- stantiations of BREX, respectively. However, the disjunctive matching of instances for an extrac- tor with entity pair and template seeds in BREJ (Figure 3 line "(i)" ) boosts the likelihood of find- ing positive instances. In Figure 5, we demon- strate computing the count of positive instances iN+( ,G ) N01+0Y+101+0Y+1NN+0Y+1NY+1Y+1N+01210+0BREEBREJBRETpN+( ,G ) pN+( , ) pN+( , ) pN+( , ) pI1: 's purchase ofI2: 's acquisition ofI1: 's purchase of (BREE)I1: 's purchase ofI2: 's acquisition of(BRET) (BREJ)Seed Entity Pair: = {<Google, DoubleClick>}Seed Templates: = {[X] 's acquisition of [Y]}Matched Instances: I1: <Google> 's purchase of <DoubleClick> is intriguing. I2: <Google> 's acquisition of <DoubleClick> is approved. I3: <Dynegy> 's purchase of <Enron> triggered a clause. I4: <Google> 's acquisition of <YouTube> was in its final stages.Generate Extractor Positive: {I1, I2} Negative: {I3, I4}Positive: {I1, I2, I3, I4}Positive: {I1, I2, I1, I2, I3, I4}Negative: {I3, I4}I2: 's acquisition ofI3: 's purchase ofI4: 's acquisition ofI1: 's purchase ofI2: 's acquisition ofI3: 's purchase ofI4: 's acquisition of = {<Google, Microsoft>} = {[X] competitor of [Y]}: { } : {I1, I2, I3, I4}: {I1, I2, I3, I4}Output InstancesMatch Seeds in Instances2=24=02+4=2+0 = 0.5 = 1.0 = 0.75 Relationship acquired founder-of headquartered affiliation Seed Entity Pairs {Adidas;Reebok},{Google;DoubleClick}, {Widnes;Warrington},{Hewlett-Packard;Compaq} {CNN;Ted Turner},{Facebook;Mark Zuckerberg}, {Microsoft;Paul Allen},{Amazon;Jeff Bezos}, {Nokia;Espoo},{Pfizer;New York}, {United Nations;New York},{NATO;Brussels}, {Google;Marissa Mayer},{Xerox;Ursula Burns}, { Microsoft;Steve Ballmer},{Microsoft;Bill Gates}, {[X] acquire [Y]},{[X] acquisition [Y]},{[X] buy [Y]}, {[X] takeover [Y]},{[X] merger with [Y]} {[X] founded by [Y]},{[X] co-founder [Y]},{[X] started by [Y]}, {[X] founder of [Y]},{[X] owner of [Y]} Seed Templates {[X] based in [Y]},{[X] headquarters in [Y]},{[X] head office in [Y]}, {[X] main office building in [Y]},{[X] campus branch in [Y]} {[X] CEO [Y]},{[X] resign from [Y]},{[X] founded by [Y]}, {[X] worked for [Y]},{[X] chairman director [Y]} Table 2: Seed Entity Pairs and Templates for each relation. [X] and [Y] are slots for entity type tags. N`pλ,Gq for an extractor λ within the three sys- tems. Observe that an instance i in λ can scale its N`pλ,Gq by a factor of maximum 2 in BREJ if i is matched in both entity pair and template seeds. The reliability cnfpλ,Gq (Eq. 11) of an extractor λ is based on the ratio N`pλ,Gnq N`pλ,Gpq , therefore suggest- ing that the scaling boosts its confidence. In Figure 6, we demonstrate with an example how the joint bootstrapping scales up the positive instances for a non-noisy extractor λ, resulting in λN N HC for BREJ compared to λN N LC in BREE. Due to unlabeled data, the instances not match- ing in seeds are considered either to be ig- nored/unknown N0 or negatives in the confidence measure (Eq. 11). The former leads to high con- fidences for noisy extractors by assigning high scores, the latter to low confidences for non-noisy extractors by penalizing them. For a simple ver- sion of the algorithm in the illustration, we con- sider them as negatives and set wn " 1. Figure 6 shows the three extractors (λ) generated and their confidence scores in BREE, BRET and BREJ. Ob- serve that the scaling up of positives in BREJ due to BRET extractions (without wn) discounts cnfpλ,Gq relatively lower than BREE. The dis- counting results in λN N HC in BREJ and λN N LC in BREE. The discounting in BREJ is adapted for non-noisy extractors facilitated by BRET in gener- ating mostly non-noisy extractors due to stringent checks (Figure 3, line "(i)" and 05). Intuitively, the intermixing of non-noisy extractors (i.e., hy- brid) promotes the scaling and boosts recall. 2.4 Similarity Measures The before ((cid:126)v´1) and after ((cid:126)v1) contexts around the entities are highly sparse due to large varia- tion in the syntax of how relations are expressed. SnowBall, DIPRE and BREE assumed that the between ((cid:126)v0) context mostly defines the syntac- tic expression for a relation and used weighted mechanism on the three contextual similarities in ORG-ORG ORG-PER ORG-LOC count 58,500 75,600 95,900 Table 3: Count of entity-type pairs in corpus Parameter v´1 v0 v1 τsim τcnf wn wu kit dimemb P M I Entity Pairs Description/ Search Optimal maximum number of tokens in before context maximum number of tokens in between context maximum number of tokens in after context similarity threshold [0.6, 0.7, 0.8] instance confidence thresholds [0.6, 0.7, 0.8] weights to negative extractions [0.0, 0.5, 1.0, 2.0] weights to unknown extractions [0.0001, 0.00001] number of bootstrapping epochs dimension of embedding vector, V PMI threshold in evaluation Ordered Pairs (OP ) or Bisets (BS) 2 6 2 0.7 0.7 0.5 0.0001 3 300 0.5 OP Table 4: Hyperparameters in BREE, BRET and BREJ pairs, simmatch (Figure 4). They assigned higher weights to the similarity in between (p " 0) con- texts, that resulted in lower recall. We introduce attentive (max) similarity across all contexts (for example, (cid:126)v´1piq(cid:126)v0pjq) to automatically capture the large variation in the syntax of how relations are expressed, without using any weights. We in- vestigate asymmetric (Eq 13) and symmetric (Eq 14 and 15) similarity measures, and name them as cross-context attentive (simcc) similarity. 3 Evaluation 3.1 Dataset and Experimental Setup We re-run BREE (Batista et al., 2015) for base- line with a set of 5.5 million news articles from AFP and APW (Parker et al., 2011). We use pro- cessed dataset of 1.2 million sentences (released by BREE) containing at least two entities linked to FreebaseEasy (Bast et al., 2014). We extract four founder- relationships: of (ORG-PER), headquartered (ORG-LOC) and affiliation (ORG-PER) for Organization (ORG), Person (PER) and Location (LOC) entity types. We bootstrap relations in BREE, BRET and BREJ, each with 4 similarity measures using seed entity acquired (ORG-ORG), Relationships #out P R F 1 #out P R F 1 #out P R F 1 #out acquired founder-of headquartered E E R B affiliation avg acquired founder-of headquartered T E R B affiliation avg acquired founder-of headquartered J E R B affiliation avg 0.48 0.70 0.80 0.73 0.68 0.88 0.98 0.62 0.99 0.86 baseline: BREE+simmatch 0.62 2687 0.82 628 0.69 16786 20948 0.84 10262 0.74 config5: BRET+simmatch 0.76 4206 0.86 920 3065 0.72 0.85 20726 7229 0.80 config9: BREJ+simmatch 0.84 20186 0.89 45005 0.76 47010 0.89 40959 38290 0.85 0.87 0.99 0.93 0.84 0.91 0.62 0.77 0.55 0.73 0.67 0.99 0.97 0.98 0.99 0.98 0.82 0.81 0.64 0.96 0.81 cc cc 0.88 0.86 0.66 0.97 0.84 0.66 0.95 0.85 0.78 0.81 config2: BREE+simasym 0.76 5771 0.89 9553 0.74 21299 27424 0.87 16011 0.82 config6: BRET+simasym 0.87 15666 0.89 43554 39267 0.78 0.88 28822 31827 0.86 config10: BREJ+simasym 35553 0.86 0.90 57710 0.80 66563 0.91 57301 54282 0.87 0.92 1.00 0.96 0.88 0.94 0.90 0.81 0.68 0.99 0.85 0.85 0.98 0.92 0.79 0.89 0.80 0.81 0.68 0.94 0.81 cc cc cc 0.55 0.84 0.83 0.82 0.76 0.88 0.94 0.70 0.95 0.87 config3: BREE+simsym1 0.68 3471 0.89 1532 0.76 17301 36797 0.88 14475 0.80 config7: BRET+simsym1 0.87 18273 0.89 41978 36374 0.80 0.90 44946 35393 0.86 config11: BREJ+simsym1 cc 22975 0.87 0.89 50237 0.79 60495 0.91 55811 47380 0.87 0.86 0.99 0.91 0.85 0.90 0.87 0.81 0.71 0.96 0.84 0.86 0.81 0.68 0.94 0.82 0.89 0.99 0.94 0.87 0.92 cc cc P R 0.53 0.81 0.74 0.78 0.72 0.88 0.95 0.72 0.97 0.88 F 1 config4: BREE+simsym2 0.66 3279 0.87 1182 0.73 9842 28416 0.87 10680 0.78 config8: BRET+simsym2 0.87 14319 0.89 46453 56815 0.80 0.89 33938 37881 0.86 config12: BREJ+simsym2 cc 0.88 22808 0.90 45374 0.79 57853 0.90 51638 44418 0.87 0.85 0.82 0.68 0.94 0.82 0.92 0.81 0.69 0.97 0.85 0.84 0.99 0.94 0.81 0.90 0.90 0.99 0.94 0.87 0.93 Table 5: Precision (P ), Recall (R) and F 1 compared to the state-of-the-art (baseline). #out: count of output in- stances with cnfpi, Λ,Gq ě 0.5. avg: average. Bold and underline: Maximum due to BREJ and simcc, respectively. pairs and templates (Table 2). See Tables 3, 4 and 5 for the count of candidates, hyperparameters and different configurations, respectively. Our evaluation is based on Bronzi et al. (2012)'s framework to estimate precision and recall of large-scale RE systems using FreebaseEasy (Bast et al., 2014). Also following Bronzi et al. (2012), we use Pointwise Mutual Information (PMI) (Tur- ney, 2001) to evaluate our system automatically, in addition to relying on an external knowledge base. We consider only extracted relationship in- stances with confidence scores cnfpi, Λ,Gq equal or above 0.5. We follow the same approach as BREE (Batista et al., 2015) to detect the correct or- der of entities in a relational triple, where we try to identify the presence of passive voice using part- of-speech (POS) tags and considering any form of the verb to be, followed by a verb in the past tense or past participle, and ending in the word 'by'. We use GloVe (Pennington et al., 2014) embeddings. 3.2 Results and Comparison with baseline Table 5 shows the experimental results in the three systems for the different relationships with ordered entity pairs and similarity measures (simmatch, simcc). Observe that BRET (config5) is precision-oriented while BREJ (config9) recall- oriented when compared to BREE (baseline). We see the number of output instances #out are also higher in BREJ, therefore the higher recall. The BREJ system in the different similarity configura- τ 0.6 0.7 0.8 kit #out 691 1 11288 2 1 610 7948 2 522 1 2 2969 P 0.99 0.85 1.0 0.93 1.0 0.90 R 0.21 0.79 0.19 0.75 0.17 0.51 F 1 0.35 0.81 0.32 0.83 0.29 0.65 Table 6: Iterations (kit) Vs Scores with thresholds (τ) for relation acquired in BREJ. τ refers to τsim and τcnf E R B τ E .60 .80 T .60 .80 J .60 .80 E R B E R B #out 1785 868 2995 1312 18271 8896 P .91 .95 .89 .91 .81 .88 R F 1 .55 .39 .25 .39 .65 .51 .47 .32 .83 .85 .75 .81 τ .70 .90 .70 .90 .70 .90 #out 1222 626 1859 752 14900 5158 P .94 .96 .90 .94 .84 .93 R F 1 .47 .31 .19 .32 .55 .40 .35 .22 .83 .83 .65 .77 Table 7: Comparative analysis using different thresh- olds τ to evaluate the extracted instances for acquired tions outperforms the baseline BREE and BRET in terms of F 1 score. On an average for the four rela- tions, BREJ in configurations config9 and config10 results in F 1 that is 0.11 (0.85 vs 0.74) and 0.13 (0.87 vs 0.74) better than the baseline BREE. We discover that simcc improves #out and re- call over simmatch correspondingly in all three sys- tems. Observe that simcc performs better with BRET than BREE due to non-noisy extractors in BRET. The results suggest an alternative to the weighting scheme in simmatch and therefore, the state-of-the-art (simcc) performance with the 3 pa- rameters (w´1, w0 and w1) ignored in bootstrap- acquired founder-of BREX E 71 #hit T 682 J 743 E 135 T 956 J 1042 headquartered E J 715 3447 T 4023 affiliation T J 14888 15052 E 603 Table 8: Disjunctive matching of Instances. #hit: the count of instances matched to positive seeds in kit " 1 e r i u q c a o - r e d n u o f Attributes d BREE BRET BREJ f BREE BRET BREJ d BREE BRET BREJ n BREE BRET BREJ e r e t r a u q d a e h o i t a i l fi f a Λ 167 17 555 8 5 492 655 7 1311 198 19 470 AIE AES AN E AN N E AN N LC 12.7 305.2 41.6 13.3 179.0 109.1 18.4 365.7 45.5 99.7 846.9 130.2 0.14 0.00 0.03 0.12 0.00 0.00 0.02 0.00 0.00 0.34 0.00 0.06 0.84 0.11 0.71 0.75 0.00 0.94 0.97 0.00 0.98 0.25 0.00 0.21 0.16 0.89 0.29 0.25 1.00 0.06 0.03 1.00 0.02 0.75 1.00 0.79 0.51 1.00 0.74 0.46 1.00 0.90 0.60 1.00 0.80 0.55 1.00 0.72 AP 37.7 671.8 313.2 44.9 372.2 451.8 46.3 848.6 324.1 240.5 2137.0 567.6 AN AN P 2.46 93.1 0.00 0.12 0.14 44.8 13.37 600.5 0.0 0.00 0.18 79.5 1.78 82.7 0.00 0.0 0.24 77.5 152.2 0.63 0.00 0.0 122.7 0.22 Table 9: Analyzing the attributes of extractors Λ learned for each relationship. Attributes are: number of extractors (Λ), avg number of instances in Λ (AIE), avg Λ score (AES), avg number of noisy Λ (ANE), avg number of non-noisy Λ (ANNE), avg number of ΛN N LC below confidence 0.5 (ANNLC), avg number of positives (AP) and negatives (AN), ratio of AN to AP (ANP). The bold indicates comparison of BREE and BREJ with simmatch. avg: average ping. Observe that simasym than the two symmetric similarity measures. gives higher recall cc Table 6 shows the performance of BREJ in dif- ferent iterations trained with different similarity τsim and confidence τcnf thresholds. Table 7 shows a comparative analysis of the three systems, where we consider and evaluate the extracted rela- tionship instances at different confidence scores. 3.3 Disjunctive Seed Matching of Instances As discussed in section 2.3, BREJ facilitates dis- junctive matching of instances (line 05 Figure 3) with seed entity pairs and templates. Table 8 shows #hit in the three systems, where the higher values of #hit in BREJ conform to the desired property. Observe that some instances in BREJ are found to be matched in both the seed types. 3.4 Deep Dive into Attributes of Extractors We analyze the extractors Λ generated in BREE, BRET and BREJ for the 4 relations to demon- strate the impact of joint bootstrapping. Table 9 shows the attributes of Λ. We manually annotate the extractors as noisy and non-noisy. We compute AN N LC and the lower values in BREJ compared to BREE suggest fewer non-noisy extractors with lower confidence in BREJ due to the scaled confi- E E R B T E R B J E R B headquartered affiliation acquired founder-of acquired founder-of Relationships #out 387 28 672 17516 4651 4031 920 3522 22062 7634 12278 23727 38737 33203 26986 acquired founder-of affiliation affiliation headquartered headquartered avg avg avg P 0.99 0.96 0.95 0.99 0.97 1.00 0.97 0.98 0.99 0.99 0.87 0.80 0.61 0.98 0.82 R 0.13 0.09 0.21 0.68 0.28 0.61 0.77 0.59 0.74 0.68 0.81 0.99 0.91 0.81 0.88 F 1 0.23 0.17 0.34 0.80 0.39 0.76 0.86 0.73 0.85 0.80 0.84 0.89 0.73 0.89 0.84 Table 10: BREX+simmatch:Scores when wn ignored dence scores. ANNE (higher), ANNLC (lower), AP (higher) and AN (lower) collectively indicate that BRET mostly generates NNHC extractors. AP and AN indicate an average of N`pλ,Glq (line " (i)" Figure 3) for positive and negative seeds, respec- tively for λ P Λ in the three systems. Observe the impact of scaling positive extractions (AP) in BREJ that shrink N`pλ,Gnq i.e., ANP. It facili- N`pλ,Gpq tates λN N LC to boost its confidence, i.e., λN N HC in BREJ suggested by AES that results in higher #out and recall (Table 5, BREJ). 3.5 Weighting Negatives Vs Scaling Positives As discussed, Table 5 shows the performance of BREE, BRET and BREJ with the parameter wn " 0.5 in computing extractors' confidence cnfpλ,Gq(Eq. 11). In other words, config9 (Ta- ble 5) is combination of both weighted negative and scaled positive extractions. However, we also investigate ignoring wnp" 1.0q in order to demon- strate the capability of BREJ with only scaling positives and without weighting negatives. In Table 10, observe that BREJ outperformed both BREE and BRET for all the relationships due to higher #out and recall. In addition, BREJ scores are comparable to config9 (Table 5) suggesting that the scaling in BREJ is capable enough to re- move the parameter wn. However, the combina- tion of both weighting negatives and scaling posi- tives results in the state-of-the-art performance. 3.6 Qualitative Inspection of Extractors Table 11 lists some of the non-noisy extrac- tors (simplified) learned in different configura- tions to illustrate boosting extractor confidence cnfpλ,Gq. Since, an extractor λ is a cluster of instances, therefore to simplify, we show one in- config1: BREE + simmatch cnfpλ, Gq config5: BRET + simmatch cnfpλ, Gq config9: BREJ + simmatch cnfpλ, Gq config10: BREJ + simasym cc cnfpλ, Gq [X] acquired [Y] [X] takeover of [Y] [X] 's planned acquisition of [Y] [X] acquiring [Y] [X] has owned part of [Y] [X] took control of [Y] [X] 's acquisition of [Y] [X] 's merger with [Y] [X] 's bid for [Y] [X] founder [Y] [X] CEO and founder [Y] [X] 's co-founder [Y] [X] headquarters in [Y] [X] relocated its headquarters from [Y] [X] head office in [Y] [X] based in [Y] [X] headquarters building in [Y] [X] headquarters in downtown [Y] [X] branch offices in [Y] [X] 's corporate campus in [Y] [X] 's corporate office in [Y] [X] chief executive [Y] [X] secretary [Y] [X] president [Y] [X] leader [Y] [X] party leader [Y] [X] has appointed [Y] [X] player [Y] [X] 's secretary-general [Y] [X] hired [Y] 0.98 0.89 0.87 0.75 0.67 0.49 0.35 0.35 0.35 0.68 0.15 0.09 0.95 0.94 0.84 0.75 0.67 0.64 0.54 0.51 0.51 0.92 0.88 0.87 0.72 0.67 0.63 0.38 0.36 0.21 [X] acquired [Y] [X] takeover of [Y] [X] 's planned acquisition of[Y] [X] acquiring [Y] [X] has owned part of [Y] [X] 's ownership of [Y] [X] 's acquisition of [Y] [X] 's merger with[Y] [X] 's bid for [Y] [X] founder [Y] [X] CEO and founder [Y] [X] owner [Y] [X] cofounder [Y] [X] started by [Y] [X] was founded by [Y] [X] begun by [Y] [X] has established [Y] [X] chief executive and founder [Y] [X] headquarters in [Y] [X] relocated its headquarters from [Y] [X] head office in [Y] [X] based in [Y] [X] headquarters building in [Y] [X] headquarters in downtown [Y] [X] branch offices in [Y] [X] 's corporate campus in [Y] [X] 's corporate office in [Y] [X] chief executive [Y] [X] secretary [Y] [X] president [Y] [X] leader [Y] [X] party leader [Y] [X] executive editor [Y] [X] player [Y] [X] 's secretary-general [Y] [X] director [Y] acquired [X] acquired [Y] [X] takeover of [Y] [X] 's planned acquisition of [Y] [X] acquiring [Y] [X] has owned part of [Y] [X] took control of [Y] [X] 's acquisition of [Y] [X] 's merger with [Y] [X] 's bid for [Y] founder-of [X] founder [Y] [X] CEO and founder [Y] [X] owner [Y] [X] cofounder [Y] [X] started by [Y] [X] was founded by [Y] [X] begun by [Y] [X] has established [Y] [X] co-founder and billionaire [Y] 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 headquartered 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 [X] headquarters in [Y] [X] relocated its headquarters from [Y] [X] head office in [Y] [X] based in [Y] [X] headquarters building in [Y] [X] headquarters in downtown [Y] [X] branch offices in [Y] [X] 's corporate campus in [Y] [X] 's corporate office in [Y] affiliation [X] chief executive [Y] [X] secretary [Y] [X] president [Y] [X] leader [Y] [X] party leader [Y] [X] has appointed [Y] [X] player [Y] [X] 's secretary-general [Y] [X] hired [Y] 1.00 0.98 0.98 0.95 0.88 0.91 0.95 0.94 0.97 0.99 0.99 1.00 1.00 1.00 0.99 1.00 0.99 0.99 0.98 0.98 0.87 0.98 0.94 0.94 0.98 0.99 0.89 0.97 0.94 0.96 0.85 0.87 0.81 0.89 0.93 0.56 acquired by [X] , [Y] : takeover of [X] would boost [Y] 's earnings : acquisition of [X] by [Y] : [X] acquiring [Y] owned by [X] 's parent [Y] [X] takes control of [Y] acquisition of [X] would reduce [Y] 's share : [X] - [Y] merger between : part of [X] which [Y] acquired : founder of [X] , [Y] : co-founder of [X] 's millennial center , [Y] : owned by [X] cofounder [Y] Gates co-founded [X] with school friend [Y] : who co-founded [X] with [Y] : to co-found [X] with partner [Y] : [X] was started by [Y] , cofounder set up [X] with childhood friend [Y] : [X] co-founder and billionaire [Y] [X] headquarters in [Y] based at [X] 's suburban [Y] headquarters : head of [X] 's operations in [Y] : branch of [X] company based in [Y] [X] main campus in [Y] [X] headquarters in downtown [Y] [X] 's [Y] headquarters represented : [X] main campus in [Y] [X] , [Y] 's corporate : [X] chief executive [Y] resigned monday worked with [X] manager [Y] [X] voted to retain [Y] as CEO : head of [X] , [Y] : working with [X] , [Y] suggested : [X] president [Y] was fired [X] 's [Y] was fired : Chairman of [X] , [Y] : [X] hired [Y] as manager : 0.93 0.90 0.95 0.95 0.90 1.00 0.90 0.84 0.83 0.97 0.94 0.95 0.99 0.95 0.68 0.98 0.96 0.97 0.98 0.98 0.65 0.98 0.99 0.96 0.98 0.99 0.94 0.94 0.85 0.98 0.99 1.00 0.90 0.43 0.88 0.85 Table 11: Subset of the non-noisy extractors (simplified) with their confidence scores cnfpλ,Gq learned in different configurations for each relation. denotes that the extractor was never learned in config1 and config5. : indicates that the extractor was never learned in config1, config5 and config9. [X] and [Y] indicate placeholders for entities. stance (mostly populated) from every λ. Each cell in Table 11 represents either a simplified represen- tation of λ or its confidence. We demonstrate how the confidence score of a non-noisy extractor in BREE (config1) is increased in BREJ (config9 and config10). For instance, for the relation acquired, an extractor {[X] acquiring [Y]} is generated by BREE, BRET and BREJ; however, its confidence is boosted from 0.75 in BREE (config1) to 0.95 in BREJ (config9). Observe that BRET generates high confidence extractors. We also show extrac- tors (marked by :) learned by BREJ with simcc (config10) but not by config1, config5 and config9. 3.7 Entity Pairs: Ordered Vs Bi-Set In Table 5, we use ordered pairs of typed entities. Additionally, we also investigate using entity sets and observe improved recall due to higher #out in both BREE and BREJ, comparing correspond- ingly Table 12 and 5 (baseline and config9). 4 Conclusion We have proposed a Joint Bootstrapping Machine for relation extraction (BREJ) that takes advantage Relationships acquired founder-of headquartered affiliation avg BREE + simmatch BREJ + simmatch #out 2786 543 16832 21812 10493 P .90 1.0 .62 .99 .88 R F 1 #out 21733 .50 31890 .67 .81 52286 42601 .74 .68 37127 .64 .80 .70 .85 .75 P .80 .80 .64 .96 .80 R F 1 .83 .87 .89 .99 .94 .76 .90 .85 .91 .85 Table 12: BREX+simmatch:Scores with entity bisets of both entity-pair-centered and template-centered approaches. We have demonstrated that the joint approach scales up positive instances that boosts the confidence of NNLC extractors and improves recall. The experiments showed that the cross- context similarity measures improved recall and suggest removing in total four parameters. Acknowledgments We thank our colleagues Bernt Andrassy, Mark Buckley, Stefan Langer, Ulli Waltinger and Us- ama Yaseen, and anonymous reviewers for their review comments. This research was supported by Bundeswirtschaftsministerium (bmwi.de), grant 01MD15010A (Smart Data Web) at Siemens AG- CT Machine Intelligence, Munich Germany. References Eugene Agichtein and Luis Gravano. 2000. Snow- ball: Extracting relations from large plain-text col- In Proceedings of the 15th ACM confer- lections. ence on Digital libraries. Association for Comput- ing Machinery, Washington, DC USA, pages 85 -- 94. Gabor Angeli, Melvin Jose Johnson Premkumar, and Christopher D Manning. 2015. Leveraging linguis- tic structure for open domain information extraction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Lan- guage Processing. Association for Computational Linguistics, Beijing, China, volume 1, pages 344 -- 354. Hannah Bast, Florian Baurle, Bjorn Buchhold, and El- mar Haussmann. 2014. Easy access to the free- In Proceedings of the 23rd Interna- base dataset. tional Conference on World Wide Web. Association for Computing Machinery, Seoul, Republic of Ko- rea, pages 95 -- 98. David S. Batista, Bruno Martins, and M´ario J. Silva. 2015. Semi-supervised bootstrapping of relation- ship extractors with distributional semantics. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Associ- ation for Computational Linguistics, Lisbon, Portu- gal, pages 499 -- 504. Sergey Brin. 1998. Extracting patterns and rela- In International tions from the world wide web. Workshop on The World Wide Web and Databases. Springer, Valencia, Spain, pages 172 -- 183. Mirko Bronzi, Zhaochen Guo, Filipe Mesquita, De- nilson Barbosa, and Paolo Merialdo. 2012. Auto- matic evaluation of relation extraction systems on large-scale. In Proceedings of the Joint Workshop on Automatic Knowledge Base Construction and Web- scale Knowledge Extraction (AKBC-WEKEX). As- sociation for Computational Linguistics, Montr`eal, Canada, pages 19 -- 24. Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R. Hruschka Jr., and Tom M. Mitchell. 2010. Toward an architecture for never- In Proceedings of the ending language learning. 24th National Conference on Artificial Intelligence (AAAI). Atlanta, Georgia USA, volume 5, page 3. Laura Chiticariu, Yunyao Li, and Frederick R. Reiss. 2013. Rule-based information extraction is dead! long live rule-based information extraction systems! In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. Associa- tion for Computational Linguistics, Seattle, Wash- ington USA, pages 827 -- 832. Anthony Fader, Stephen Soderland, and Oren Etzioni. Identifying relations for open information In Proceedings of the Conference on 2011. extraction. Empirical Methods in Natural Language Process- ing. Association for Computational Linguistics, Ed- inburgh, Scotland UK, pages 1535 -- 1545. Pankaj Gupta, Thomas Runkler, Heike Adel, Bernt Andrassy, Hans-Georg Zimmermann, and Hinrich Schutze. 2015. Deep learning methods for the ex- traction of relations in natural language text. Tech- nical report, Technical University of Munich, Ger- many. Pankaj Gupta, Hinrich Schutze, and Bernt Andrassy. 2016. Table filling multi-task recurrent neural net- work for joint entity and relation extraction. In Pro- ceedings of the 26th International Conference on Computational Linguistics: Technical Papers. Os- aka, Japan, pages 2537 -- 2547. Sonal Gupta, Diana L. MacLean, Jeffrey Heer, and Christopher D. Manning. 2014. Induced lexico- syntactic patterns improve information extraction from online medical forums. Journal of the Amer- ican Medical Informatics Association 21(5):902 -- 909. Sonal Gupta and Christopher Manning. 2014. Im- proved pattern learning for bootstrapped entity ex- the 18th Confer- traction. ence on Computational Natural Language Learning (CoNLL). Association for Computational Linguis- tics, Baltimore, Maryland USA, pages 98 -- 108. In Proceedings of Marti A Hearst. 1992. Automatic acquisition of hy- ponyms from large text corpora. In Proceedings of the 15th International Conference on Computational Linguistics. Nantes, France, pages 539 -- 545. Winston Lin, Roman Yangarber, and Ralph Grish- man. 2003. Bootstrapped learning of semantic classes from positive and negative examples. In Pro- ceedings of ICML 2003 Workshop on The Contin- uum from Labeled to Unlabeled Data in Machine Learning and Data Mining. Washington, DC USA, page 21. Mausam, Michael Schmitz, Robert Bart, Stephen Soderland, and Oren Etzioni. 2012. Open language learning for information extraction. In Proceedings of the 2012 Joint Conference on Empirical Meth- ods in Natural Language Processing and Compu- tational Natural Language Learning. Association for Computational Linguistics, Jeju Island, Korea, pages 523 -- 534. Filipe Mesquita, Jordan Schmidek, and Denilson Bar- bosa. 2013. Effectiveness and efficiency of open re- lation extraction. In Proceedings of the 2013 Con- ference on Empirical Methods in Natural Language Processing. Association for Computational Linguis- tics, Seattle, Washington USA, pages 447 -- 457. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word represen- tations in vector space. In Proceedings of the Work- shop at the International Conference on Learning Representations. ICLR, Scottsdale, Arizona USA. Thien Huu Nguyen and Ralph Grishman. 2015. Rela- tion extraction: Perspective from convolutional neu- ral networks. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Pro- cessing. Association for Computational Linguistics, Denver, Colorado USA, pages 39 -- 48. Robert Parker, David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2011. English gigaword. Linguis- tic Data Consortium . Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word In Proceedings of the 2014 Con- representation. ference on Empirical Methods in Natural Language Processing. Association for Computational Linguis- tics, Doha, Qatar, pages 1532 -- 1543. Ellen Riloff. 1996. Automatically generating extrac- In Proceedings tion patterns from untagged text. of the 13th National Conference on Artificial Intelli- gence (AAAI). Portland, Oregon USA, pages 1044 -- 1049. Peter D. Turney. 2001. Mining the web for synonyms: In Proceedings of the Pmi-ir versus lsa on toefl. 12th European Conference on Machine Learning. Springer, Freiburg, Germany, pages 491 -- 502. Ngoc Thang Vu, Heike Adel, Pankaj Gupta, and Hin- rich Schutze. 2016a. Combining recurrent and con- volutional neural networks for relation classifica- tion. In Proceedings of the 15th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT). Association for Com- putational Linguistics, San Diego, California USA, pages 534 -- 539. Ngoc Thang Vu, Pankaj Gupta, Heike Adel, and Hin- rich Schutze. 2016b. Bi-directional recurrent neu- ral network with ranking loss for spoken language In Proceedings of the IEEE Inter- understanding. national Conference on Acoustics, Speech and Sig- nal Processing (ICASSP). IEEE, Shanghai, China, pages 6060 -- 6064.