Inter-document Contextual Language Model

Similar documents
Improved Learning through Augmenting the Loss

Implicitly-Defined Neural Networks for Sequence Labeling

arxiv: v1 [cs.cl] 31 May 2015

arxiv: v1 [stat.ml] 18 Nov 2017

Implicitly-Defined Neural Networks for Sequence Labeling

RECURRENT NEURAL NETWORK BASED LANGUAGE MODELING WITH CONTROLLABLE EXTERNAL MEMORY

COMPARING FIXED AND ADAPTIVE COMPUTATION TIME FOR RE-

ACCELERATING RECURRENT NEURAL NETWORK TRAINING VIA TWO STAGE CLASSES AND PARALLELIZATION

a) b) (Natural Language Processing; NLP) (Deep Learning) Bag of words White House RGB [1] IBM

Long Short- Term Memory (LSTM) M1 Yuichiro Sawai Computa;onal Linguis;cs Lab. January 15, Deep Lunch

Recurrent Neural Networks (Part - 2) Sumit Chopra Facebook

Gated Feedback Recurrent Neural Networks

Natural Language Processing (CSEP 517): Machine Translation (Continued), Summarization, & Finale

Based on the original slides of Hung-yi Lee

arxiv: v7 [cs.ne] 2 Sep 2014

Natural Language Processing (CSEP 517): Language Models, Continued

arxiv: v3 [cs.cl] 24 Feb 2018

A QUESTION ANSWERING SYSTEM USING ENCODER-DECODER, SEQUENCE-TO-SEQUENCE, RECURRENT NEURAL NETWORKS. A Project. Presented to

Gated Recurrent Neural Tensor Network

High Order LSTM/GRU. Wenjie Luo. January 19, 2016

arxiv: v1 [cs.cl] 21 May 2017

arxiv: v1 [cs.cl] 31 Oct 2016

Empirical Methods in Natural Language Processing Lecture 10a More smoothing and the Noisy Channel Model

Neural Networks Language Models

Generating Text via Adversarial Training

Combining Static and Dynamic Information for Clinical Event Prediction

Learning to translate with neural networks. Michael Auli

ANLP Lecture 6 N-gram models and smoothing

Language Modeling. Hung-yi Lee 李宏毅

Foundations of Natural Language Processing Lecture 5 More smoothing and the Noisy Channel Model

Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting

EE-559 Deep learning LSTM and GRU

Seq2Tree: A Tree-Structured Extension of LSTM Network

Random Coattention Forest for Question Answering

Slide credit from Hung-Yi Lee & Richard Socher

Black-box α-divergence Minimization

Deep Recurrent Neural Networks

arxiv: v4 [cs.lg] 25 May 2016

Language Modelling. Steve Renals. Automatic Speech Recognition ASR Lecture 11 6 March ASR Lecture 11 Language Modelling 1

GAUSSIAN PROCESS LSTM RECURRENT NEURAL NETWORK LANGUAGE MODELS FOR SPEECH RECOGNITION

arxiv: v1 [cs.cl] 22 Jun 2015

arxiv: v4 [stat.ml] 8 Jan 2016

Improving Attention Modeling with Implicit Distortion and Fertility for Machine Translation

Deep learning for Natural Language Processing and Machine Translation

Recurrent Neural Networks with Flexible Gates using Kernel Activation Functions

Leveraging Context Information for Natural Question Generation

Convolutional Neural Networks II. Slides from Dr. Vlad Morariu

arxiv: v3 [cs.lg] 14 Jan 2018

arxiv: v2 [cs.cl] 1 Jan 2019

Segmental Recurrent Neural Networks for End-to-end Speech Recognition

Character-level Language Modeling with Gated Hierarchical Recurrent Neural Networks

Conditional Language Modeling. Chris Dyer

Edinburgh Research Explorer

Deep Gate Recurrent Neural Network

Unfolded Recurrent Neural Networks for Speech Recognition

From perceptrons to word embeddings. Simon Šuster University of Groningen

arxiv: v1 [cs.lg] 9 Nov 2015

arxiv: v1 [cs.cl] 6 Jul 2017

arxiv: v5 [cs.lg] 2 Nov 2015

Faster Training of Very Deep Networks Via p-norm Gates

Analysis of Feature Maps Selection in Supervised Learning Using Convolutional Neural Networks

YNU-HPCC at IJCNLP-2017 Task 1: Chinese Grammatical Error Diagnosis Using a Bi-directional LSTM-CRF Model

arxiv: v4 [cs.lg] 16 Apr 2015

FASTER SEQUENCE TRAINING. Albert Zeyer, Ilia Kulikov, Ralf Schlüter, Hermann Ney

arxiv: v2 [cs.ne] 7 Apr 2015

IMPROVING STOCHASTIC GRADIENT DESCENT

RAGAV VENKATESAN VIJETHA GATUPALLI BAOXIN LI NEURAL DATASET GENERALITY

WHY ARE DEEP NETS REVERSIBLE: A SIMPLE THEORY,

Presented By: Omer Shmueli and Sivan Niv

arxiv: v1 [stat.ml] 2 Sep 2014

Multi-Source Neural Translation

Feature Design. Feature Design. Feature Design. & Deep Learning

Residual LSTM: Design of a Deep Recurrent Architecture for Distant Speech Recognition

Continuous Space Language Model(NNLM) Liu Rong Intern students of CSLT

Recurrent Neural Networks. deeplearning.ai. Why sequence models?

Part-of-Speech Tagging + Neural Networks 3: Word Embeddings CS 287

Based on the original slides of Hung-yi Lee

Natural Language Processing and Recurrent Neural Networks

Deep learning / Ian Goodfellow, Yoshua Bengio and Aaron Courville. - Cambridge, MA ; London, Spis treści

Neural Turing Machine. Author: Alex Graves, Greg Wayne, Ivo Danihelka Presented By: Tinghui Wang (Steve)

Understanding Dropout

MULTIPLICATIVE LSTM FOR SEQUENCE MODELLING

arxiv: v4 [cs.cl] 5 Jun 2017

Classification of Higgs Boson Tau-Tau decays using GPU accelerated Neural Networks

An exploration of dropout with LSTMs

Deep Learning Tutorial. 李宏毅 Hung-yi Lee

Learning Deep Architectures

Modelling Time Series with Neural Networks. Volker Tresp Summer 2017

Deep Q-Learning with Recurrent Neural Networks

Large-Scale Feature Learning with Spike-and-Slab Sparse Coding

Lecture 11 Recurrent Neural Networks I

arxiv: v2 [cs.lg] 14 Dec 2012

A TIME-RESTRICTED SELF-ATTENTION LAYER FOR ASR

Gate Activation Signal Analysis for Gated Recurrent Neural Networks and Its Correlation with Phoneme Boundaries

What to Expect from Expected Kneser-Ney Smoothing

Introduction to Deep Neural Networks

arxiv: v1 [eess.iv] 28 May 2018

CKY-based Convolutional Attention for Neural Machine Translation

Recurrent Neural Networks. Jian Tang

What Do Neural Networks Do? MLP Lecture 3 Multi-layer networks 1

Transcription:

Inter-document Contextual Language Model Quan Hung Tran and Ingrid Zukerman and Gholamreza Haffari Faculty of Information Technology Monash University, Australia hung.tran,ingrid.zukerman,gholamreza.haffari@monash.edu Abstract In this paper, we examine the impact of employing contextual, structural information from a tree-structured document set to derive a language model. Our results show that this information significantly improves the accuracy of the resultant model. 1 Introduction Conventional Language Models (LMs) are based on n-grams, and thus rely upon a limited number of preceding words to assign a probability to the next word in a document. Recently, Mikolov et al. (2010) proposed a Recurrent Neural Network (RNN) LM which uses a vector representation of all the preceding words in a sentence as the context for language modeling. This model, which theoretically can utilize an infinite context window within a sentence, yields an LM with lower perplexity than that of n-gram-based LMs. However, the model does not leverage the wider contextual information provided by words in other sentences in a document or in related documents. Several researchers have explored extending the contextual information of an RNN-based LM. Mikolov and Zweig (2012) proposed a contextdependent RNN LM that employs Latent Dirichlet Allocation for modeling a long span of context. Wang and Cho (2015) offered a bag-of-words representation of preceding sentences as the context for the RNN LM. Ji et al. (2015) used a Document- Context LM (DCLM) to leverage both intra- and inter-sentence context. These works focused on contextual information at the document level for LM, but did not consider information at the inter-document level. Many document sets on the Internet are structured, which means there are connections between different documents. This phenomenon is prominent in social media, where all the posts are directly linked to several other posts. We posit that these related documents could hold important information about a particular post, including the topic and language use, and propose an RNN-based LM architecture that utilizes both intra- and inter-document contextual information. Our approach, which was tested on the social media dataset reddit, yielded promising results, which significantly improve on the state of the art. 2 Dataset We used pre-collected reddit data, 1 which as of December, 2015, consists of approximately 1.7 billion comments in JSON format. A comment thread starts with a topic, which might be a link or an image. The users then begin to comment on the topic, or reply to previous comments. Over time, this process creates a tree-structured document repository (Figure 1), where a level indicator is assigned to each comment, e.g., a response to the root topic is assigned level 1, and the reply to a level n comment is assigned level n + 1. We parsed the raw data in JSON format into a tree structure, removing threads that have less than three comments, contain deleted comments, or do not have comments above 1 https://www.reddit.com/r/datasets/ comments/3bxlg7/i_have_every_publicly_ available_reddit_comment 762 Proceedings of NAACL-HLT 2016, pages 762 766, San Diego, California, June 12-17, 2016. c 2016 Association for Computational Linguistics

x t is obtained from the one-hot representation using an affine transformation, as follows: x t = W p o t + b p (3) where o t is the one-hot representation, W p is the projection matrix, and b p is a bias term. Figure 1: reddit example Table 1: Dataset statistics # of # of # of # of threads posts sentences tokens training 1500 14592 40709 648624 testing 500 5007 13612 217164 validation 100 968 2762 44575 level 2. We randomly selected 2100 threads that fit these criteria. The data were then split into training/testing/validation sets. Table 1 displays some statistics of our dataset. 3 Baseline Neural Language Models Our inter-document contextual language model scaffolds on the RNN LM (Mikolov et al., 2010) and DCLMs (Ji et al., 2015), as described below. RNN-LSTM. Given a sentence {x t } t [1,...,N], where x t is the vector representation of the t-th word in the sentence, and N is the length of the sentence, Mikolov et al. s (2010) RNN LM can be defined as: h t = f(h t 1, x t ) (1) y t softmax (W o h t 1 + b o ) (2) where h t is the hidden unit at word t, and y t is the prediction of the t-th word given the previous hidden unit h t 1. The function f in Equation 1 can be any non-linear function. Following the approach in (Sundermeyer et al., 2012) and (Ji et al., 2015), we make use of Long Short-Term Memory (LSTM) units (Hochreiter and Schmidhuber, 1997) rather than the simple hidden units used in the original RNN LM. In our work, the word representation Document Context LMs (DCLMs). We reimplemented two of Ji et al. s (2015) DCLMs as our baselines, 2 viz Context-to-context (Figure 2a) and Context-to-output (Figure 2b). These models extend the RNN-LSTM model by leveraging information from preceding sentences. The context-to-context model (ccdclm) concatenates the final hidden unit of the previous sentence with the word vectors of the current sentence. Thus, Equation 1 becomes: h i t = f(h i t 1, x i,t) (4) ( ) x i,t = concat x i,t, h i 1 (5) where is the length of the previous sentence in the document, x i,t is the vector representation of the t-th word in the i-th sentence, x i,t is the concatenation of the vector representation x i,t and the previous sentence s final hidden unit h i 1. The context-to-output model (codclm) applies the additional information directly to the worddecoding phase. Thus, Equation 2 becomes: ( ) y i,t softmax W o h i t 1 + W oh i 1 + b o 4 Inter-document Context Language Model (6) We now extend the DCLM by leveraging the information at the inter-document level, taking advantage of the structure of the repository a tree in reddit. Specifically, by harnessing the information in documents related to a target document, i.e., its siblings and parent, the LM is expected to contain additional relevant information, and hence lower perplexity. Formally, let s call the sentencelevel context vector h s, the parent document context 2 Ji et al. s three options performed similarly. 763

(a) ccdclm (b) codclm (c) Our model (PS-ccDCLM) Figure 2: Contextual language models; see Sections 3 and 4 for detailed descriptions. vector h p, the sibling context vector h l, and the overall context vector h c. Our framework is defined as: h c = g h (h s, h l, h p ) (7) x i,t = g i (x i,t, h c ) (8) h t = f(h t 1, x t) (9) y t softmax ( g o (h t 1, x t, h c ) ) (10) We use the last hidden vector of the RNNs as the representation of the parent post, the older-sibling, and the previous sentence. The definition of the context function (g h ), the input function (g i ), and the word-decoding function (g o ) yields different configurations. We also explored two strategies of training the models: Disconnected (disc) and Fully Connected (fulc). In the disc-trained models, the error signal within a time step (i.e. a post or sentence) only affects the parameters in that time step. This is in contrast to the fulc-trained models, where the error signal is propagated to the previous time steps, hence influencing parameters in those time steps too. 4.1 Analysis of our modelling approach In this section, we empirically analyze different training and modelling decisions within our framework, namely DC vs FC training, as well as contextual information from parent vs sibling. The Setup. For our analysis, we employed a subset of the data described in Table 1 which contains 450 threads split into training/testing/validation sets with 300/100/50 threads respectively. The hiddenvector and word-vector dimensions were set to 50 and 70, respectively. The models were implemented in Theano (Bastien et al., 2012; Bergstra et al., 2010), and trained with RMSProp (Tieleman and Hinton, 2012). Table 2: disc/fulc-trained models vs the baselines. Model Training Perplexity 6-gram na 205 RNN-LSTM na 182 ccdclm disc 185 codclm disc 181 ccdclm fulc 176 codclm fulc 172 disc vs fulc. We first compared the disc and fulc strategies, at the sentence level only, in order to select the best strategy in a known setting. To this effect, we re-implemented Ji et al. s (2015) DCLMs with the disc strategy, noting that Ji et al. s original sentence-based models are fulc-trained. The results of this experiment appear in Table 2 which further compares these models with the following baselines: (1) vanila RNN-LSTM, and (2) a 6-gram LM with Kneser-Ney smoothing 3 (Kneser and Ney, 1995). The disc-trained models showed no improvement over the RNN-LSTM, and lagged behind their fulctrained counterparts. The lower performance of the disc-trained models may be due to not fully leveraging the contextual information; disc-training lose information, as the error signal from the current time step is not used to calibrate the parameters of previous time steps. Therefore, we make use of fulc strategy to train our models in the rest of this paper. Parent vs Sibling Context. The inter-document information in reddit s case may come from a parent post, sibling posts or both. We tested our models with different combinations of inter-document con- 3 Tested with the SRILM toolkit (Stolcke et al., 2011). 764

text information to reflect these options. At present, we consider only the closest older-sibling of a post, as it is deemed the most related; different combinations of sibling posts are left for future work. We tested the following three context-to-context configurations: parent only (P-ccDCLM), sibling only (SccDCLM), and parent and sibling (PS-ccDCLM), which define the context function as Equation 11, 12 and 13 respectively. The three configurations use the same word-decoding function (Equation 15) and the same input function (Equation 14). h c = concat (h s, h p ) (11) h c = concat (h s, h l ) (12) h c = concat (h s, h l, h p ) (13) x i,t = concat (x i,t, h c ) (14) y i,t softmax (W o h t 1 + b o ) (15) The results of this experiment appear in the first three rows of Table 3, which shows that the bestperforming model is PS-ccDCLM. As discussed by Ji et al. (2015), the codclm makes the hidden units of the previous sentence have no effect on the hidden units of the current sentence. While this configuration might have some advantages (Ji et al., 2015), applying it directly to a larger context may lead to complications. Suppose we use the last hidden unit of the previous document as the context for the next document. With the context-to-output approach, the last hidden unit summarizes only the information in the last sentence of the previous document, and doesn t reflect the entire document. We address this problem by not using the context-to-output approach in isolation. Instead, we use the context-to-output approach in tandem with the context-to-context approach of ccdclm. This approach was tested in an additional parentsibling configuration (PS-ccoDCLM), as an alternative to the best performing context-to-context configuration. The PS-ccoDCLM is similar to the PSccDCLM except for the decoding equation, which is changed into Equation 16. y i,t softmax ( W o h i t 1 + W oh c + b o ) (16) Based on the results of these trials, we chose the best-performing PS-ccDCLM (Figure 2c) as our final system. Table 3: Comparing models incorporating parent (P) and/or sibling (S) contextual information. Systems Perplexity P-ccDCLM 172 S-ccDCLM 174 PS-ccDCLM 168 PS-ccoDCLM 175 Table 4: Results on the entire dataset. Systems Perplexity 6-gram 209 RNN-LSTM 184 ccdclm 168 codclm 176 PS-ccDCLM 159 4.2 Results The model perplexity obtained by the baselines and our best-performing model for the test set (Table 1) is shown in Table 4 our system (PS-ccDCLM) statistically significantly outperforms the best baseline (ccdclm), with α = 0.01, using the Friedman test. The inter-sentence contextual information under the context-to-context regime (ccdclm) decreases model perplexity by 9% compared to the original RNN-LSTM, while the inter-document contextual information (PS-ccDCLM) reduces perplexity by a further 5% compared to ccdclm. 5 Discussion and Future Work Our results show that including inter-document contextual information yields additional improvements to those obtained from inter-sentence information. However, as expected, the former are smaller than the latter, as sentences in the same post are more related than sentences in different posts. At present, we rely on the final hidden-vector of the sentences and the posts for contextual information. In the future, we propose to explore other options, such as additional models to combine the contextual information from all siblings in the tree structure, and extending our model to structures beyond trees. 765

References Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian J. Goodfellow, Arnaud Bergeron, Nicolas Bouchard, and Yoshua Bengio. 2012. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop. James Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. 2010. Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy), June. Oral Presentation. Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735 1780. Yangfeng Ji, Trevor Cohn, Lingpeng Kong, Chris Dyer, and Jacob Eisenstein. 2015. Document context language models. arxiv preprint arxiv:1511.03962. Reinhard Kneser and Hermann Ney. 1995. Improved backing-off for M-gram language modeling. In ICASSP-95, volume 1, pages 181 184. IEEE. Tomas Mikolov and Geoffrey Zweig. 2012. Context dependent recurrent neural network language model. In SLT, pages 234 239. Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernockỳ, and Sanjeev Khudanpur. 2010. Recurrent neural network based language model. In INTERSPEECH 2010, pages 1045 1048. Andreas Stolcke, Jing Zheng, Wen Wang, and Victor Abrash. 2011. SRILM at sixteen: Update and outlook. In Proceedings of IEEE Automatic Speech Recognition and Understanding Workshop, page 5. Martin Sundermeyer, Ralf Schlüter, and Hermann Ney. 2012. LSTM neural networks for language modeling. In INTERSPEECH, pages 194 197. Tijmen. Tieleman and Geoffrey Hinton. 2012. Neural Networks for Machine Learning. http://www. youtube.com/watch?v=o3sxac4hxzu. [Online]. Tian Wang and Kyunghyun Cho. 2015. Largercontext language modelling. arxiv preprint arxiv:1511.03729. 766